diff --git a/rgw/v2/tests/s3_swift/multisite_configs/test_bucket_chown_reshard.yaml b/rgw/v2/tests/s3_swift/multisite_configs/test_bucket_chown_reshard.yaml new file mode 100644 index 000000000..bfca6049d --- /dev/null +++ b/rgw/v2/tests/s3_swift/multisite_configs/test_bucket_chown_reshard.yaml @@ -0,0 +1,9 @@ +config: + objects_count: 50 + objects_size_range: + min: 15 + max: 20 + sharding_type: manual + shards: 97 + test_ops: + bucket_chown: True diff --git a/rgw/v2/tests/s3_swift/test_dynamic_bucket_resharding.py b/rgw/v2/tests/s3_swift/test_dynamic_bucket_resharding.py index fb74fb87f..ddcc1624d 100644 --- a/rgw/v2/tests/s3_swift/test_dynamic_bucket_resharding.py +++ b/rgw/v2/tests/s3_swift/test_dynamic_bucket_resharding.py @@ -160,6 +160,20 @@ def test_exec(config, ssh_con): ) objects_created_list.append((s3_object_name, s3_object_path)) + if config.test_ops.get("bucket_chown", False) is True: + log.info("Create new user and change bucket ownership") + new_user = s3lib.create_users(1) + new_user = new_user[0] + new_auth = Auth(new_user, ssh_con, ssl=config.ssl) + new_conn = new_auth.do_auth() + new_name = new_user["user_id"] + out = reusable.unlink_bucket(user_info["user_id"], bucket_name) + log.info("Bucket unlink successful") + out1 = reusable.link_chown_nontenant_to_nontenant( + new_user["user_id"], bucket_name + ) + log.info(f"Bucket ownership changed to {new_name}") + if config.test_ops.get("verify_bucket_gen", False) is True: bucket_gen_before = reusable.fetch_bucket_gen(bucket.name) log.info(f"Current Bucket generation value is {bucket_gen_before}")