From 77acbb765c8a00a7f2876de5320f6dcc5da43b9b Mon Sep 17 00:00:00 2001 From: Avdhoot Sagare Date: Fri, 13 Dec 2024 13:33:52 +0530 Subject: [PATCH] Update conftest.py Signed-off-by: Avdhoot --- tests/conftest.py | 18 ++++++++++-------- tests/functional/cnv/test_vms.py | 5 +++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 84392cd2fbf..191d786f109 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7180,26 +7180,26 @@ def factory(namespace=None): vm_configs = templating.load_yaml(constants.CNV_VM_WORKLOADS) # Loop through vm_configs and create the VMs using the cnv_workload fixture - for index, config in enumerate(vm_configs["vm_configs"]): + for index, vm_config in enumerate(vm_configs["vm_configs"]): # Determine the storage class based on the compression type - if config["sc_compression"] == "default": + if vm_config["sc_compression"] == "default": storageclass = sc_obj_def_compr.name - elif config["sc_compression"] == "aggressive": + elif vm_config["sc_compression"] == "aggressive": storageclass = sc_obj_aggressive.name else: raise ValueError( - f"Unknown storage class compression type: {config['sc_name']}" + f"Unknown storage class compression type: {vm_config['sc_name']}" ) vm_obj = cnv_workload( - volume_interface=config["volume_interface"], - access_mode=config["access_mode"], + volume_interface=vm_config["volume_interface"], + access_mode=vm_config["access_mode"], storageclass=storageclass, pvc_size="30Gi", # Assuming pvc_size is fixed for all source_url=constants.CNV_FEDORA_SOURCE, # Assuming source_url is the same for all VMs namespace=namespace, )[index] - if config["sc_compression"] == "aggressive": + if vm_config["sc_compression"] == "aggressive": vm_list_agg_compr.append(vm_obj) else: vm_list_default_compr.append(vm_obj) @@ -7209,7 +7209,9 @@ def factory(namespace=None): sc_obj_def_compr, sc_obj_aggressive, ) - return factory + + return factory + @pytest.fixture() def clone_vm_workload(request): diff --git a/tests/functional/cnv/test_vms.py b/tests/functional/cnv/test_vms.py index 552f1c10154..39e5799ee1c 100644 --- a/tests/functional/cnv/test_vms.py +++ b/tests/functional/cnv/test_vms.py @@ -2,7 +2,7 @@ import pytest from ocs_ci.framework.testlib import E2ETest -from ocs_ci.framework.pytest_customization.marks import magenta_squad, workloads +from ocs_ci.framework.pytest_customization.marks import workloads, magenta_squad from ocs_ci.helpers.cnv_helpers import cal_md5sum_vm from ocs_ci.helpers.performance_lib import run_oc_command from ocs_ci.helpers.keyrotation_helper import PVKeyrotation @@ -12,6 +12,7 @@ logger = logging.getLogger(__name__) +@magenta_squad class TestCNVVM(E2ETest): """ Includes tests related to CNV+ODF workloads. @@ -55,8 +56,8 @@ def verify_keyrotation(self, vm_objs, sc_obj): volume_handle ), f"Failed to rotate Key for the PVC {vm.pvc_obj.name}" - @magenta_squad @workloads + @pytest.mark.polarion_id("OCS-6298") def test_cnv_vms(self, setup): """ Tests to verify configuration for non-GS like environment