From e109c5c7b736382f8e2190b9dc2debafd1fc3064 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 22 Dec 2014 17:00:43 -0800 Subject: [PATCH] s3test: add a new multi obj delete test Validate creation of delete marker. Signed-off-by: Yehuda Sadeh --- s3tests/functional/test_s3.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index 065d316..2da4310 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -5659,3 +5659,34 @@ def test_versioning_multi_object_delete_with_marker(): eq(_count_bucket_objs(bucket), 0) +@attr(resource='object') +@attr(method='delete') +@attr(operation='multi delete create marker') +@attr(assertion='returns correct marker version id') +@attr('versioning') +def test_versioning_multi_object_delete_with_marker_create(): + bucket = get_new_bucket() + + check_configure_versioning_retry(bucket, True, "Enabled") + + keyname = 'key' + + rmkeys = { bucket.new_key(keyname) } + + eq(_count_bucket_objs(bucket), 0) + + result = bucket.delete_keys(rmkeys) + eq(len(result.deleted), 1) + eq(_count_bucket_objs(bucket), 1) + + delete_markers = [] + for o in result.deleted: + if o.delete_marker: + delete_markers.insert(0, o) + + eq(len(delete_markers), 1) + + for o in bucket.list_versions(): + eq(o.name, keyname) + eq(o.version_id, delete_markers[0].delete_marker_version_id) +