Skip to content

Commit 8a15938

Browse files
rgw/sts: modifying test_assume_role_creds_expiry
to check for UnauthorizedRequest (401) error code instead of AccessDenied (403). Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
1 parent cfb361a commit 8a15938

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

s3tests_boto3/functional/test_sts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ def test_assume_role_creds_expiry():
304304
s3bucket = s3_client.create_bucket(Bucket=bucket_name)
305305
except ClientError as e:
306306
s3bucket_error = e.response.get("Error", {}).get("Code")
307-
assert s3bucket_error == 'AccessDenied'
307+
http_status_code = e.response.get("ResponseMetadata", {}).get("HTTPStatusCode")
308+
assert s3bucket_error == 'UnauthorizedRequest'
309+
assert http_status_code == 401
308310

309311
@pytest.mark.test_of_sts
310312
@pytest.mark.fails_on_dbstore

0 commit comments

Comments
 (0)