diff --git a/spec/041_set-the-versioning-for-a-bucket-with-acl_spec.sh b/spec/041_set-the-versioning-for-a-bucket-with-acl_spec.sh index fe7d7cb..93638f4 100644 --- a/spec/041_set-the-versioning-for-a-bucket-with-acl_spec.sh +++ b/spec/041_set-the-versioning-for-a-bucket-with-acl_spec.sh @@ -18,7 +18,11 @@ Describe 'Set the versioning for a bucket with ACL:' category:"ObjectVersioning" test_bucket_name="$bucket_name-$client-$profile" printf "\n$test_bucket_name" >> ./report/buckets_to_delete.txt id=$(aws s3api --profile $profile-second list-buckets | jq -r '.Owner.ID') - Skip if "No such a "$profile-second" user" is_variable_null "$id" + #Skip if "No such a "$profile-second" user" is_variable_null "$id" + if [ "$id" = "" ]; then + Skip "No such a "$profile-second" user" + return 0 + fi aws --profile $profile s3 mb s3://$test_bucket_name > /dev/null aws s3api --profile $profile put-bucket-acl --bucket $test_bucket_name --grant-write id=$id --grant-read id=$id > /dev/null case "$client" in diff --git a/spec/044_upload-object-to-versioning-in-the-private-acl-bucket_spec.sh b/spec/044_upload-object-to-versioning-in-the-private-acl-bucket_spec.sh index 735ee9c..372a9ee 100644 --- a/spec/044_upload-object-to-versioning-in-the-private-acl-bucket_spec.sh +++ b/spec/044_upload-object-to-versioning-in-the-private-acl-bucket_spec.sh @@ -18,7 +18,11 @@ Describe 'Upload object to versioning in the private acl bucket:' category:"Obje test_bucket_name="$bucket_name-$client-$profile" printf "\n$test_bucket_name" >> ./report/buckets_to_delete.txt id=$(aws s3api --profile $profile-second list-buckets | jq -r '.Owner.ID') - Skip if "No such a "$profile-second" user" is_variable_null "$id" + #Skip if "No such a "$profile-second" user" is_variable_null "$id" + if [ "$id" = "" ]; then + Skip "No such a "$profile-second" user" + return 0 + fi aws --profile $profile s3 mb s3://$test_bucket_name > /dev/null aws s3api --profile $profile put-bucket-acl --bucket $test_bucket_name --grant-write id=$id --grant-read id=$id > /dev/null aws s3api --profile $profile put-bucket-versioning --bucket $test_bucket_name --versioning-configuration Status=Enabled > /dev/null diff --git a/spec/045_download-object-to-versioning-in-the-public-bucket_spec.sh b/spec/045_download-object-to-versioning-in-the-public-bucket_spec.sh index 82d9425..149c46e 100644 --- a/spec/045_download-object-to-versioning-in-the-public-bucket_spec.sh +++ b/spec/045_download-object-to-versioning-in-the-public-bucket_spec.sh @@ -13,6 +13,11 @@ Describe 'Download object to versioning in the public bucket:' category:"ObjectV profile=$1 client=$2 test_bucket_name="$bucket_name-$client-$profile" + id=$(aws s3api --profile $profile-second list-buckets | jq -r '.Owner.ID') + if [ "$id" = "" ]; then + Skip "No such a "$profile-second" user" + return 0 + fi printf "\n$test_bucket_name" >> ./report/buckets_to_delete.txt aws --profile $profile s3api create-bucket --bucket $test_bucket_name --acl public-read > /dev/null aws s3api --profile $profile put-bucket-versioning --bucket $test_bucket_name --versioning-configuration Status=Enabled > /dev/null @@ -32,11 +37,9 @@ Describe 'Download object to versioning in the public bucket:' category:"ObjectV ;; "mgc") mgc workspace set $profile-second > /dev/null - When run bash ./spec/retry_command.sh "mgc object-storage objects download --src $test_bucket_name/$file1_name --obj-version $version --dst ./$file1_name-2 --raw" - # When run mgc object-storage objects download --src $test_bucket_name/$file1_name --obj-version $version --dst ./$file1_name-2 --raw + When run mgc object-storage objects download --src $test_bucket_name/$file1_name --obj-version $version --dst ./$file1_name-2 --raw The status should be failure - #The stderr should include "403" - The output should include "403" + The stderr should include "403" ;; esac aws --profile $profile s3api delete-objects --bucket $test_bucket_name --delete "$(aws --profile $profile s3api list-object-versions --bucket $test_bucket_name| jq '{Objects: [.Versions[] | {Key:.Key, VersionId : .VersionId}], Quiet: false}')" > /dev/null diff --git a/spec/047_download-object-to-versioning-in-the-private-acl-bucket_spec.sh b/spec/047_download-object-to-versioning-in-the-private-acl-bucket_spec.sh index e8152fc..6fbd833 100644 --- a/spec/047_download-object-to-versioning-in-the-private-acl-bucket_spec.sh +++ b/spec/047_download-object-to-versioning-in-the-private-acl-bucket_spec.sh @@ -19,7 +19,10 @@ Describe 'Download object to versioning in the private ACL bucket:' category:"Ob test_bucket_name="$bucket_name-$client-$profile" printf "\n$test_bucket_name" >> ./report/buckets_to_delete.txt id=$(aws s3api --profile $profile-second list-buckets | jq -r '.Owner.ID') - Skip if "No such a "$profile-second" user" is_variable_null "$id" + if [ "$id" = "" ]; then + Skip "No such a "$profile-second" user" + return 0 + fi aws --profile $profile s3api create-bucket --bucket $test_bucket_name > /dev/null aws s3api --profile $profile put-bucket-acl --bucket $test_bucket_name --grant-write id=$id --grant-read id=$id > /dev/null aws s3api --profile $profile put-bucket-versioning --bucket $test_bucket_name --versioning-configuration Status=Enabled > /dev/null @@ -40,11 +43,9 @@ Describe 'Download object to versioning in the private ACL bucket:' category:"Ob ;; "mgc") mgc workspace set $profile-second > /dev/null - When run bash ./spec/retry_command.sh "mgc object-storage objects download --src $test_bucket_name/$file1_name --obj-version $version --dst ./$file1_name-2 --raw" - # When run mgc object-storage objects download --src $test_bucket_name/$file1_name --obj-version $version --dst ./$file1_name-2 --raw + When run mgc object-storage objects download --src $test_bucket_name/$file1_name --obj-version $version --dst ./$file1_name-2 --raw The status should be failure - #The stderr should include "403" - The output should include "403" + The stderr should include "403" ;; esac aws --profile $profile s3api delete-objects --bucket $test_bucket_name --delete "$(aws --profile $profile s3api list-object-versions --bucket $test_bucket_name| jq '{Objects: [.Versions[] | {Key:.Key, VersionId : .VersionId}], Quiet: false}')" > /dev/null diff --git a/spec/049_delete-object-with-versions_spec.sh b/spec/049_delete-object-with-versions_spec.sh index 464da77..1cbe34a 100644 --- a/spec/049_delete-object-with-versions_spec.sh +++ b/spec/049_delete-object-with-versions_spec.sh @@ -1,4 +1,4 @@ -Describe 'Delete object with versions:' category:"ObjectVersioning" +Describe 'Delete object with versions:' category:"Skip" setup(){ bucket_name="test-049-$(date +%s)" file1_name="LICENSE" diff --git a/spec/050_delete-bucket-with-objects-with-versions_spec.sh b/spec/050_delete-bucket-with-objects-with-versions_spec.sh index 5746321..04cbdc6 100644 --- a/spec/050_delete-bucket-with-objects-with-versions_spec.sh +++ b/spec/050_delete-bucket-with-objects-with-versions_spec.sh @@ -1,4 +1,4 @@ -Describe 'Delete bucket with objects with versions:' category:"ObjectVersioning" +Describe 'Delete bucket with objects with versions:' category:"Skip" setup(){ bucket_name="test-050-$(date +%s)" file1_name="LICENSE" diff --git a/spec/053_upload-files_spec.sh b/spec/053_upload-files_spec.sh index 352cc4b..6433ebd 100644 --- a/spec/053_upload-files_spec.sh +++ b/spec/053_upload-files_spec.sh @@ -151,7 +151,7 @@ Describe 'List Objects' category:"ObjectManagement" id:"061" ;; "mgc") mgc workspace set $profile > /dev/null - When run bash ./spec/retry_command.sh "mgc object-storage objects list --dst="$BUCKET_NAME" --raw" + When run bash ./spec/retry_command.sh "mgc object-storage objects list --dst="$BUCKET_NAME" --output json" # When run mgc object-storage objects list --dst="$BUCKET_NAME" --raw The status should be success for file in $FILES;do @@ -251,7 +251,7 @@ Describe 'Delete' category:"ObjectManagement" When run rclone delete "$profile:$BUCKET_NAME" --include "{$rclone_objects}" --dump headers for object_key in $objects; do The status should be success - The error should include "$object_key: Deleted" + The error should include "200 OK" done ;; "mgc") @@ -263,7 +263,7 @@ Describe 'Delete' category:"ObjectManagement" mgc_objects+='"}' done mgc_objects+="]" - When run bash ./spec/retry_command.sh "mgc object-storage objects delete-all "$BUCKET_NAME" --no-confirm --filter="$mgc_objects" --raw" + When run mgc object-storage objects delete-all "$BUCKET_NAME" --no-confirm --filter="$mgc_objects" --raw # When run mgc object-storage objects delete-all "$BUCKET_NAME" --no-confirm --filter="$mgc_objects" --raw The status should be success The output should be blank diff --git a/spec/064_delete-versioned-object_spec.sh b/spec/064_delete-versioned-object_spec.sh index ce3325a..bf58d9d 100644 --- a/spec/064_delete-versioned-object_spec.sh +++ b/spec/064_delete-versioned-object_spec.sh @@ -16,7 +16,7 @@ get_test_bucket_name(){ get_uploaded_key(){ echo "test--$profile--$client--$1--$UNIQUE_SUFIX" } -Describe "setup 064" category:"ObjectManagement" id:"064" +Describe "setup 064" category:"Skip" id:"064" Parameters:matrix $PROFILES $FILTERED_CLIENTS @@ -68,7 +68,7 @@ Describe "setup 064" category:"ObjectManagement" id:"064" End End -Describe "Delete versioned object" category:"ObjectManagement" id:"064" +Describe "Delete versioned object" category:"Skip" id:"064" Parameters:matrix $PROFILES $FILTERED_CLIENTS @@ -95,8 +95,8 @@ Describe "Delete versioned object" category:"ObjectManagement" id:"064" When run bash ./spec/retry_command.sh "mgc --debug object-storage objects delete --dst="$bucket_name/$key" --no-confirm --raw" # When run mgc --debug object-storage objects delete --dst="$bucket_name/$key" --no-confirm --raw The status should be success - The error should include "$bucket_name?delete=" - The error should include "200 OK" + The stdout should include "$bucket_name?delete=" + The stdout should include "$key" ;; esac End @@ -129,7 +129,7 @@ Describe "Delete versioned object" category:"ObjectManagement" id:"064" End End -Describe "teardown 064" category:"ObjectManagement" id:"064" +Describe "teardown 064" category:"Skip" id:"064" Parameters:matrix $PROFILES $FILTERED_CLIENTS