This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new dc6df43e34 HDDS-8152. Reduce S3 acceptance test setup time (#4393)
dc6df43e34 is described below

commit dc6df43e346c4167784a24b622200e7d02c77c70
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Mar 22 08:39:59 2023 +0100

    HDDS-8152. Reduce S3 acceptance test setup time (#4393)
---
 .../dist/src/main/smoketest/s3/bucketlist.robot    |  6 +++--
 .../dist/src/main/smoketest/s3/commonawslib.robot  | 27 ++++++++++++++++------
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/smoketest/s3/bucketlist.robot 
b/hadoop-ozone/dist/src/main/smoketest/s3/bucketlist.robot
index cdea52f5b6..1c60f4abe7 100644
--- a/hadoop-ozone/dist/src/main/smoketest/s3/bucketlist.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/s3/bucketlist.robot
@@ -41,6 +41,8 @@ Get bucket info with Ozone Shell to check the owner field
                         # Also see "Setup dummy credentials for S3" in 
commonawslib.robot
 
 List buckets with empty access id
-                        Execute                    aws configure set 
aws_access_key_id ''
+    [setup]             Save AWS access key
+                        Execute     aws configure set aws_access_key_id ''
     ${result} =         Execute AWSS3APICli and checkrc         list-buckets   
 255
-                        Should contain            ${result}         The 
authorization header you provided is invalid
\ No newline at end of file
+                        Should contain            ${result}         The 
authorization header you provided is invalid
+    [teardown]          Restore AWS access key
diff --git a/hadoop-ozone/dist/src/main/smoketest/s3/commonawslib.robot 
b/hadoop-ozone/dist/src/main/smoketest/s3/commonawslib.robot
index 375c33d280..b9622fbcf3 100644
--- a/hadoop-ozone/dist/src/main/smoketest/s3/commonawslib.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/s3/commonawslib.robot
@@ -24,6 +24,8 @@ ${OZONE_S3_HEADER_VERSION}     v4
 ${OZONE_S3_SET_CREDENTIALS}    true
 ${BUCKET}                      generated
 ${KEY_NAME}                    key1
+${OZONE_S3_TESTS_SET_UP}       ${FALSE}
+${OZONE_AWS_ACCESS_KEY_ID}     ${EMPTY}
 
 *** Keywords ***
 Execute AWSS3APICli
@@ -88,6 +90,13 @@ Setup dummy credentials for S3
                         Execute                    aws configure set 
aws_secret_access_key dlfknslnfslf
                         Execute                    aws configure set region 
us-west-1
 
+Save AWS access key
+    ${OZONE_AWS_ACCESS_KEY_ID} =      Execute     aws configure get 
aws_access_key_id
+    Set Test Variable     ${OZONE_AWS_ACCESS_KEY_ID}
+
+Restore AWS access key
+    Execute    aws configure set aws_access_key_id ${OZONE_AWS_ACCESS_KEY_ID}
+
 Generate Ozone String
     ${randStr} =         Generate Random String     10  [NUMBERS]
     [Return]             ozone-test-${randStr}
@@ -105,15 +114,15 @@ Create bucket with name
                          Should contain              ${result}         
${bucket}
 
 Setup s3 tests
+    Return From Keyword if    ${OZONE_S3_TESTS_SET_UP}
     Run Keyword        Generate random prefix
     Run Keyword        Install aws cli
     Run Keyword if    '${OZONE_S3_SET_CREDENTIALS}' == 'true'    Setup v4 
headers
-    ${BUCKET} =        Run Keyword if                            '${BUCKET}' 
== 'generated'            Create bucket
-    ...                ELSE                                      Set Variable  
  ${BUCKET}
-                       Set Suite Variable                        ${BUCKET}
-                       Run Keyword if                            '${BUCKET}' 
== 'link'                 Setup links for S3 tests
-                       Run Keyword if                            '${BUCKET}' 
== 'encrypted'            Create encrypted bucket
-                       Run Keyword if                            '${BUCKET}' 
== 'erasure'              Create EC bucket
+    Run Keyword if    '${BUCKET}' == 'generated'            Create generated 
bucket
+    Run Keyword if    '${BUCKET}' == 'link'                 Setup links for S3 
tests
+    Run Keyword if    '${BUCKET}' == 'encrypted'            Create encrypted 
bucket
+    Run Keyword if    '${BUCKET}' == 'erasure'              Create EC bucket
+    Set Global Variable  ${OZONE_S3_TESTS_SET_UP}    ${TRUE}
 
 Setup links for S3 tests
     ${exists} =        Bucket Exists    o3://${OM_SERVICE_ID}/s3v/link
@@ -122,6 +131,10 @@ Setup links for S3 tests
     Execute            ozone sh bucket create 
o3://${OM_SERVICE_ID}/legacy/source-bucket
     Create link        link
 
+Create generated bucket
+    ${BUCKET} =          Create bucket
+    Set Global Variable   ${BUCKET}
+
 Create encrypted bucket
     Return From Keyword if    '${SECURITY_ENABLED}' == 'false'
     ${exists} =        Bucket Exists    o3://${OM_SERVICE_ID}/s3v/encrypted
@@ -140,7 +153,7 @@ Create EC bucket
 
 Generate random prefix
     ${random} =          Generate Ozone String
-                         Set Suite Variable  ${PREFIX}  ${random}
+                         Set Global Variable  ${PREFIX}  ${random}
 
 Perform Multipart Upload
     [arguments]    ${bucket}    ${key}    @{files}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to