You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "peterxcli (via GitHub)" <gi...@apache.org> on 2025/06/30 05:28:31 UTC

Re: [PR] HDDS-13260. Add smoke test for bucket owner condition [ozone]

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