From 463f1ab56f5c8178ba241b9e83df27d262150991 Mon Sep 17 00:00:00 2001 From: prsurve Date: Thu, 24 Oct 2024 15:42:09 +0530 Subject: [PATCH 1/5] Use Placment for Subscription Signed-off-by: prsurve --- conf/ocsci/dr_workload.yaml | 26 ++++++++++++++++++++++++++ ocs_ci/ocs/dr/dr_workload.py | 1 + tests/conftest.py | 1 + 3 files changed, 28 insertions(+) diff --git a/conf/ocsci/dr_workload.yaml b/conf/ocsci/dr_workload.yaml index 26fbbec8c0f..09d8f4c3a77 100644 --- a/conf/ocsci/dr_workload.yaml +++ b/conf/ocsci/dr_workload.yaml @@ -114,5 +114,31 @@ ENV_DATA: dr_workload_app_placement_name: "busybox-dict-1" } ] + dr_workload_subscription_placement_rbd: [ + { name: "busybox-1", workload_dir: "rdr/busybox/rbd/subscription_with_placement/app-busybox-1", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app1" } + }, + { name: "busybox-2", workload_dir: "rdr/busybox/rbd/subscription_with_placement/app-busybox-2", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app2" } + }, + { name: "busybox-3", workload_dir: "rdr/busybox/rbd/subscription_with_placement/app-busybox-3", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app3" } + }, + { name: "busybox-4", workload_dir: "rdr/busybox/rbd/subscription_with_placement/app-busybox-4", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app4" } + }, + { name: "busybox-5", workload_dir: "rdr/busybox/rbd/subscription_with_placement/app-busybox-5", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app5" } + }, + { name: "busybox-6", workload_dir: "rdr/busybox/rbd/subscription_with_placement/app-busybox-6", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app6" } + }, + ] # dr_policy_name: PLACEHOLDER diff --git a/ocs_ci/ocs/dr/dr_workload.py b/ocs_ci/ocs/dr/dr_workload.py index 42162d66732..fafbdc1eb40 100644 --- a/ocs_ci/ocs/dr/dr_workload.py +++ b/ocs_ci/ocs/dr/dr_workload.py @@ -173,6 +173,7 @@ def deploy_workload(self): drpc_yaml_data["spec"]["pvcSelector"][ "matchLabels" ] = self.workload_pvc_selector + del drpc_yaml_data["spec"]["kubeObjectProtection"] self.drcp_data_yaml = tempfile.NamedTemporaryFile( mode="w+", prefix="drpc", delete=False ) diff --git a/tests/conftest.py b/tests/conftest.py index de5c0ef231d..799fbca8279 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6673,6 +6673,7 @@ def factory( for index in range(num_of_subscription): workload_key = "dr_workload_subscription" if ocsci_config.MULTICLUSTER["multicluster_mode"] == constants.RDR_MODE: + workload_key = "dr_workload_subscription_placement" workload_key += f"_{interface}" workload_details = ocsci_config.ENV_DATA[workload_key][index] workload = BusyBox( From fda4e1729edff6832f028b7436c3bb17c3f67819 Mon Sep 17 00:00:00 2001 From: prsurve Date: Thu, 24 Oct 2024 17:08:14 +0530 Subject: [PATCH 2/5] Add yaml data for cephfs Signed-off-by: prsurve --- conf/ocsci/dr_workload.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/conf/ocsci/dr_workload.yaml b/conf/ocsci/dr_workload.yaml index 09d8f4c3a77..ae9dd7ae58f 100644 --- a/conf/ocsci/dr_workload.yaml +++ b/conf/ocsci/dr_workload.yaml @@ -140,5 +140,23 @@ ENV_DATA: dr_workload_app_pvc_selector: { "appname": "busybox_app6" } }, ] + dr_workload_subscription_placement_cephfs: [ + { name: "busybox-1", workload_dir: "rdr/busybox/cephfs/subscription_with_placement/app-busybox-1", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app1_cephfs" } + }, + { name: "busybox-2", workload_dir: "rdr/busybox/cephfs/subscription_with_placement/app-busybox-2", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app2_cephfs" } + }, + { name: "busybox-3", workload_dir: "rdr/busybox/cephfs/subscription_with_placement/app-busybox-3", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app3_cephfs" } + }, + { name: "busybox-4", workload_dir: "rdr/busybox/cephfs/subscription_with_placement/app-busybox-4", + pod_count: 10, pvc_count: 10, is_placement: True, + dr_workload_app_pvc_selector: { "appname": "busybox_app4_cephfs" } + }, + ] # dr_policy_name: PLACEHOLDER From e47d8f80bea937678d79c749708ceb3404a3fe02 Mon Sep 17 00:00:00 2001 From: prsurve Date: Thu, 7 Nov 2024 23:31:32 +0530 Subject: [PATCH 3/5] Remove unused data from yaml Signed-off-by: prsurve --- conf/ocsci/dr_workload.yaml | 2 +- ocs_ci/ocs/dr/dr_workload.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/ocsci/dr_workload.yaml b/conf/ocsci/dr_workload.yaml index ae9dd7ae58f..bd4fb2aa1ad 100644 --- a/conf/ocsci/dr_workload.yaml +++ b/conf/ocsci/dr_workload.yaml @@ -1,6 +1,6 @@ ENV_DATA: dr_workload_repo_url: "https://github.com/red-hat-storage/ocs-workloads.git" - dr_workload_repo_branch: "master" + dr_workload_repo_branch: "remove_drpc_from_placement" dr_workload_subscription_rbd: [ {name: "busybox-1", workload_dir: "rdr/busybox/rbd/subscription_with_placementrule/app-busybox-1", pod_count: 10, pvc_count: 10 diff --git a/ocs_ci/ocs/dr/dr_workload.py b/ocs_ci/ocs/dr/dr_workload.py index fafbdc1eb40..cb29867005e 100644 --- a/ocs_ci/ocs/dr/dr_workload.py +++ b/ocs_ci/ocs/dr/dr_workload.py @@ -173,6 +173,8 @@ def deploy_workload(self): drpc_yaml_data["spec"]["pvcSelector"][ "matchLabels" ] = self.workload_pvc_selector + + del drpc_yaml_data["spec"]["pvcSelector"]["matchExpressions"] del drpc_yaml_data["spec"]["kubeObjectProtection"] self.drcp_data_yaml = tempfile.NamedTemporaryFile( mode="w+", prefix="drpc", delete=False From 6527e94209c39078b80c2d5be7dbdc83841657ac Mon Sep 17 00:00:00 2001 From: prsurve Date: Thu, 7 Nov 2024 23:49:39 +0530 Subject: [PATCH 4/5] Tempfix Signed-off-by: prsurve --- tests/functional/disaster-recovery/regional-dr/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/disaster-recovery/regional-dr/conftest.py b/tests/functional/disaster-recovery/regional-dr/conftest.py index 789f6e3feef..296543e8d9a 100644 --- a/tests/functional/disaster-recovery/regional-dr/conftest.py +++ b/tests/functional/disaster-recovery/regional-dr/conftest.py @@ -27,7 +27,7 @@ def pytest_collection_modifyitems(items): items.remove(item) -@pytest.fixture(autouse=True) +@pytest.fixture(autouse=False) def check_subctl_cli(): # Check whether subctl cli is present if config.MULTICLUSTER.get("multicluster_mode") != constants.RDR_MODE: From f463a4145981b328d2f416b4d8b7ee675926b817 Mon Sep 17 00:00:00 2001 From: prsurve Date: Sat, 9 Nov 2024 19:41:09 +0530 Subject: [PATCH 5/5] remove temp fix Signed-off-by: prsurve --- conf/ocsci/dr_workload.yaml | 2 +- tests/functional/disaster-recovery/regional-dr/conftest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/ocsci/dr_workload.yaml b/conf/ocsci/dr_workload.yaml index bd4fb2aa1ad..ae9dd7ae58f 100644 --- a/conf/ocsci/dr_workload.yaml +++ b/conf/ocsci/dr_workload.yaml @@ -1,6 +1,6 @@ ENV_DATA: dr_workload_repo_url: "https://github.com/red-hat-storage/ocs-workloads.git" - dr_workload_repo_branch: "remove_drpc_from_placement" + dr_workload_repo_branch: "master" dr_workload_subscription_rbd: [ {name: "busybox-1", workload_dir: "rdr/busybox/rbd/subscription_with_placementrule/app-busybox-1", pod_count: 10, pvc_count: 10 diff --git a/tests/functional/disaster-recovery/regional-dr/conftest.py b/tests/functional/disaster-recovery/regional-dr/conftest.py index 296543e8d9a..789f6e3feef 100644 --- a/tests/functional/disaster-recovery/regional-dr/conftest.py +++ b/tests/functional/disaster-recovery/regional-dr/conftest.py @@ -27,7 +27,7 @@ def pytest_collection_modifyitems(items): items.remove(item) -@pytest.fixture(autouse=False) +@pytest.fixture(autouse=True) def check_subctl_cli(): # Check whether subctl cli is present if config.MULTICLUSTER.get("multicluster_mode") != constants.RDR_MODE: