]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw: test_bucket_reshard verifies that ACLs are preserved
authorCasey Bodley <cbodley@redhat.com>
Mon, 17 Jan 2022 22:14:54 +0000 (17:14 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 2 Feb 2022 00:09:36 +0000 (19:09 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
qa/workunits/rgw/test_rgw_reshard.py

index 59b82bb1df76f9d4fcc88d7206336d07e2da2985..9581017bacf1eecf8676ab0a657b663b15d0fe39 100755 (executable)
@@ -98,7 +98,10 @@ def run_bucket_reshard_cmd(bucket_name, num_shards, **kwargs):
     return exec_cmd(cmd, **kwargs)
 
 def test_bucket_reshard(conn, name, **fault):
-    bucket = conn.create_bucket(Bucket=name)
+    # create a bucket with non-default ACLs to verify that reshard preserves them
+    bucket = conn.create_bucket(Bucket=name, ACL='authenticated-read')
+    grants = bucket.Acl().grants
+
     objs = []
     try:
         # create objs
@@ -119,6 +122,8 @@ def test_bucket_reshard(conn, name, **fault):
         # verify that the bucket is writeable by deleting an object
         objs.pop().delete()
 
+        assert grants == bucket.Acl().grants # recheck grants after cancel
+
         # retry reshard without fault injection. if radosgw-admin aborted,
         # we'll have to retry until the reshard lock expires
         while True:
@@ -133,6 +138,8 @@ def test_bucket_reshard(conn, name, **fault):
         # recheck shard count
         final_shard_count = get_bucket_stats(name).num_shards
         assert(final_shard_count == num_shards_expected)
+
+        assert grants == bucket.Acl().grants # recheck grants after commit
     finally:
         # cleanup on resharded bucket must succeed
         bucket.delete_objects(Delete={'Objects':[{'Key':o.key} for o in objs]})