peterxcli commented on code in PR #8702:
URL: https://github.com/apache/ozone/pull/8702#discussion_r2174245811


##########
hadoop-ozone/dist/src/main/smoketest/s3/commonawslib.robot:
##########
@@ -191,3 +191,21 @@ Revoke S3 secrets
     Execute and Ignore Error             ozone s3 revokesecret -y -u testuser
     Execute and Ignore Error             ozone s3 revokesecret -y -u testuser2
 
+Get bucket owner
+    [arguments]    ${bucket}
+    ${owner} =     Execute     ozone sh bucket info /s3v/${bucket} | jq -r 
'.owner'
+    [return]       ${owner}
+
+Execute AWSS3APICli using bucket ownership verification
+    [arguments]    ${command}    ${expected_bucket_owner}    
${expected_source_bucket_owner}=${EMPTY}
+    ${cmd} =       Set Variable           ${command} --expected-bucket-owner 
${expected_bucket_owner}
+    ${cmd} =       Set Variable If        '${expected_source_bucket_owner}' != 
'${EMPTY}'    ${cmd} --expected-source-bucket-owner 
${expected_source_bucket_owner}    ${cmd}
+    ${result} =    Execute AWSS3APICli    ${cmd}

Review Comment:
   The positive scenarios needs assertion, too.
   ```suggestion
       Should Not Contain    ${result}    Access Denied
       ${result} =    Execute AWSS3APICli    ${cmd}
   ```



##########
hadoop-ozone/dist/src/main/smoketest/s3/commonawslib.robot:
##########
@@ -191,3 +191,21 @@ Revoke S3 secrets
     Execute and Ignore Error             ozone s3 revokesecret -y -u testuser
     Execute and Ignore Error             ozone s3 revokesecret -y -u testuser2
 
+Get bucket owner
+    [arguments]    ${bucket}
+    ${owner} =     Execute     ozone sh bucket info /s3v/${bucket} | jq -r 
'.owner'
+    [return]       ${owner}
+
+Execute AWSS3APICli using bucket ownership verification
+    [arguments]    ${command}    ${expected_bucket_owner}    
${expected_source_bucket_owner}=${EMPTY}
+    ${cmd} =       Set Variable           ${command} --expected-bucket-owner 
${expected_bucket_owner}
+    ${cmd} =       Set Variable If        '${expected_source_bucket_owner}' != 
'${EMPTY}'    ${cmd} --expected-source-bucket-owner 
${expected_source_bucket_owner}    ${cmd}
+    ${result} =    Execute AWSS3APICli    ${cmd}

Review Comment:
   Or we can merge Execute "AWSS3APICli using bucket ownership verification" 
and "Execute AWSS3APICli and failed bucket ownership verification" into one by 
adding a flag to indicate if we expect a failure.



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

Reply via email to