diff --git a/spec/049_delete-object-with-versions_spec.sh b/spec/049_delete-object-with-versions_spec.sh index 29c9b03..464da77 100644 --- a/spec/049_delete-object-with-versions_spec.sh +++ b/spec/049_delete-object-with-versions_spec.sh @@ -19,11 +19,11 @@ Describe 'Delete object with versions:' category:"ObjectVersioning" aws --profile $profile s3 cp $file1_name s3://$test_bucket_name > /dev/null case "$client" in "aws-s3api" | "aws" | "aws-s3") - When run aws --profile $profile s3 rm s3://$test_bucket_name/$file1_name + When run bash ./spec/retry_command.sh "aws --profile $profile s3 rm s3://$test_bucket_name/$file1_name" The output should include "delete" ;; "rclone") - When run rclone delete $profile:$test_bucket_name/$file1_name + When run bash ./spec/retry_command.sh "rclone delete $profile:$test_bucket_name/$file1_name" The output should include "" ;; "mgc") diff --git a/spec/064_delete-versioned-object_spec.sh b/spec/064_delete-versioned-object_spec.sh index feb4f7c..ce3325a 100644 --- a/spec/064_delete-versioned-object_spec.sh +++ b/spec/064_delete-versioned-object_spec.sh @@ -27,7 +27,7 @@ Describe "setup 064" category:"ObjectManagement" id:"064" bucket_name=$(get_test_bucket_name) When run create_bucket $profile $client $bucket_name The status should be success - The output should include "$bucket_name" + The output should include "$(create_bucket_success_output $profile $client $bucket_name)" End Example "enable versioning on test bucket of profile $1 using $2" profile=$1 @@ -35,7 +35,7 @@ Describe "setup 064" category:"ObjectManagement" id:"064" bucket_name=$(get_test_bucket_name) When run enable_versioning $profile $client $bucket_name The status should be success - The output should include "$bucket_name" + The output should include "$(enable_versioning_success_output $profile $client $bucket_name)" End Example "upload object on versioning-enabled bucket of profile $1 using $2" profile=$1 @@ -45,8 +45,7 @@ Describe "setup 064" category:"ObjectManagement" id:"064" key=$(get_uploaded_key "$local_file") When run put_object $profile $client $bucket_name $local_file $key The status should be success - The output should include "$bucket_name/$key" - The output should include "$local_file" + The output should include "$(put_object_success_output $profile $client $bucket_name $local_file $key)" End Example "overwrite object on versioning-enabled bucket of profile $1 using $2" profile=$1 @@ -56,8 +55,7 @@ Describe "setup 064" category:"ObjectManagement" id:"064" other_local_file="README.md" When run put_object $profile $client $bucket_name $other_local_file $key The status should be success - The output should include "$bucket_name/$key" - The output should include "$local_file" + The output should include "$(put_object_success_output $profile $client $bucket_name $local_file $key)" End Example "list versions of test bucket on profile $1 using $2 should have versions" profile=$1 @@ -122,7 +120,7 @@ Describe "Delete versioned object" category:"ObjectManagement" id:"064" ;; "mgc") mgc workspace set $profile > /dev/null - When run bash ./spec/retry_command.sh "mgc object-storage objects versions --dst="$bucket_name" --cli.output json --raw" + When run bash ./spec/retry_command.sh "mgc object-storage objects versions --dst="$bucket_name" --output json --raw" # When run mgc object-storage objects versions --dst="$bucket_name" --cli.output json --raw The status should be success The output should not include "\"isLatest\": true," diff --git a/spec/064_utils.sh b/spec/064_utils.sh index 89ce865..bc2ae93 100644 --- a/spec/064_utils.sh +++ b/spec/064_utils.sh @@ -24,7 +24,7 @@ create_bucket_success_output(){ "rclone") echo "" ;; "mgc") - echo "Created bucket $bucket_name" ;; + echo "$bucket_name" ;; esac } enable_versioning(){ @@ -53,7 +53,7 @@ enable_versioning_success_output(){ "rclone") echo "Enabled" ;; "mgc") - echo "Enabled versioning for $bucket_name" ;; + echo "$bucket_name" ;; esac } put_object(){ @@ -87,7 +87,7 @@ put_object_success_output(){ "rclone") echo "" ;; "mgc") - echo "Uploaded file $local_file to $bucket_name/$key" + echo "$bucket_name/$key" esac } list_object_versions(){ @@ -101,7 +101,7 @@ list_object_versions(){ rclone --s3-versions ls $profile:$bucket_name ;; "mgc") mgc workspace set $profile > /dev/null - mgc object-storage objects versions --dst="$bucket_name" --cli.output json;; + mgc object-storage objects versions --dst="$bucket_name" --output json;; esac } list_object_versions_success_output(){ @@ -115,6 +115,6 @@ list_object_versions_success_output(){ "rclone") echo "$key-v";; "mgc") - echo "\"Key\": \"$key\",";; + echo "$key";; esac }