From af2eed58503c9167175d7648936b388d5ab5753a Mon Sep 17 00:00:00 2001 From: Jenia Peimer Date: Wed, 8 Jul 2026 11:38:40 +0300 Subject: [PATCH] Remove HPP destructive tests Remove tests marked with both pytest.mark.hpp and pytest.mark.destructive: - test_hpp_operator_recreate_after_deletion (CNV-3277) - test_create_dv_on_right_node_with_node_placement (CNV-5711, CNV-5712, CNV-5713) Also remove the now-unused updated_hpp_with_node_placement fixture and clean up orphaned imports and constants. Assisted-by: Claude Signed-off-by: Jenia Peimer --- tests/storage/hpp/conftest.py | 31 -------------- tests/storage/hpp/test_hostpath.py | 29 +------------ tests/storage/hpp/test_hpp_node_placement.py | 44 -------------------- 3 files changed, 1 insertion(+), 103 deletions(-) diff --git a/tests/storage/hpp/conftest.py b/tests/storage/hpp/conftest.py index 83c7e7d159..4c51d0db4b 100644 --- a/tests/storage/hpp/conftest.py +++ b/tests/storage/hpp/conftest.py @@ -1,16 +1,11 @@ import pytest from ocp_resources.persistent_volume import PersistentVolume from ocp_resources.persistent_volume_claim import PersistentVolumeClaim -from ocp_resources.resource import ResourceEditor from tests.storage.hpp.utils import ( DV_NAME, HPP_KEY, - HPP_NODE_PLACEMENT_DICT, - TYPE, VM_NAME, - update_node_taint, - wait_for_desired_hpp_pods_running, ) from tests.utils import create_cirros_vm from utilities.constants.timeouts import TIMEOUT_5MIN @@ -89,32 +84,6 @@ def update_node_labels(worker_node1): worker_resource.restore() -@pytest.fixture() -def updated_hpp_with_node_placement( - worker_node2, - worker_node3, - hostpath_provisioner_scope_module, - request, - hpp_daemonset_scope_session, - schedulable_nodes, -): - node_placement_type = request.param[TYPE] - with ResourceEditor( - patches={hostpath_provisioner_scope_module: HPP_NODE_PLACEMENT_DICT[node_placement_type]} - ) as updated_resource: - if node_placement_type == "tolerations": - with update_node_taint(node=worker_node2), update_node_taint(node=worker_node3): - # Wait for 1 hpp pod to be running, and for others to be deleted - wait_for_desired_hpp_pods_running(hpp_daemonset=hpp_daemonset_scope_session, number_of_pods=1) - yield updated_resource - else: - # Wait for 1 hpp pod to be running, and for others to be deleted - wait_for_desired_hpp_pods_running(hpp_daemonset=hpp_daemonset_scope_session, number_of_pods=1) - yield updated_resource - # Wait for hpp pods to be restored - wait_for_desired_hpp_pods_running(hpp_daemonset=hpp_daemonset_scope_session, number_of_pods=len(schedulable_nodes)) - - @pytest.fixture() def cirros_pvc_on_hpp(cirros_vm_for_node_placement_tests): return PersistentVolumeClaim( diff --git a/tests/storage/hpp/test_hostpath.py b/tests/storage/hpp/test_hostpath.py index c003311c5f..444868fbd4 100644 --- a/tests/storage/hpp/test_hostpath.py +++ b/tests/storage/hpp/test_hostpath.py @@ -21,13 +21,12 @@ from ocp_resources.service_monitor import ServiceMonitor from utilities.constants.components import HOSTPATH_PROVISIONER_OPERATOR, HPP_POOL -from utilities.constants.timeouts import TIMEOUT_1MIN, TIMEOUT_5MIN +from utilities.constants.timeouts import TIMEOUT_1MIN from utilities.infra import get_pod_by_name_prefix LOGGER = logging.getLogger(__name__) HOSTPATH_PROVISIONER_ADMIN = "hostpath-provisioner-admin" -VOLUME_BINDING_MODE = "volumeBindingMode" pytestmark = pytest.mark.hpp @@ -76,13 +75,6 @@ def verify_hpp_app_label(hpp_resources, cnv_version): ), f"Missing label {Resource.ApiGroup.APP_KUBERNETES_IO}/managed-by for {resource.name}" -@pytest.fixture(scope="module") -def hpp_operator_deployment(hco_namespace): - hpp_operator_deployment = Deployment(name=HOSTPATH_PROVISIONER_OPERATOR, namespace=hco_namespace.name) - assert hpp_operator_deployment.exists - return hpp_operator_deployment - - @pytest.fixture(scope="module") def hpp_prometheus_resources(hco_namespace): rbac_name = "hostpath-provisioner-monitoring" @@ -240,25 +232,6 @@ def test_hpp_operator_pod(hpp_operator_pod): assert hpp_operator_pod.status == Pod.Status.RUNNING, f"HPP operator pod {hpp_operator_pod.name} is not running" -@pytest.mark.destructive -@pytest.mark.polarion("CNV-3277") -def test_hpp_operator_recreate_after_deletion( - hpp_operator_deployment, - storage_class_matrix_hpp_matrix__module__, -): - """ - Check that Hostpath-provisioner operator will be created again by HCO after its deletion. - The Deployment is deleted, then its RepliceSet and Pod will be deleted and created again. - """ - pre_delete_binding_mode = storage_class_matrix_hpp_matrix__module__.instance[VOLUME_BINDING_MODE] - hpp_operator_deployment.delete() - hpp_operator_deployment.wait_for_replicas(timeout=TIMEOUT_5MIN) - recreated_binding_mode = storage_class_matrix_hpp_matrix__module__.instance[VOLUME_BINDING_MODE] - assert pre_delete_binding_mode == recreated_binding_mode, ( - f"Pre delete binding mode: {pre_delete_binding_mode}, differs from recreated: {recreated_binding_mode}" - ) - - @pytest.mark.sno @pytest.mark.polarion("CNV-6097") @pytest.mark.s390x diff --git a/tests/storage/hpp/test_hpp_node_placement.py b/tests/storage/hpp/test_hpp_node_placement.py index 791ecf4b2e..1b5a5f2381 100644 --- a/tests/storage/hpp/test_hpp_node_placement.py +++ b/tests/storage/hpp/test_hpp_node_placement.py @@ -8,13 +8,9 @@ from tests.storage.hpp.utils import ( DV_NAME, - HCO_NODE_PLACEMENT, - NODE_SELECTOR, - TYPE, VM_NAME, edit_hpp_with_node_selector, ) -from utilities.constants.cluster import NODE_STR from utilities.storage import check_disk_count_in_vm LOGGER = logging.getLogger(__name__) @@ -22,46 +18,6 @@ pytestmark = pytest.mark.hpp -@pytest.mark.destructive -@pytest.mark.parametrize( - ( - "updated_hpp_with_node_placement", - "hyperconverged_with_node_placement", - "cirros_vm_for_node_placement_tests", - ), - [ - pytest.param( - {TYPE: NODE_SELECTOR}, - HCO_NODE_PLACEMENT, - {DV_NAME: "dv-5711", VM_NAME: "vm-5711", NODE_STR: None}, - marks=pytest.mark.polarion("CNV-5711"), - ), - pytest.param( - {TYPE: "affinity"}, - HCO_NODE_PLACEMENT, - {DV_NAME: "dv-5712", VM_NAME: "vm-5712", NODE_STR: None}, - marks=pytest.mark.polarion("CNV-5712"), - ), - pytest.param( - {TYPE: "tolerations"}, - HCO_NODE_PLACEMENT, - {DV_NAME: "dv-5713", VM_NAME: "vm-5713", NODE_STR: None}, - marks=pytest.mark.polarion("CNV-5713"), - ), - ], - indirect=True, -) -def test_create_dv_on_right_node_with_node_placement( - worker_node1, - update_node_labels, - updated_hpp_with_node_placement, - hyperconverged_with_node_placement, - cirros_vm_for_node_placement_tests, -): - # The VM should be created on the node that have the node labels - assert cirros_vm_for_node_placement_tests.vmi.node.name == worker_node1.name - - @pytest.mark.post_upgrade @pytest.mark.parametrize( "cirros_vm_for_node_placement_tests",