This is an automated email from the ASF dual-hosted git repository. weichiu pushed a commit to branch HDDS-13454 in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/HDDS-13454 by this push: new af8d5736a15 HDDS-13454. Add robot test and documentation for ozone shell s3 setsecret command. af8d5736a15 is described below commit af8d5736a15772023612216a56555a8f56503689 Author: Wei-Chiu Chuang <weic...@apache.org> AuthorDate: Tue Jul 22 17:26:54 2025 -0700 HDDS-13454. Add robot test and documentation for ozone shell s3 setsecret command. Change-Id: I6142962cf7b366323cd6f38c42fe055e0cb6d3a0 --- .../main/smoketest/security/ozone-secure-s3.robot | 64 +++------------------- hadoop-ozone/src/site/markdown/s3-shell.md | 17 ++++++ 2 files changed, 25 insertions(+), 56 deletions(-) diff --git a/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot b/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot index 70bade5f1e8..eae0c96765c 100644 --- a/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot +++ b/hadoop-ozone/dist/src/main/smoketest/security/ozone-secure-s3.robot @@ -1,60 +1,12 @@ -# 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. +#suite: ozonesecure *** Settings *** -Documentation Smoke test to start cluster with docker-compose environments. -Library OperatingSystem -Library String -Library BuiltIn -Resource ../commonlib.robot -Resource ../s3/commonawslib.robot -Test Timeout 5 minutes - -*** Variables *** -${ENDPOINT_URL} http://s3g:9878 -${TEMPDIR} /tmp -${TEST_FILE} NOTICE.txt - -*** Keywords *** -Setup volume names - ${random} Generate Random String 2 [NUMBERS] - Set Suite Variable ${volume1} fstest${random} - Set Suite Variable ${volume2} fstest2${random} +Suite Setup Generate S3 Credentials +Test Teardown Cleanup S3 Credentials +Resource ./common.robot *** Test Cases *** -Secure S3 test Success - Run Keyword Setup s3 tests - ${output} = Execute aws s3api --endpoint-url ${ENDPOINT_URL} create-bucket --bucket bucket-test123 - ${output} = Execute aws s3api --endpoint-url ${ENDPOINT_URL} list-buckets - Should contain ${output} bucket-test123 - -Secure S3 put-object test - ${testFilePath} = Set Variable ${TEMPDIR}/${TEST_FILE} - Copy File ${TEST_FILE} ${testFilePath} - ${output} = Execute aws s3api --endpoint ${ENDPOINT_URL} put-object --bucket=bucket-test123 --key=tmp1/tmp2/NOTICE.txt --body=${testFilePath} - ${output} = Execute aws s3api --endpoint ${ENDPOINT_URL} list-objects --bucket=bucket-test123 - Should contain ${output} tmp1/tmp2/NOTICE.txt - ${output} = Execute aws s3api --endpoint ${ENDPOINT_URL} put-object --bucket=bucket-test123 --key=tmp3//tmp4/NOTICE.txt --body=${testFilePath} - ${output} = Execute aws s3api --endpoint ${ENDPOINT_URL} list-objects --bucket=bucket-test123 - Should contain ${output} tmp3//tmp4/NOTICE.txt - ${output} = Execute aws s3api --endpoint ${ENDPOINT_URL} put-object --bucket=bucket-test123 --key=//tmp5/tmp6/NOTICE.txt --body=${testFilePath} - ${output} = Execute aws s3api --endpoint ${ENDPOINT_URL} list-objects --bucket=bucket-test123 - Should contain ${output} //tmp5/tmp6/NOTICE.txt - -Secure S3 test Failure - Run Keyword Setup dummy credentials for S3 - ${rc} ${result} = Run And Return Rc And Output aws s3api --endpoint-url ${ENDPOINT_URL} create-bucket --bucket bucket-test123 - Should Be True ${rc} > 0 - +SetSecret Success + ${output} = Execute ozone sh s3 setsecret --secret=newsecret + Should Contain ${output} AWS_ACCESS_KEY_ID + Should Contain ${output} AWS_SECRET_ACCESS_KEY \ No newline at end of file diff --git a/hadoop-ozone/src/site/markdown/s3-shell.md b/hadoop-ozone/src/site/markdown/s3-shell.md new file mode 100644 index 00000000000..f5bd63f8353 --- /dev/null +++ b/hadoop-ozone/src/site/markdown/s3-shell.md @@ -0,0 +1,17 @@ +# S3 Shell + +## Set Secret + +Updates the secret for an S3 user. + +### Syntax + +```bash +ozone sh s3 setsecret --secret=<newsecret> +``` + +### Examples + +```bash +ozone sh s3 setsecret --secret=my-new-secret +``` --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@ozone.apache.org For additional commands, e-mail: commits-h...@ozone.apache.org