From 6893ce7fae72a24a345faed550b1bb81baa5931a Mon Sep 17 00:00:00 2001 From: Mahesh Shetty Date: Thu, 12 Dec 2024 23:54:23 +0530 Subject: [PATCH] Fix mon and osd failure test fixture usecase Signed-off-by: Mahesh Shetty --- tests/conftest.py | 17 +++++++++++++++++ .../sc_arbiter/test_mon_osd_failures.py | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 6c6317d1f15..6bd3325c1fb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7042,8 +7042,25 @@ def teardown(): return factory +@pytest.fixture(scope="class") +def cnv_workload_class(request): + """ + Class scoped fixture to deploy CNV workload + + """ + return cnv_workload_factory(request) + + @pytest.fixture() def cnv_workload(request): + """ + Function scoped fixture to deploy CNV workload + + """ + return cnv_workload_factory(request) + + +def cnv_workload_factory(request): """ Deploys CNV based workloads diff --git a/tests/functional/disaster-recovery/sc_arbiter/test_mon_osd_failures.py b/tests/functional/disaster-recovery/sc_arbiter/test_mon_osd_failures.py index 2d7b8ffcdd5..4adb635addc 100644 --- a/tests/functional/disaster-recovery/sc_arbiter/test_mon_osd_failures.py +++ b/tests/functional/disaster-recovery/sc_arbiter/test_mon_osd_failures.py @@ -138,10 +138,10 @@ def finalizer(): @pytest.fixture(scope="class") -def setup_cnv_workload(request, cnv_workload, setup_cnv): +def setup_cnv_workload(request, cnv_workload_class, setup_cnv): logger.info("Setting up CNV workload and creating some data") - vm_obj = cnv_workload(volume_interface=constants.VM_VOLUME_PVC)[0] + vm_obj = cnv_workload_class(volume_interface=constants.VM_VOLUME_PVC)[0] vm_obj.run_ssh_cmd(command="dd if=/dev/zero of=/file_1.txt bs=1024 count=102400") md5sum_before = cal_md5sum_vm(vm_obj, file_path="/file_1.txt")