From 8406b44bc6052a9c9b3b0934f76c92a51a1b31fa Mon Sep 17 00:00:00 2001 From: Mahesh Shetty Date: Tue, 30 Jul 2024 13:51:00 +0530 Subject: [PATCH] Add polarion ids Signed-off-by: Mahesh Shetty --- ocs_ci/deployment/cnv.py | 8 ++-- tests/conftest.py | 3 +- .../sc_arbiter/test_netsplit.py | 37 +++++++++++++++++-- .../test_zone_shutdown_and_crash.py | 19 +++++++++- 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/ocs_ci/deployment/cnv.py b/ocs_ci/deployment/cnv.py index 83308217c637..677b0bb6ec04 100644 --- a/ocs_ci/deployment/cnv.py +++ b/ocs_ci/deployment/cnv.py @@ -659,7 +659,7 @@ def remove_hyperconverged(self): resource_name=constants.KUBEVIRT_HYPERCONVERGED, namespace=self.namespace, ) - hyperconverged_obj.delete() + hyperconverged_obj.delete(resource_name=constants.KUBEVIRT_HYPERCONVERGED) logger.info( f"Deleted {constants.HYPERCONVERGED} {constants.KUBEVIRT_HYPERCONVERGED}" ) @@ -674,7 +674,7 @@ def remove_cnv_subscription(self): resource_name=constants.KUBEVIRT_HYPERCONVERGED, namespace=self.namespace, ) - cnv_sub.delete() + cnv_sub.delete(resource_name=constants.KUBEVIRT_HYPERCONVERGED) logger.info(f"Deleted subscription {constants.KUBEVIRT_HYPERCONVERGED}") def remove_cnv_csv(self): @@ -687,7 +687,7 @@ def remove_cnv_csv(self): selector=constants.CNV_SELECTOR, namespace=self.namespace, ) - cnv_csv.delete() + cnv_csv.delete(resource_name=cnv_csv.get()["items"][0]["metadata"]["name"]) logger.info(f"Deleted ClusterServiceVersion {constants.CNV_OPERATORNAME}") def remove_crds(self): @@ -708,7 +708,7 @@ def remove_namespace(self): cnv_namespace = OCP( kind=constants.NAMESPACE, resource_name=constants.CNV_NAMESPACE ) - cnv_namespace.delete() + cnv_namespace.delete(resource_name=constants.CNV_NAMESPACE) logger.info(f"Deleted the namespace {constants.CNV_NAMESPACE}") def cleanup_cnv(self, check_cnv_installed=False): diff --git a/tests/conftest.py b/tests/conftest.py index 7344458b5cbb..f5b032231301 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7955,7 +7955,8 @@ def finalizer(): Clean up CNV deployment """ - cnv_obj.cleanup_cnv() + if cnv_obj.cnv_hyperconverged_installed(): + cnv_obj.cleanup_cnv() request.addfinalizer(finalizer) diff --git a/tests/functional/disaster-recovery/sc_arbiter/test_netsplit.py b/tests/functional/disaster-recovery/sc_arbiter/test_netsplit.py index 473440a620ef..f8d59201d86f 100644 --- a/tests/functional/disaster-recovery/sc_arbiter/test_netsplit.py +++ b/tests/functional/disaster-recovery/sc_arbiter/test_netsplit.py @@ -63,10 +63,38 @@ def finalizer(): @pytest.mark.parametrize( argnames="zones, duration", argvalues=[ - pytest.param(constants.NETSPLIT_DATA_1_DATA_2, 15), - pytest.param(constants.NETSPLIT_ARBITER_DATA_1, 15), - pytest.param(constants.NETSPLIT_ARBITER_DATA_1_AND_ARBITER_DATA_2, 15), - pytest.param(constants.NETSPLIT_ARBITER_DATA_1_AND_DATA_1_DATA_2, 15), + pytest.param( + constants.NETSPLIT_DATA_1_DATA_2, + 15, + marks=[ + pytest.mark.polarion_id("OCS-5069"), + pytest.mark.polarion_id("OCS-5071"), + ], + ), + pytest.param( + constants.NETSPLIT_ARBITER_DATA_1, + 15, + marks=[ + pytest.mark.polarion_id("OCS-5072"), + pytest.mark.polarion_id("OCS-5074"), + ], + ), + pytest.param( + constants.NETSPLIT_ARBITER_DATA_1_AND_ARBITER_DATA_2, + 15, + marks=[ + pytest.mark.polarion_id("OCS-5083"), + pytest.mark.polarion_id("OCS-5085"), + ], + ), + pytest.param( + constants.NETSPLIT_ARBITER_DATA_1_AND_DATA_1_DATA_2, + 15, + marks=[ + pytest.mark.polarion_id("OCS-5077"), + pytest.mark.polarion_id("OCS-5079"), + ], + ), ], ids=[ "Data-1-Data-2", @@ -75,6 +103,7 @@ def finalizer(): "Arbiter-Data-1-and-Data-1-Data-2", ], ) + @pytest.mark.polarion_id("OCS-5850") def test_netsplit( self, setup_logwriter_cephfs_workload_factory, diff --git a/tests/functional/disaster-recovery/sc_arbiter/test_zone_shutdown_and_crash.py b/tests/functional/disaster-recovery/sc_arbiter/test_zone_shutdown_and_crash.py index a04ac4f80792..e0900a03ef64 100644 --- a/tests/functional/disaster-recovery/sc_arbiter/test_zone_shutdown_and_crash.py +++ b/tests/functional/disaster-recovery/sc_arbiter/test_zone_shutdown_and_crash.py @@ -120,7 +120,15 @@ def finalizer(): pytest.mark.polarion_id("OCS-5088"), ], ), - pytest.param(1, True, 5, marks=[pytest.mark.polarion_id("OCS-5064")]), + pytest.param( + 1, + True, + 5, + marks=[ + pytest.mark.polarion_id("OCS-5064"), + pytest.mark.polarion_id("OCS-5850"), + ], + ), ], ids=[ "Normal-Shutdown", @@ -370,7 +378,14 @@ def test_zone_shutdowns( @pytest.mark.parametrize( argnames="iteration, delay", argvalues=[ - pytest.param(1, 5, marks=[pytest.mark.polarion_id("OCS-5062")]), + pytest.param( + 1, + 5, + marks=[ + pytest.mark.polarion_id("OCS-5062"), + pytest.mark.polarion_id("OCS-5850"), + ], + ), ], ) def test_zone_crashes(