Skip to content

Commit 7afb572

Browse files
committed
[CEPH-83604857]: Tags added during multipart upload should be retrievable
Signed-off-by: Chaithra <[email protected]>
1 parent a033094 commit 7afb572

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# script: test_Mbuckets_with_Nobjects.py
2+
# upload type: Multipart
3+
# Polarion ID: CEPH-83604857
4+
# BZ: 2323604
5+
config:
6+
user_count: 1
7+
bucket_count: 1
8+
objects_count: 1
9+
objects_size_range:
10+
min: 1G
11+
max: 2G
12+
test_ops:
13+
create_bucket: true
14+
create_object: true
15+
download_object: false
16+
delete_bucket_object: false
17+
multipart_upload_with_tag: true
18+
sharding:
19+
enable: false
20+
max_shards: 0
21+
compression:
22+
enable: false
23+
type: zlib

rgw/v2/tests/s3_swift/reusable.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ def upload_object_with_tagging(
459459
obj_tag,
460460
append_data=False,
461461
append_msg=None,
462+
verify_tag_retrieval=False,
463+
s3_client=None,
462464
):
463465
log.info("s3 object name: %s" % s3_object_name)
464466
s3_object_path = os.path.join(TEST_DATA_PATH, s3_object_name)
@@ -499,6 +501,19 @@ def upload_object_with_tagging(
499501
raise TestExecError("Resource execution failed: object upload failed")
500502
if object_uploaded_status is None:
501503
log.info("object uploaded")
504+
if verify_tag_retrieval:
505+
log.info("Verify Tag applied is retirievable")
506+
log.info(f"object: {s3_object_name}")
507+
get_obj_tagging_result = s3lib.resource_op(
508+
{
509+
"obj": s3_client,
510+
"resource": "get_object_tagging",
511+
"kwargs": dict(Bucket=bucket.name, Key=s3_object_name),
512+
}
513+
)
514+
log.info(f"get_obj_tagging_result: {get_obj_tagging_result}")
515+
if not get_obj_tagging_result.get("TagSet"):
516+
raise AssertionError("Tag retrival is failed for multipart objects!")
502517

503518

504519
def upload_mutipart_object(

rgw/v2/tests/s3_swift/test_Mbuckets_with_Nobjects.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,19 @@ def test_exec(config, ssh_con):
966966
if final_op != -1:
967967
test_info.failed_status("test failed")
968968
sys.exit(1)
969-
969+
if config.test_ops.get("multipart_upload_with_tag", False):
970+
log.info("Testing tag retrival post multipart upload")
971+
obj_tag = "mpupload=mpupload"
972+
reusable.upload_object_with_tagging(
973+
s3_object_name,
974+
bucket,
975+
TEST_DATA_PATH,
976+
config,
977+
each_user,
978+
obj_tag,
979+
verify_tag_retrieval=True,
980+
s3_client=rgw_conn2,
981+
)
970982
# test async rgw_data_notify_interval_msec=0 does not disable async data notifications
971983
if config.test_aync_data_notifications:
972984
log.info("Testing async data notifications")

0 commit comments

Comments
 (0)