Skip to content

Commit

Permalink
[CEPH-83604857]: Tags added during multipart upload should be retriev…
Browse files Browse the repository at this point in the history
…able

Signed-off-by: Chaithra <[email protected]>
  • Loading branch information
ckulal committed Jan 21, 2025
1 parent a033094 commit 1875b1c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# script: test_Mbuckets_with_Nobjects.py
# upload type: Multipart
# Polarion ID: CEPH-83604857
# BZ: 2323604
config:
user_count: 1
bucket_count: 1
objects_count: 1
objects_size_range:
min: 1G
max: 2G
test_ops:
create_bucket: true
create_object: true
download_object: false
delete_bucket_object: false
multipart_upload_with_tag: true
sharding:
enable: false
max_shards: 0
compression:
enable: false
type: zlib
15 changes: 15 additions & 0 deletions rgw/v2/tests/s3_swift/reusable.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ def upload_object_with_tagging(
obj_tag,
append_data=False,
append_msg=None,
verify_tag_retrieval=False,
s3_client=None,
):
log.info("s3 object name: %s" % s3_object_name)
s3_object_path = os.path.join(TEST_DATA_PATH, s3_object_name)
Expand Down Expand Up @@ -499,6 +501,19 @@ def upload_object_with_tagging(
raise TestExecError("Resource execution failed: object upload failed")
if object_uploaded_status is None:
log.info("object uploaded")
if verify_tag_retrieval:
log.info("Verify Tag applied is retirievable")
log.info(f"object: {s3_object_name}")
get_obj_tagging_result = s3lib.resource_op(
{
"obj": s3_client,
"resource": "get_object_tagging",
"kwargs": dict(Bucket=bucket.name, Key=s3_object_name),
}
)
log.info(f"get_obj_tagging_result: {get_obj_tagging_result}")
if not get_obj_tagging_result.get("TagSet"):
raise AssertionError("Tag retrival is failed for multipart objects!")


def upload_mutipart_object(
Expand Down
14 changes: 13 additions & 1 deletion rgw/v2/tests/s3_swift/test_Mbuckets_with_Nobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,19 @@ def test_exec(config, ssh_con):
if final_op != -1:
test_info.failed_status("test failed")
sys.exit(1)

if config.test_ops.get("multipart_upload_with_tag", False):
log.info("Testing tag retrival post multipart upload")
obj_tag = "mpupload=mpupload"
reusable.upload_object_with_tagging(
s3_object_name,
bucket,
TEST_DATA_PATH,
config,
each_user,
obj_tag,
verify_tag_retrieval=True,
s3_client=rgw_conn2,
)
# test async rgw_data_notify_interval_msec=0 does not disable async data notifications
if config.test_aync_data_notifications:
log.info("Testing async data notifications")
Expand Down

0 comments on commit 1875b1c

Please sign in to comment.