From 7ce0b5ebbda56fd63c3a749396d98776ac6dba27 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 3 Sep 2024 14:05:37 -0400 Subject: [PATCH] test/cls/rgw: simplify set_reshard_status() Signed-off-by: Casey Bodley --- src/test/cls_rgw/test_cls_rgw.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/test/cls_rgw/test_cls_rgw.cc b/src/test/cls_rgw/test_cls_rgw.cc index 85f564277b2..66b28565c44 100644 --- a/src/test/cls_rgw/test_cls_rgw.cc +++ b/src/test/cls_rgw/test_cls_rgw.cc @@ -1354,10 +1354,11 @@ TEST_F(cls_rgw, index_racing_removes) } void set_reshard_status(librados::IoCtx& ioctx, const std::string& oid, - const cls_rgw_bucket_instance_entry& entry) + cls_rgw_reshard_status status) { map bucket_objs; bucket_objs[0] = oid; + const auto entry = cls_rgw_bucket_instance_entry{.reshard_status = status}; int r = CLSRGWIssueSetBucketResharding(ioctx, bucket_objs, entry, 1)(); ASSERT_EQ(0, r); } @@ -1395,9 +1396,7 @@ TEST_F(cls_rgw, reshardlog_list) ASSERT_EQ(0u, entries.size()); // set reshard status to IN_LOGRECORD - cls_rgw_bucket_instance_entry entry; - entry.reshard_status = cls_rgw_reshard_status::IN_LOGRECORD; - set_reshard_status(ioctx, bucket_oid, entry); + set_reshard_status(ioctx, bucket_oid, cls_rgw_reshard_status::IN_LOGRECORD); // record a log in prepare cls_rgw_obj_key obj2 = str_int("obj2", 0); @@ -1465,9 +1464,7 @@ TEST_F(cls_rgw, reshardlog_num) reshardlog_entries(ioctx, bucket_oid, 0u); // set reshard status to IN_LOGRECORD - cls_rgw_bucket_instance_entry entry; - entry.reshard_status = cls_rgw_reshard_status::IN_LOGRECORD; - set_reshard_status(ioctx, bucket_oid, entry); + set_reshard_status(ioctx, bucket_oid, cls_rgw_reshard_status::IN_LOGRECORD); // record a log in prepare not add reshardlog_entry cls_rgw_obj_key obj2 = str_int("obj2", 0); -- 2.39.5