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 18:43:22 UTC

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

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



##########
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:
       Thanks, I fixed it.




-- 
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