From 40c6a68ce079764804907681ca62fd7d56becdb7 Mon Sep 17 00:00:00 2001 From: Anuchaithra Date: Tue, 19 Mar 2024 09:47:24 +0530 Subject: [PATCH] [Tier-3]Archive zone testing(Enable/Disable per bucket Replication to Archive Zone) Signed-off-by: Anuchaithra --- ...anular_bucketsync_archive_directional.yaml | 30 +++++++++++++++++++ ...anular_bucketsync_archive_symmetrical.yaml | 25 ++++++++++++++++ rgw/v2/tests/s3_swift/reusable.py | 2 +- ...t_multisite_bucket_granular_sync_policy.py | 19 ++++++++++-- 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_directional.yaml create mode 100644 rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_symmetrical.yaml diff --git a/rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_directional.yaml b/rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_directional.yaml new file mode 100644 index 000000000..7129375e2 --- /dev/null +++ b/rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_directional.yaml @@ -0,0 +1,30 @@ +# Polarian TC : CEPH-83575879 +# script: test_multisite_bucket_granular_sync_policy.py +config: + user_count: 1 + bucket_count: 1 + objects_count: 100 + objects_size_range: + min: 5K + max: 2M + test_ops: + archive_zone: true + zonegroup_group: true + zonegroup_status: allowed + zonegroup_flow: true + zonegroup_flow_type: directional + zonegroup_source_zone: archive + zonegroup_dest_zone: primary + zonegroup_source_zones: archive + zonegroup_dest_zones: primary + zonegroup_pipe: true + bucket_group: true + bucket_status: enabled + bucket_flow: false + bucket_pipe: true + bucket_source_zones: archive + bucket_dest_zones: primary + create_object: true + create_bucket: true + write_io_verify_another_site: true + zonegroup_group_remove: true diff --git a/rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_symmetrical.yaml b/rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_symmetrical.yaml new file mode 100644 index 000000000..af5c075bd --- /dev/null +++ b/rgw/v2/tests/s3_swift/multisite_configs/test_multisite_granular_bucketsync_archive_symmetrical.yaml @@ -0,0 +1,25 @@ +# Polarian TC : CEPH-83575879 +# script: test_multisite_bucket_granular_sync_policy.py +config: + user_count: 1 + bucket_count: 1 + objects_count: 100 + objects_size_range: + min: 5K + max: 2M + test_ops: + archive_zone: true + zonegroup_group: true + zonegroup_status: allowed + zonegroup_flow: true + zonegroup_flow_type: symmetrical + zonegroup_pipe: true + bucket_group: true + bucket_status: enabled + bucket_flow: false + bucket_pipe: true + create_object: true + create_bucket: true + should_sync: true + write_io_verify_another_site: true + zonegroup_group_remove: true diff --git a/rgw/v2/tests/s3_swift/reusable.py b/rgw/v2/tests/s3_swift/reusable.py index f1758a8e9..11a7eb4c1 100644 --- a/rgw/v2/tests/s3_swift/reusable.py +++ b/rgw/v2/tests/s3_swift/reusable.py @@ -1865,7 +1865,7 @@ def verify_bucket_sync_on_other_site(rgw_ssh_con, bucket): else: log.info(f"bucket {bucket.name} found on other site") break - if (retry_count > 20) and (len(re_cmd_output["groups"]) == 0): + if (retry_count > 20) and (bucket.name not in re_cmd_output): raise TestExecError( f"bucket {bucket.name} did not sync to other site even after 20m" ) diff --git a/rgw/v2/tests/s3_swift/test_multisite_bucket_granular_sync_policy.py b/rgw/v2/tests/s3_swift/test_multisite_bucket_granular_sync_policy.py index effbbf8f1..74e0fd842 100644 --- a/rgw/v2/tests/s3_swift/test_multisite_bucket_granular_sync_policy.py +++ b/rgw/v2/tests/s3_swift/test_multisite_bucket_granular_sync_policy.py @@ -12,6 +12,8 @@ multisite_configs/test_multisite_granular_bucketsync_forbidden_allowed.yaml multisite_configs/test_multisite_granular_bucketsync_sync_to_diff_bucket.yaml multisite_configs/test_multisite_granular_bucketsync_sync_from_diff_bucket.yaml + multisite_configs/test_multisite_granular_bucketsync_archive_symmetrical.yaml + multisite_configs/test_multisite_granular_bucketsync_archive_directional.yaml Operation: Creates delete sync policy group bucket , zonegroupl level @@ -63,8 +65,19 @@ def test_exec(config, ssh_con): if zone["name"] not in zone_list["zones"]: rgw_nodes = zone["endpoints"][0].split(":") node_rgw = rgw_nodes[1].split("//")[-1] - log.info(f"Another site is: {zone['name']} and ip {node_rgw}") - break + if config.test_ops.get("archive_zone", False): + if zone["name"] == "archive": + break + else: + break + + log.info(f"Another site is: {zone['name']} and ip {node_rgw}") + if config.test_ops.get("archive_zone", False): + if zone["name"] != "archive": + raise TestExecError( + f"archive zone not found {period_details['period_map']['zonegroups'][0]['zones']}" + ) + rgw_ssh_con = utils.connect_remote(node_rgw) if config.test_ops.get("write_io_verify_another_site", False): other_site_auth = Auth(each_user, rgw_ssh_con, ssl=config.ssl) @@ -345,7 +358,7 @@ def test_exec(config, ssh_con): ) for oc, size in list(config.mapped_sizes.items()): config.obj_size = size - s3_object_name = "new-" + utils.gen_s3_object_name( + s3_object_name = "sync-" + utils.gen_s3_object_name( bkt.name, oc ) log.info(f"s3 object name: {s3_object_name}")