Tejaskriya commented on code in PR #8941:
URL: https://github.com/apache/ozone/pull/8941#discussion_r2291336812
##########
hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-tests.robot:
##########
@@ -25,25 +27,78 @@ Suite Setup Write keys
${PREFIX} ${EMPTY}
${VOLUME} cli-debug-volume${PREFIX}
${BUCKET} cli-debug-bucket
+${BASE_PATH} o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET}
${DEBUGKEY} debugKey
${TESTFILE} testfile
+${RATIS_ONE_KEY} ratis-one-key
+${RATIS_THREE_KEY} ratis-three-key
+${EC_KEY} ec-key
*** Keywords ***
Write keys
Execute ozone sh volume create o3://${OM_SERVICE_ID}/${VOLUME}
--space-quota 100TB --namespace-quota 100
- Execute ozone sh bucket create
o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET} --space-quota 1TB
+ Execute ozone sh bucket create ${BASE_PATH} --space-quota 1TB
Execute dd if=/dev/urandom of=${TEMP_DIR}/${TESTFILE}
bs=100000 count=15
- Execute ozone sh key put
o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET}/${TESTFILE} ${TEMP_DIR}/${TESTFILE}
+ # Create default key (RATIS THREE by default)
+ Execute ozone sh key put ${BASE_PATH}/${TESTFILE}
${TEMP_DIR}/${TESTFILE}
+ # Create RATIS ONE key
+ Create Key ${BASE_PATH}/${RATIS_ONE_KEY}
${TEMP_DIR}/${TESTFILE} --type RATIS --replication ONE
+ # Create RATIS THREE key
+ Create Key ${BASE_PATH}/${RATIS_THREE_KEY}
${TEMP_DIR}/${TESTFILE} --type RATIS --replication THREE
+ # Create EC rs-3-2-1024k key
+ Create Key ${BASE_PATH}/${EC_KEY}
${TEMP_DIR}/${TESTFILE} --type EC --replication rs-3-2-1024k
+
+Execute and validate replicas verify with filter
+ [Arguments] ${replication_type} ${replication_factor}
${verification_type} ${expected_key_count}
+ ${output} = Execute replicas verify with replication filter
${replication_type} ${replication_factor} ${verification_type}
+ ${json} = Parse replicas verify JSON output ${output}
+ ${keys} = Get From Dictionary ${json} keys
+ ${key_count} = Get Length ${keys}
+ Should Be Equal As Integers ${key_count} ${expected_key_count}
+ [Return] ${json}
*** Test Cases ***
-Test ozone debug replicas verify checksums
- ${output} = Execute ozone debug replicas verify --checksums
--block-existence --container-state
o3://${OM_SERVICE_ID}/${VOLUME}/${BUCKET}/${TESTFILE}
- ${json} = Parse replicas verify JSON output ${output}
+Test ozone debug replicas verify checksums, block-existence and container-state
+ ${output} = Execute ozone debug replicas verify --checksums
--block-existence --container-state ${BASE_PATH}/${TESTFILE}
+ ${json} = Parse replicas verify JSON output ${output}
# 'keys' array should be empty if all keys and their replicas passed
Should Be Empty ${json}[keys]
Should Be True ${json}[pass] ${True}
+Test ozone debug replicas verify with RATIS ONE filter
+ ${json} = Execute and validate replicas verify with filter
RATIS ONE checksums 1
+ ${key_names} = Get key names from output ${json}
Review Comment:
Please shift this line into the keyword `Execute and validate replicas
verify with filter` as it is still duplicated for all 3 tests.
Instead of returning the json, the list can be returned.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]