mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
fix and remark on test_lifecycle_expiration_days0
1. fix a python3-related KeyError exception 2. note here: AWS documentation includes examples of "Days 0" in use, but boto3 will not accept them--this is why the days0 test currently sets Days 1 3. delay increased to 30s, to avoid occasional failures due to jitter Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
This commit is contained in:
parent
54103207e4
commit
4948f8b009
1 changed files with 6 additions and 3 deletions
|
@ -9128,14 +9128,17 @@ def test_lifecycle_expiration_days0():
|
||||||
|
|
||||||
rules=[{'Expiration': {'Days': 1}, 'ID': 'rule1', 'Prefix': 'days0/', 'Status':'Enabled'}]
|
rules=[{'Expiration': {'Days': 1}, 'ID': 'rule1', 'Prefix': 'days0/', 'Status':'Enabled'}]
|
||||||
lifecycle = {'Rules': rules}
|
lifecycle = {'Rules': rules}
|
||||||
print(lifecycle)
|
|
||||||
response = client.put_bucket_lifecycle_configuration(Bucket=bucket_name, LifecycleConfiguration=lifecycle)
|
response = client.put_bucket_lifecycle_configuration(Bucket=bucket_name, LifecycleConfiguration=lifecycle)
|
||||||
eq(response['ResponseMetadata']['HTTPStatusCode'], 200)
|
eq(response['ResponseMetadata']['HTTPStatusCode'], 200)
|
||||||
|
|
||||||
time.sleep(20)
|
time.sleep(30)
|
||||||
|
|
||||||
response = client.list_objects(Bucket=bucket_name)
|
response = client.list_objects(Bucket=bucket_name)
|
||||||
expire_objects = response['Contents']
|
try:
|
||||||
|
expire_objects = response['Contents']
|
||||||
|
except KeyError:
|
||||||
|
expire_objects = []
|
||||||
|
|
||||||
eq(len(expire_objects), 0)
|
eq(len(expire_objects), 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue