mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
Merge pull request #400 from iraj465/wip-new-multi-delete-objects-tests
rgw/s3_boto3:Adds new delete_objects tests
This commit is contained in:
commit
687ab24e7d
1 changed files with 42 additions and 0 deletions
|
@ -2028,6 +2028,48 @@ def test_multi_objectv2_delete():
|
|||
response = client.list_objects_v2(Bucket=bucket_name)
|
||||
assert 'Contents' not in response
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='post')
|
||||
@attr(operation='delete multiple objects has upper limit of 1000 keys')
|
||||
@attr(assertion='fails 400')
|
||||
def test_multi_object_delete_key_limit():
|
||||
key_names = [f"key-{i}" for i in range(1001)]
|
||||
bucket_name = _create_objects(keys=key_names)
|
||||
client = get_client()
|
||||
|
||||
paginator = client.get_paginator('list_objects')
|
||||
pages = paginator.paginate(Bucket=bucket_name)
|
||||
numKeys = 0
|
||||
for page in pages:
|
||||
numKeys += len(page['Contents'])
|
||||
eq(numKeys, 1001)
|
||||
|
||||
objs_dict = _make_objs_dict(key_names=key_names)
|
||||
e = assert_raises(ClientError,client.delete_objects,Bucket=bucket_name,Delete=objs_dict)
|
||||
status, error_code = _get_status_and_error_code(e.response)
|
||||
eq(status, 400)
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='post')
|
||||
@attr(operation='delete multiple objects has upper limit of 1000 keys with list-objects-v2')
|
||||
@attr(assertion='fails 400')
|
||||
def test_multi_objectv2_delete_key_limit():
|
||||
key_names = [f"key-{i}" for i in range(1001)]
|
||||
bucket_name = _create_objects(keys=key_names)
|
||||
client = get_client()
|
||||
|
||||
paginator = client.get_paginator('list_objects_v2')
|
||||
pages = paginator.paginate(Bucket=bucket_name)
|
||||
numKeys = 0
|
||||
for page in pages:
|
||||
numKeys += len(page['Contents'])
|
||||
eq(numKeys, 1001)
|
||||
|
||||
objs_dict = _make_objs_dict(key_names=key_names)
|
||||
e = assert_raises(ClientError,client.delete_objects,Bucket=bucket_name,Delete=objs_dict)
|
||||
status, error_code = _get_status_and_error_code(e.response)
|
||||
eq(status, 400)
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='put')
|
||||
@attr(operation='write zero-byte key')
|
||||
|
|
Loading…
Reference in a new issue