You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/02/10 15:21:17 UTC

[GitHub] [ozone] sadanand48 commented on a change in pull request #3065: HDDS-6153. Add simple integration test to the read-replicas debug tool.

sadanand48 commented on a change in pull request #3065:
URL: https://github.com/apache/ozone/pull/3065#discussion_r803777230



##########
File path: hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug.robot
##########
@@ -15,22 +15,48 @@
 
 *** Settings ***
 Documentation       Test ozone Debug CLI
-Library             OperatingSystem
+Library             Collections
 Resource            ../commonlib.robot
-Test Timeout        2 minute
-Suite Setup         Write key
+
 *** Variables ***
+${VOLUME}           vol1
+${BUCKET}           bucket1
+${TESTFILE}         testfile
 
 *** Keywords ***
-Write key
-    Execute             ozone sh volume create o3://om/vol1 --space-quota 100TB --namespace-quota 100
-    Execute             ozone sh bucket create o3://om/vol1/bucket1
-    Execute             ozone sh key put o3://om/vol1/bucket1/debugKey /opt/hadoop/NOTICE.txt
+Compare JSON
+    [arguments]                     ${json}
+    Should Be Equal                 ${json}[filename]                   ${VOLUME}/${BUCKET}/${TESTFILE}
+    ${file_size} =                  Get File Size                       ${TESTFILE}
+    Should Be Equal                 ${json}[datasize]                   ${file_size}
+    Should Be Equal As Integers     ${json}[blocks][0][blockIndex]      1
+    Should Not Be Empty             Convert To String       ${json}[blocks][0][containerId]
+    Should Not Be Empty             Convert To String       ${json}[blocks][0][localId]
+    Should Be Equal As Integers     ${json}[blocks][0][length]          1048576
+    Should Not Be Empty             Convert To String       ${json}[blocks][0][offset]
+    ${datanodes_b1} =               Create List   ${json}[blocks][0][replicas][0][hostname]    ${json}[blocks][0][replicas][1][hostname]   ${json}[blocks][0][replicas][2][hostname]
+    ${datanodes_expected_b1} =      Create List  ozone_datanode_1.ozone_default  ozone_datanode_2.ozone_default  ozone_datanode_3.ozone_default
+    Lists Should Be Equal	        ${datanodes_b1}    ${datanodes_expected_b1}   ignore_order=True
+    Should Be Equal As Integers     ${json}[blocks][1][blockIndex]      2
+    Should Not Be Empty             Convert To String       ${json}[blocks][1][containerId]
+    Should Not Be Empty             Convert To String       ${json}[blocks][1][localId]
+    Should Be Equal As Integers     ${json}[blocks][1][length]          451424
+    Should Not Be Empty             Convert To String       ${json}[blocks][1][offset]
+    ${datanodes_b2} =               Create List   ${json}[blocks][1][replicas][0][hostname]    ${json}[blocks][1][replicas][1][hostname]   ${json}[blocks][1][replicas][2][hostname]
+    ${datanodes_expected_b2} =      Create List  ozone_datanode_1.ozone_default  ozone_datanode_2.ozone_default  ozone_datanode_3.ozone_default
+    Lists Should Be Equal	        ${datanodes_b2}    ${datanodes_expected_b2}   ignore_order=True
 
-*** Test Cases ***
-Test ozone debug
-    ${result} =     Execute             ozone debug chunkinfo o3://om/vol1/bucket1/debugKey | jq -r '.KeyLocations[0][0].Locations'
-                    Should contain      ${result}       files
-    ${result} =     Execute             ozone debug chunkinfo o3://om/vol1/bucket1/debugKey | jq -r '.KeyLocations[0][0].Locations.files[0]'
-                    File Should Exist   ${result}
+Check cheksum mismatch error

Review comment:
       typo : checksum

##########
File path: hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-tests.robot
##########
@@ -0,0 +1,60 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation       Test ozone Debug CLI
+Library             OperatingSystem
+Resource            ../commonlib.robot
+Resource            ozone-debug.robot
+Test Timeout        5 minute
+Suite Setup         Write keys
+*** Variables ***
+${VOLUME}           vol1
+${BUCKET}           bucket1
+${DEBUGKEY}         debugKey
+${TESTFILE}         testfile
+
+*** Keywords ***
+Write keys
+    Execute             ozone sh volume create o3://om/${VOLUME} --space-quota 100TB --namespace-quota 100
+    Execute             ozone sh bucket create o3://om/${VOLUME}/${BUCKET}
+    Execute             ozone sh key put o3://om/${VOLUME}/${BUCKET}/${DEBUGKEY} /opt/hadoop/NOTICE.txt
+    Execute             dd if=/dev/urandom of=testfile bs=100000 count=15
+    Execute             ozone sh key put o3://om/${VOLUME}/${BUCKET}/${TESTFILE} testfile
+
+*** Test Cases ***
+Test ozone debug chunkinfo
+    ${result} =     Execute             ozone debug chunkinfo o3://om/${VOLUME}/${BUCKET}/${DEBUGKEY} | jq -r '.KeyLocations[0][0].Locations'
+                    Should contain      ${result}       files
+    ${result} =     Execute             ozone debug chunkinfo o3://om/${VOLUME}/${BUCKET}/${DEBUGKEY} | jq -r '.KeyLocations[0][0].Locations.files[0]'
+                    File Should Exist   ${result}
+
+Test ozone debug read-replicas
+    Execute                             ozone debug read-replicas o3://om/${VOLUME}/${BUCKET}/${TESTFILE}

Review comment:
       First few checks/lines  are common in all three tests, Can we move to a common function?

##########
File path: hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-modified-env.robot
##########
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+Documentation       Test read-replicas in case of one datanode is unavailable
+Library             OperatingSystem
+Resource            ../commonlib.robot
+Resource            ozone-debug.robot
+Test Timeout        5 minute
+*** Variables ***
+${VOLUME}           vol1

Review comment:
       CI is probably failing because there is already another volume vol1 created by some other test . We could try changing volume name here .




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org