mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-24 09:30:38 +00:00
PublicAccessBlock: test 404 on no block configuration
Make sure NoSuchPublicAccessBlockConfiguration is returned when no public block is configured on bucket: Refs: https://github.com/ceph/ceph/pull/55652 Signed-off-by: Seena Fallah <seenafallah@gmail.com>
This commit is contained in:
parent
997f78d58a
commit
3056e6d039
1 changed files with 13 additions and 7 deletions
|
@ -12590,16 +12590,22 @@ def test_get_nonpublicpolicy_deny_bucket_policy_status():
|
||||||
resp = client.get_bucket_policy_status(Bucket=bucket_name)
|
resp = client.get_bucket_policy_status(Bucket=bucket_name)
|
||||||
assert resp['PolicyStatus']['IsPublic'] == True
|
assert resp['PolicyStatus']['IsPublic'] == True
|
||||||
|
|
||||||
def test_get_default_public_block():
|
def test_get_undefined_public_block():
|
||||||
#client = get_svc_client(svc='s3control', client_config=Config(s3={'addressing_style': 'path'}))
|
|
||||||
bucket_name = get_new_bucket()
|
bucket_name = get_new_bucket()
|
||||||
client = get_client()
|
client = get_client()
|
||||||
|
|
||||||
resp = client.get_public_access_block(Bucket=bucket_name)
|
# delete the existing public access block configuration
|
||||||
assert resp['PublicAccessBlockConfiguration']['BlockPublicAcls'] == False
|
# as AWS creates a default public access block configuration
|
||||||
assert resp['PublicAccessBlockConfiguration']['BlockPublicPolicy'] == False
|
resp = client.delete_public_access_block(Bucket=bucket_name)
|
||||||
assert resp['PublicAccessBlockConfiguration']['IgnorePublicAcls'] == False
|
assert resp['ResponseMetadata']['HTTPStatusCode'] == 204
|
||||||
assert resp['PublicAccessBlockConfiguration']['RestrictPublicBuckets'] == False
|
|
||||||
|
response_code = ""
|
||||||
|
try:
|
||||||
|
resp = client.get_public_access_block(Bucket=bucket_name)
|
||||||
|
except ClientError as e:
|
||||||
|
response_code = e.response['Error']['Code']
|
||||||
|
|
||||||
|
assert response_code == 'NoSuchPublicAccessBlockConfiguration'
|
||||||
|
|
||||||
def test_put_public_block():
|
def test_put_public_block():
|
||||||
#client = get_svc_client(svc='s3control', client_config=Config(s3={'addressing_style': 'path'}))
|
#client = get_svc_client(svc='s3control', client_config=Config(s3={'addressing_style': 'path'}))
|
||||||
|
|
Loading…
Reference in a new issue