forked from TrueCloudLab/s3-tests
test that listed buckets have creation time
Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
parent
8893cc49c5
commit
66ced9af1d
1 changed files with 17 additions and 0 deletions
|
@ -6073,6 +6073,23 @@ def test_buckets_create_then_list():
|
||||||
if name not in buckets_list:
|
if name not in buckets_list:
|
||||||
raise RuntimeError("S3 implementation's GET on Service did not return bucket we created: %r", bucket.name)
|
raise RuntimeError("S3 implementation's GET on Service did not return bucket we created: %r", bucket.name)
|
||||||
|
|
||||||
|
@attr(resource='bucket')
|
||||||
|
@attr(method='get')
|
||||||
|
@attr(operation='list all buckets')
|
||||||
|
@attr(assertion='all buckets have a sane creation time')
|
||||||
|
def test_buckets_list_ctime():
|
||||||
|
# check that creation times are within a day
|
||||||
|
before = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(days=1)
|
||||||
|
|
||||||
|
client = get_client()
|
||||||
|
for i in range(5):
|
||||||
|
client.create_bucket(Bucket=get_new_bucket_name())
|
||||||
|
|
||||||
|
response = client.list_buckets()
|
||||||
|
for bucket in response['Buckets']:
|
||||||
|
ctime = bucket['CreationDate']
|
||||||
|
assert before <= ctime, '%r > %r' % (before, ctime)
|
||||||
|
|
||||||
@attr(resource='bucket')
|
@attr(resource='bucket')
|
||||||
@attr(method='get')
|
@attr(method='get')
|
||||||
@attr(operation='list all buckets (anonymous)')
|
@attr(operation='list all buckets (anonymous)')
|
||||||
|
|
Loading…
Reference in a new issue