Skip to content

Commit cee774d

Browse files
authored
[4.18] [Storage] Remove outdated tests and skips (#4928) (#5074)
Manual cherry-pick: #4928 Remove test_data_protection.py, test_local_storage.py, and CDI scratch space upgrade tests (before/after), along with their fixtures, constants, and unused imports. Assisted-by: Claude <noreply@anthropic.com> --------- Signed-off-by: Jenia Peimer <jpeimer@redhat.com>
1 parent ec3f822 commit cee774d

8 files changed

Lines changed: 0 additions & 348 deletions

File tree

tests/storage/conftest.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,6 @@ def rhel_vm_name(request):
363363
return request.param["vm_name"]
364364

365365

366-
@pytest.fixture(scope="session")
367-
def available_hpp_storage_class(skip_test_if_no_hpp_sc, cluster_storage_classes):
368-
"""
369-
Get an HPP storage class if there is any in the cluster
370-
"""
371-
for storage_class in cluster_storage_classes:
372-
if storage_class.name in HPP_STORAGE_CLASSES:
373-
return storage_class
374-
375-
376366
@pytest.fixture()
377367
def rhel_vm_for_snapshot(
378368
admin_client,

tests/storage/test_data_protection.py

Lines changed: 0 additions & 148 deletions
This file was deleted.

tests/storage/test_local_storage.py

Lines changed: 0 additions & 72 deletions
This file was deleted.

tests/storage/upgrade/conftest.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
create_snapshot_for_upgrade,
1010
create_vm_for_snapshot_upgrade_tests,
1111
)
12-
from tests.storage.utils import update_scratch_space_sc
1312
from utilities.constants import HOTPLUG_DISK_SERIAL
1413
from utilities.storage import create_dv, virtctl_volume
1514
from utilities.virt import (
@@ -22,51 +21,6 @@
2221
LOGGER = logging.getLogger(__name__)
2322

2423

25-
@pytest.fixture(scope="session")
26-
def skip_if_less_than_two_storage_classes(cluster_storage_classes):
27-
if len(cluster_storage_classes) < 2:
28-
pytest.skip("Need two Storage Classes at least.")
29-
30-
31-
@pytest.fixture(scope="session")
32-
def storage_class_for_updating_cdiconfig_scratch(
33-
skip_if_less_than_two_storage_classes, cdi_config, cluster_storage_classes
34-
):
35-
"""
36-
Choose one StorageClass which is not the current one for scratch space.
37-
"""
38-
current_sc_for_scratch = cdi_config.scratch_space_storage_class_from_status
39-
LOGGER.info(f"The current StorageClass for scratch space on CDIConfig is: {current_sc_for_scratch}")
40-
for sc in cluster_storage_classes:
41-
if sc.instance.metadata.get("name") != current_sc_for_scratch:
42-
LOGGER.info(f"Candidate StorageClass: {sc.instance.metadata.name}")
43-
return sc
44-
45-
46-
@pytest.fixture(scope="session")
47-
def override_cdiconfig_scratch_spec(
48-
hyperconverged_resource_scope_session,
49-
cdi_config,
50-
storage_class_for_updating_cdiconfig_scratch,
51-
):
52-
"""
53-
Change spec.scratchSpaceStorageClass to the selected StorageClass on CDIConfig.
54-
"""
55-
if storage_class_for_updating_cdiconfig_scratch:
56-
new_sc = storage_class_for_updating_cdiconfig_scratch.name
57-
58-
with update_scratch_space_sc(
59-
cdi_config=cdi_config, new_sc=new_sc, hco=hyperconverged_resource_scope_session
60-
) as edited_cdi_config:
61-
yield edited_cdi_config
62-
63-
64-
@pytest.fixture(scope="session")
65-
def skip_if_not_override_cdiconfig_scratch_space(override_cdiconfig_scratch_spec):
66-
if not override_cdiconfig_scratch_spec:
67-
pytest.skip("Skip test because the scratch space was not changed.")
68-
69-
7024
@pytest.fixture(scope="session")
7125
def cirros_vm_for_upgrade_a(
7226
upgrade_namespace_scope_session,

tests/storage/upgrade/test_upgrade_storage.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from ocp_resources.virtual_machine_restore import VirtualMachineRestore
55

66
from tests.upgrade_params import (
7-
CDI_SCRATCH_PRESERVE_NODE_ID,
87
HOTPLUG_VM_AFTER_UPGRADE_NODE_ID,
98
IUO_UPGRADE_TEST_DEPENDENCY_NODE_ID,
109
IUO_UPGRADE_TEST_ORDERING_NODE_ID,
@@ -35,25 +34,6 @@
3534
class TestUpgradeStorage:
3635
"""Pre-upgrade tests"""
3736

38-
@pytest.mark.sno
39-
@pytest.mark.polarion("CNV-4880")
40-
@pytest.mark.order(before=IUO_UPGRADE_TEST_ORDERING_NODE_ID)
41-
@pytest.mark.dependency(name=f"{STORAGE_NODE_ID_PREFIX}::test_cdiconfig_scratch_overriden_before_upgrade")
42-
def test_cdiconfig_scratch_overriden_before_upgrade(
43-
self,
44-
cdi_config,
45-
storage_class_for_updating_cdiconfig_scratch,
46-
override_cdiconfig_scratch_spec,
47-
):
48-
"""
49-
Check that the scratch StorageClass configuration should be changed before CNV upgrade
50-
"""
51-
expected_sc = storage_class_for_updating_cdiconfig_scratch.instance.metadata.name
52-
actual_sc = cdi_config.scratch_space_storage_class_from_status
53-
assert actual_sc == expected_sc, (
54-
"The scratchSpaceStorageClass on CDIConfig config should be changed before upgrade"
55-
)
56-
5737
@pytest.mark.sno
5838
@pytest.mark.polarion("CNV-5993")
5939
@pytest.mark.order(before=IUO_UPGRADE_TEST_ORDERING_NODE_ID)
@@ -106,32 +86,6 @@ def test_vm_with_hotplug_before_upgrade(
10686

10787
""" Post-upgrade tests """
10888

109-
@pytest.mark.sno
110-
@pytest.mark.polarion("CNV-2952")
111-
@pytest.mark.order(after=IUO_UPGRADE_TEST_ORDERING_NODE_ID)
112-
@pytest.mark.dependency(
113-
name=CDI_SCRATCH_PRESERVE_NODE_ID,
114-
depends=[
115-
IUO_UPGRADE_TEST_DEPENDENCY_NODE_ID,
116-
f"{STORAGE_NODE_ID_PREFIX}::test_cdiconfig_scratch_overriden_before_upgrade",
117-
],
118-
scope=DEPENDENCY_SCOPE_SESSION,
119-
)
120-
def test_cdiconfig_scratch_preserved_after_upgrade(
121-
self,
122-
skip_if_not_override_cdiconfig_scratch_space,
123-
cdi_config,
124-
storage_class_for_updating_cdiconfig_scratch,
125-
):
126-
"""
127-
Check that the scratch StorageClass configuration should be preserved by the upgrade
128-
"""
129-
expected_sc = storage_class_for_updating_cdiconfig_scratch.instance.metadata.name
130-
actual_sc = cdi_config.scratch_space_storage_class_from_status
131-
assert actual_sc == expected_sc, (
132-
"The scratchSpaceStorageClass on CDIConfig config should not change after upgrade"
133-
)
134-
13589
@pytest.mark.sno
13690
@pytest.mark.polarion("CNV-5994")
13791
@pytest.mark.order(after=IUO_UPGRADE_TEST_ORDERING_NODE_ID)

0 commit comments

Comments
 (0)