From 3c59106950529fc122b8edc4c23e0b0720cff6f2 Mon Sep 17 00:00:00 2001 From: "cnv-tests-github-webhook-dollierp[bot]" Date: Wed, 24 Jun 2026 22:24:18 +0300 Subject: [PATCH] CherryPicked: [cnv-4.19] [4.21] Remove DataSource storage class fallback from DV template helper (#5358) Cherry-pick from `cnv-4.21` branch, original PR: https://github.com/RedHatQE/openshift-virtualization-tests/pull/5228, PR owner: RoniKishner Co-authored-by: Roni Kishner Signed-off-by: cnv-tests-github-webhook-dollierp[bot] --- tests/conftest.py | 5 +++++ tests/storage/conftest.py | 5 ----- utilities/storage.py | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 4fe5b50849..dcaf60c83f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2799,6 +2799,11 @@ def rwx_fs_available_storage_classes_names(cluster_storage_classes_names): ] +@pytest.fixture() +def storage_class_name_scope_function(storage_class_matrix__function__): + return [*storage_class_matrix__function__][0] + + @pytest.fixture(scope="session") def rhsm_credentials_from_bitwarden(): return get_cnv_tests_secret_by_name(secret_name="RHSM_CREDENTIALS") diff --git a/tests/storage/conftest.py b/tests/storage/conftest.py index 5c596b486b..b8a4be41d3 100644 --- a/tests/storage/conftest.py +++ b/tests/storage/conftest.py @@ -461,11 +461,6 @@ def data_volume_template_metadata(multi_storage_cirros_vm): return multi_storage_cirros_vm.data_volume_template["metadata"] -@pytest.fixture() -def storage_class_name_scope_function(storage_class_matrix__function__): - return [*storage_class_matrix__function__][0] - - @pytest.fixture(scope="module") def storage_class_name_scope_module(storage_class_matrix__module__): return [*storage_class_matrix__module__][0] diff --git a/utilities/storage.py b/utilities/storage.py index 97bdc843d4..9da092af98 100644 --- a/utilities/storage.py +++ b/utilities/storage.py @@ -586,12 +586,11 @@ def data_volume_dict_modify_to_source_ref(dv, data_source): def data_volume_template_with_source_ref_dict(data_source, storage_class=None): - data_source_pvc_dict_spec = data_source.source.instance.to_dict()["spec"] dv = DataVolume( name=utilities.infra.unique_name(name=data_source.name), namespace=data_source.namespace, size=get_dv_size_from_datasource(data_source=data_source), - storage_class=storage_class or data_source_pvc_dict_spec.get("storageClassName"), + storage_class=storage_class, api_name="storage", ) return data_volume_dict_modify_to_source_ref(dv=dv, data_source=data_source)