From 5ef61af6f3a97449f3d78ae362bcc74ac8e942f1 Mon Sep 17 00:00:00 2001 From: Luke McCrone Date: Wed, 24 Sep 2025 21:10:05 -0300 Subject: [PATCH] test: add WORM check matching new S3 error string --- tests/test_s3api_root_inner.sh | 8 ++++---- tests/util/util_retention.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_s3api_root_inner.sh b/tests/test_s3api_root_inner.sh index b8a9c39..25bf899 100755 --- a/tests/test_s3api_root_inner.sh +++ b/tests/test_s3api_root_inner.sh @@ -128,12 +128,12 @@ test_get_put_object_legal_hold_s3api_root() { echo "fdkljafajkfs" > "$TEST_FILE_FOLDER/$bucket_file" run put_object_with_user "s3api" "$TEST_FILE_FOLDER/$bucket_file" "$BUCKET_ONE_NAME" "$bucket_file" "$username" "$password" assert_failure - assert_output --partial "Object is WORM protected and cannot be overwritten" + assert_output --partial "object protected by object lock" run delete_object_with_user "s3api" "$BUCKET_ONE_NAME" "$bucket_file" "$username" "$password" assert_failure 1 # shellcheck disable=SC2154 - assert_output --partial "Object is WORM protected and cannot be overwritten" + assert_output --partial "object protected by object lock" run put_object_legal_hold "s3api" "$BUCKET_ONE_NAME" "$bucket_file" "OFF" assert_success @@ -173,12 +173,12 @@ test_get_put_object_retention_s3api_root() { run put_object_with_user "s3api" "$TEST_FILE_FOLDER/$bucket_file" "$BUCKET_ONE_NAME" "$bucket_file" "$username" "$secret_key" assert_failure # shellcheck disable=SC2154 - assert_output --partial "Object is WORM protected and cannot be overwritten" + assert_output --partial "object protected by object lock" run delete_object_with_user "s3api" "$BUCKET_ONE_NAME" "$bucket_file" "$username" "$secret_key" assert_failure # shellcheck disable=SC2154 - assert_output --partial "Object is WORM protected and cannot be overwritten" + assert_output --partial "object protected by object lock" } test_retention_bypass_s3api_root() { diff --git a/tests/util/util_retention.sh b/tests/util/util_retention.sh index 93cc3c9..708dfe8 100644 --- a/tests/util/util_retention.sh +++ b/tests/util/util_retention.sh @@ -51,7 +51,7 @@ check_for_and_remove_worm_protection() { return 2 fi - if [[ $3 == *"WORM"* ]]; then + if [[ $3 == *"WORM"* ]] || [[ "$3" == *"object protected by object lock"* ]]; then log 5 "WORM protection found" if ! put_object_legal_hold "rest" "$1" "$2" "OFF"; then log 2 "error removing object legal hold"