mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-22 09:29:43 +00:00
functional: add test_versioning_bucket_create_suspend()
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
parent
d4e9e40792
commit
032f41f6f3
1 changed files with 27 additions and 0 deletions
|
@ -5175,4 +5175,31 @@ def test_region_copy_object():
|
||||||
e = assert_raises(boto.exception.S3ResponseError, conn.get_bucket, dest_bucket.name)
|
e = assert_raises(boto.exception.S3ResponseError, conn.get_bucket, dest_bucket.name)
|
||||||
eq(e.status, 404)
|
eq(e.status, 404)
|
||||||
|
|
||||||
|
def check_versioning(bucket, status):
|
||||||
|
try:
|
||||||
|
eq(bucket.get_versioning_status()['Versioning'], status)
|
||||||
|
except KeyError:
|
||||||
|
eq(status, None)
|
||||||
|
|
||||||
|
@attr(resource='bucket')
|
||||||
|
@attr(method='create')
|
||||||
|
@attr(operation='create versioned bucket')
|
||||||
|
@attr(assertion='can create and suspend bucket versioning')
|
||||||
|
@attr('versioning')
|
||||||
|
def test_versioning_bucket_create_suspend():
|
||||||
|
bucket = get_new_bucket()
|
||||||
|
print bucket.get_versioning_status()
|
||||||
|
check_versioning(bucket, None)
|
||||||
|
|
||||||
|
bucket.configure_versioning(False)
|
||||||
|
check_versioning(bucket, "Suspended")
|
||||||
|
|
||||||
|
bucket.configure_versioning(True)
|
||||||
|
check_versioning(bucket, "Enabled")
|
||||||
|
|
||||||
|
bucket.configure_versioning(True)
|
||||||
|
check_versioning(bucket, "Enabled")
|
||||||
|
|
||||||
|
bucket.configure_versioning(False)
|
||||||
|
check_versioning(bucket, "Suspended")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue