From 125231557343a9fd7e92191ed213fbe794880c64 Mon Sep 17 00:00:00 2001 From: Luke McCrone Date: Tue, 15 Sep 2026 13:13:17 -0300 Subject: [PATCH] test: location constraint exception fix --- tests/test_rest_create_bucket.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/test_rest_create_bucket.sh b/tests/test_rest_create_bucket.sh index 0b860c1c..2cbcb7eb 100755 --- a/tests/test_rest_create_bucket.sh +++ b/tests/test_rest_create_bucket.sh @@ -133,7 +133,16 @@ export RUN_USERS=true # tags: curl,CreateBucket,invalid-header,location-constraint @test "REST - CreateBucket - empty location constraint" { - run send_curl_command_create_bucket_expect_error "400" "InvalidLocationConstraint" "The specified location-constraint is not valid" "-locationConstraint" "" + local expected_exception expected_string + + if [ "$AWS_REGION" == "us-east-1" ]; then + expected_exception="InvalidLocationConstraint" + expected_string="location-constraint is not valid" + else + expected_exception="IllegalLocationConstraintException" + expected_string="location constraint is incompatible" + fi + run send_curl_command_create_bucket_expect_error "400" "$expected_exception" "$expected_string" "-locationConstraint" "" assert_success } @@ -142,12 +151,18 @@ export RUN_USERS=true if [ "$DIRECT" == "true" ]; then skip "not valid for direct mode" fi - local region="us-east-1" + local region expected_exception expected_string if [ "$AWS_REGION" == "us-east-1" ]; then region="us-west-1" + expected_exception="InvalidLocationConstraint" + expected_string="location-constraint is not valid" + else + region="us-east-1" + expected_exception="IllegalLocationConstraintException" + expected_string="location constraint is incompatible" fi - run send_curl_command_create_bucket_expect_error "400" "InvalidLocationConstraint" "The specified location-constraint is not valid" "-locationConstraint" "$region" + run send_curl_command_create_bucket_expect_error "400" "$expected_exception" "$expected_string" "-locationConstraint" "$region" assert_success }