Skip to content

Commit

Permalink
Update conftest.py
Browse files Browse the repository at this point in the history
Signed-off-by: Avdhoot <[email protected]>
  • Loading branch information
avd-sagare committed Dec 13, 2024
1 parent 8ff8e3d commit 77acbb7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
18 changes: 10 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down
5 changes: 3 additions & 2 deletions tests/functional/cnv/test_vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -12,6 +12,7 @@
logger = logging.getLogger(__name__)


@magenta_squad
class TestCNVVM(E2ETest):
"""
Includes tests related to CNV+ODF workloads.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 77acbb7

Please sign in to comment.