diff --git a/ocs_ci/ocs/cluster.py b/ocs_ci/ocs/cluster.py index e02527b62b5..21f2c322e9c 100644 --- a/ocs_ci/ocs/cluster.py +++ b/ocs_ci/ocs/cluster.py @@ -1235,7 +1235,7 @@ def validate_pdb_creation(): """ pdb_obj = ocp.OCP( - kind="PodDisruptionBudget", namespace=constants.OPENSHIFT_STORAGE_NAMESPACE + kind="PodDisruptionBudget", namespace=config.ENV_DATA["cluster_namespace"] ) item_list = pdb_obj.get().get("items") pdb_count = constants.PDB_COUNT diff --git a/ocs_ci/ocs/must_gather/must_gather.py b/ocs_ci/ocs/must_gather/must_gather.py index 2e05d47648a..6cdf1a85503 100644 --- a/ocs_ci/ocs/must_gather/must_gather.py +++ b/ocs_ci/ocs/must_gather/must_gather.py @@ -15,10 +15,7 @@ GATHER_COMMANDS_LOG, ) from ocs_ci.utility import version -from ocs_ci.ocs.constants import ( - OPENSHIFT_STORAGE_NAMESPACE, - MANAGED_SERVICE_PLATFORMS, -) +from ocs_ci.ocs.constants import MANAGED_SERVICE_PLATFORMS logger = logging.getLogger(__name__) @@ -151,7 +148,7 @@ def compare_running_pods(self): """ if self.type_log != "OTHERS": return - pod_objs = get_all_pods(namespace=OPENSHIFT_STORAGE_NAMESPACE) + pod_objs = get_all_pods(namespace=config.ENV_DATA["cluster_namespace"]) pod_names = [] logger.info("Get pod names on openshift-storage project") for pod in pod_objs: diff --git a/ocs_ci/ocs/resources/pod.py b/ocs_ci/ocs/resources/pod.py index a1a69779e2d..35766662db2 100644 --- a/ocs_ci/ocs/resources/pod.py +++ b/ocs_ci/ocs/resources/pod.py @@ -3324,7 +3324,7 @@ def check_ceph_cmd_execute_successfully(): def search_pattern_in_pod_logs( pod_name, pattern, - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], container=None, all_containers=False, ): diff --git a/ocs_ci/ocs/resources/storage_cluster.py b/ocs_ci/ocs/resources/storage_cluster.py index ae4d9bc4368..849f24fde34 100644 --- a/ocs_ci/ocs/resources/storage_cluster.py +++ b/ocs_ci/ocs/resources/storage_cluster.py @@ -1289,7 +1289,7 @@ def get_in_transit_encryption_config_state(): ocp_obj = StorageCluster( resource_name=cluster_name, - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], ) try: @@ -1326,7 +1326,7 @@ def set_in_transit_encryption(enabled=True): ocp_obj = StorageCluster( resource_name=cluster_name, - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], ) patch = {"spec": {"network": {"connections": {"encryption": {"enabled": enabled}}}}} @@ -2397,7 +2397,7 @@ class names. If a resource does not have a storage class name, it will be set to """ sc_obj = ocp.OCP( kind=constants.STORAGECLUSTER, - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], ) keys_to_search = [ @@ -2579,7 +2579,7 @@ def validate_serviceexport(): """ serviceexport = OCP( - kind="ServiceExport", namespace=constants.OPENSHIFT_STORAGE_NAMESPACE + kind="ServiceExport", namespace=config.ENV_DATA["cluster_namespace"] ) osd_count = 0 mon_count = 0 diff --git a/ocs_ci/ocs/scale_noobaa_lib.py b/ocs_ci/ocs/scale_noobaa_lib.py index ad4df41bf0c..87b04f03f2b 100644 --- a/ocs_ci/ocs/scale_noobaa_lib.py +++ b/ocs_ci/ocs/scale_noobaa_lib.py @@ -344,10 +344,10 @@ def get_pod_obj(pod_name): pod_obj = pod.get_pod_obj( ( get_pod_name_by_pattern( - pattern=pod_name, namespace=constants.OPENSHIFT_STORAGE_NAMESPACE + pattern=pod_name, namespace=config.ENV_DATA["cluster_namespace"] ) )[0], - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], ) return pod_obj diff --git a/tests/conftest.py b/tests/conftest.py index a05e891ccea..6b08b0c188c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -711,7 +711,8 @@ def factory( ) elif interface == constants.CEPHFILESYSTEM: cfs = ocp.OCP( - kind=constants.CEPHFILESYSTEM, namespace=defaults.ROOK_CLUSTER_NAMESPACE + kind=constants.CEPHFILESYSTEM, + namespace=ocsci_config.ENV_DATA["cluster_namespace"], ).get(defaults.CEPHFILESYSTEM_NAME) ceph_pool_obj = OCS(**cfs) assert ceph_pool_obj, f"Failed to create {interface} pool" @@ -2521,7 +2522,9 @@ def scale_cli_fixture(request, scope_name): assert scalecli_pod_obj.create( do_reload=True ), f"Failed to create pod {scalecli_pod_name}" - OCP(namespace=defaults.ROOK_CLUSTER_NAMESPACE, kind="ConfigMap").wait_for_resource( + OCP( + namespace=ocsci_config.ENV_DATA["cluster_namespace"], kind="ConfigMap" + ).wait_for_resource( resource_name=service_ca_configmap.name, column="DATA", condition="1" ) helpers.wait_for_resource_state( @@ -4317,7 +4320,7 @@ def nb_ensure_endpoint_count(request): max_ep_count = cls.MAX_ENDPOINT_COUNT assert min_ep_count <= max_ep_count - namespace = defaults.ROOK_CLUSTER_NAMESPACE + namespace = ocsci_config.ENV_DATA["cluster_namespace"] should_wait = False # prior to 4.6 we configured the ep count directly on the noobaa cr. @@ -5885,7 +5888,7 @@ def patch_consumer_toolbox_with_secret(): consumer_tools_deployment = OCP( kind=constants.DEPLOYMENT, - namespace=defaults.ROOK_CLUSTER_NAMESPACE, + namespace=ocsci_config.ENV_DATA["cluster_namespace"], resource_name="rook-ceph-tools", ) patch_value = ( @@ -5905,7 +5908,7 @@ def patch_consumer_toolbox_with_secret(): # Wait for the new tools pod to reach Running state new_tools_pod_info = get_pods_having_label( label=constants.TOOL_APP_LABEL, - namespace=defaults.ROOK_CLUSTER_NAMESPACE, + namespace=ocsci_config.ENV_DATA["cluster_namespace"], )[0] new_tools_pod = Pod(**new_tools_pod_info) helpers.wait_for_resource_state(new_tools_pod, constants.STATUS_RUNNING) @@ -6548,7 +6551,9 @@ def fedora_pod_fixture(request, scope_name): assert fedora_pod_obj.create( do_reload=True ), f"Failed to create Pod {fedora_pod_name}" - OCP(namespace=defaults.ROOK_CLUSTER_NAMESPACE, kind="ConfigMap").wait_for_resource( + OCP( + namespace=ocsci_config.ENV_DATA["cluster_namespace"], kind="ConfigMap" + ).wait_for_resource( resource_name=service_ca_configmap.name, column="DATA", condition="1" ) helpers.wait_for_resource_state( @@ -6650,7 +6655,7 @@ def change_the_noobaa_log_level(request): noobaa_cm = OCP( kind="configmap", resource_name="noobaa-config", - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=ocsci_config.ENV_DATA["cluster_namespace"], ) def factory(level="all"): @@ -6685,7 +6690,9 @@ def add_env_vars_to_noobaa_core_fixture(request, mcg_obj_session): Add env vars to the noobaa-core sts """ - sts_obj = OCP(kind="StatefulSet", namespace=defaults.ROOK_CLUSTER_NAMESPACE) + sts_obj = OCP( + kind="StatefulSet", namespace=ocsci_config.ENV_DATA["cluster_namespace"] + ) yaml_path_to_env_variables = "/spec/template/spec/containers/0/env" op_template_dict = {"op": "", "path": "", "value": {"name": "", "value": ""}} diff --git a/tests/disaster-recovery/regional-dr/test_managed_cluster_node_failure.py b/tests/disaster-recovery/regional-dr/test_managed_cluster_node_failure.py index a75b4d2c47b..908c4395068 100644 --- a/tests/disaster-recovery/regional-dr/test_managed_cluster_node_failure.py +++ b/tests/disaster-recovery/regional-dr/test_managed_cluster_node_failure.py @@ -39,7 +39,7 @@ class TestManagedClusterNodeFailure: }, "rbd-mirror": { "label": constants.RBD_MIRROR_APP_LABEL, - "namespace": constants.OPENSHIFT_STORAGE_NAMESPACE, + "namespace": config.ENV_DATA["cluster_namespace"], }, "submariner-gateway": { "label": constants.SUBMARINER_GATEWAY_ACTIVE_LABEL, diff --git a/tests/e2e/kcs/test_disable_mcg_external_service.py b/tests/e2e/kcs/test_disable_mcg_external_service.py index 87034621280..52b2e1476e4 100644 --- a/tests/e2e/kcs/test_disable_mcg_external_service.py +++ b/tests/e2e/kcs/test_disable_mcg_external_service.py @@ -3,7 +3,7 @@ from ocs_ci.utility.utils import TimeoutSampler from ocs_ci.ocs.ocp import OCP -from ocs_ci.ocs import constants +from ocs_ci.framework import config from ocs_ci.framework.pytest_customization.marks import ( tier2, polarion_id, @@ -23,7 +23,7 @@ def patch_noobaa_object(self, request): # get noobaa object noobaa_ocp_obj = OCP( kind="noobaa", - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], resource_name="noobaa", ) @@ -73,7 +73,7 @@ def test_disable_mcg_external_service(self, patch_noobaa_object): # verify that services are now Cluster IP service_obj = OCP( - kind="service", namespace=constants.OPENSHIFT_STORAGE_NAMESPACE + kind="service", namespace=config.ENV_DATA["cluster_namespace"] ) services = ["s3", "sts"] diff --git a/tests/e2e/kcs/test_selinux_relabel_solution.py b/tests/e2e/kcs/test_selinux_relabel_solution.py index dc667d0912f..a4f2fc07328 100644 --- a/tests/e2e/kcs/test_selinux_relabel_solution.py +++ b/tests/e2e/kcs/test_selinux_relabel_solution.py @@ -39,7 +39,7 @@ def create_deploymentconfig_pod(self, **kwargs): pod_obj = helpers.create_pod( interface_type=constants.CEPHFS_INTERFACE, pvc_name=self.pvc_obj.name, - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], sa_name=self.service_account_obj.name, dc_deployment=True, pod_dict_path=constants.PERF_DC_YAML, @@ -135,7 +135,7 @@ def apply_selinux_solution_on_existing_pvc(self, pvc_obj): } ] ocp_pvc = ocp.OCP( - kind=constants.PVC, namespace=constants.OPENSHIFT_STORAGE_NAMESPACE + kind=constants.PVC, namespace=config.ENV_DATA["cluster_namespace"] ) ocp_pvc.patch( resource_name=self.pvc_obj.name, @@ -157,7 +157,7 @@ def get_pod_start_time(self, pod_name): """ try: # Get the pod conditions - pod = ocp.OCP(kind="pod", namespace=constants.OPENSHIFT_STORAGE_NAMESPACE) + pod = ocp.OCP(kind="pod", namespace=config.ENV_DATA["cluster_namespace"]) conditions = pod.exec_oc_cmd( f"get pod {pod_name} -n openshift-storage -o jsonpath='{{.status.conditions}}'" ) @@ -218,7 +218,7 @@ def test_selinux_relabel_for_existing_pvc( """ self.ocp_project = ocp.OCP( - kind=constants.NAMESPACE, namespace=constants.OPENSHIFT_STORAGE_NAMESPACE + kind=constants.NAMESPACE, namespace=config.ENV_DATA["cluster_namespace"] ) # Create cephfs pvc @@ -249,7 +249,7 @@ def test_selinux_relabel_for_existing_pvc( # Get the md5sum of some random files data_path = f"{constants.FLEXY_MNT_CONTAINER_DIR}" num_of_files = random.randint(3, 9) - pod = ocp.OCP(kind="pod", namespace=constants.OPENSHIFT_STORAGE_NAMESPACE) + pod = ocp.OCP(kind="pod", namespace=config.ENV_DATA["cluster_namespace"]) random_files = pod.exec_oc_cmd( f"exec -it {self.pod_obj.name} -- /bin/bash" f' -c "find {data_path} -type f | "shuf" -n {num_of_files}"', @@ -296,7 +296,7 @@ def test_selinux_relabel_for_existing_pvc( node_name = res_pod.get_pod_node(pod_obj=self.pod_obj).name # Check SeLinux Relabeling is set to false - oc_cmd = ocp.OCP(namespace=constants.OPENSHIFT_STORAGE_NAMESPACE) + oc_cmd = ocp.OCP(namespace=config.ENV_DATA["cluster_namespace"]) cmd1 = "crictl inspect $(crictl ps --name perf -q)" output = oc_cmd.exec_oc_debug_cmd(node=node_name, cmd_list=[cmd1]) key = '"selinuxRelabel": false' diff --git a/tests/e2e/scale/noobaa/test_scale_obc_start_time_respin_noobaa_pods.py b/tests/e2e/scale/noobaa/test_scale_obc_start_time_respin_noobaa_pods.py index b7f459374fe..fbb6d7cf8d0 100644 --- a/tests/e2e/scale/noobaa/test_scale_obc_start_time_respin_noobaa_pods.py +++ b/tests/e2e/scale/noobaa/test_scale_obc_start_time_respin_noobaa_pods.py @@ -5,6 +5,7 @@ import csv from ocs_ci.ocs import constants, scale_noobaa_lib +from ocs_ci.framework import config from ocs_ci.framework.pytest_customization.marks import orange_squad from ocs_ci.framework.testlib import scale, E2ETest from ocs_ci.helpers import helpers @@ -17,7 +18,7 @@ @pytest.fixture(autouse=True) def teardown(request): def finalizer(): - scale_noobaa_lib.cleanup(constants.OPENSHIFT_STORAGE_NAMESPACE) + scale_noobaa_lib.cleanup(config.ENV_DATA["cluster_namespace"]) request.addfinalizer(finalizer) @@ -26,7 +27,7 @@ def finalizer(): @scale class TestScaleOBCStartTime(E2ETest): - namespace = constants.OPENSHIFT_STORAGE_NAMESPACE + namespace = config.ENV_DATA["cluster_namespace"] scale_obc_count = 10 scale_obc_count_io = 2 num_obc_batch = 5 diff --git a/tests/manage/mcg/test_bucket_replication.py b/tests/manage/mcg/test_bucket_replication.py index 5b291090421..71c28e3c59c 100644 --- a/tests/manage/mcg/test_bucket_replication.py +++ b/tests/manage/mcg/test_bucket_replication.py @@ -2,6 +2,7 @@ import pytest +from ocs_ci.framework import config from ocs_ci.framework.pytest_customization.marks import tier1, tier2, red_squad from ocs_ci.ocs.exceptions import CommandFailed from ocs_ci.framework.testlib import MCGTest @@ -400,7 +401,7 @@ def test_unidirectional_bucketclass_replication( **( get_pods_having_label( label=constants.NOOBAA_DB_LABEL_47_AND_ABOVE, - namespace=constants.OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], )[0] ) ) diff --git a/tests/manage/mcg/test_db_nfs_mount.py b/tests/manage/mcg/test_db_nfs_mount.py index 0b8d0e9cca5..42acb70713b 100644 --- a/tests/manage/mcg/test_db_nfs_mount.py +++ b/tests/manage/mcg/test_db_nfs_mount.py @@ -26,7 +26,7 @@ class TestNoobaaDbNFSMount: def mount_ngix_pod(self, request): # try to mount the reesi004 nfs mount to nginx pod nginx_pod_data = templating.load_yaml(constants.NGINX_POD_YAML) - nginx_pod_data["metadata"]["namespace"] = constants.OPENSHIFT_STORAGE_NAMESPACE + nginx_pod_data["metadata"]["namespace"] = config.ENV_DATA["cluster_namespace"] nginx_pod_data["spec"]["containers"][0]["volumeMounts"][0]["name"] = "nfs-vol" nginx_pod_data["spec"]["containers"][0]["volumeMounts"][0][ "mountPath" diff --git a/tests/manage/mcg/ui/test_namespace_store.py b/tests/manage/mcg/ui/test_namespace_store.py index 3d18a79cd3f..b435f51187c 100644 --- a/tests/manage/mcg/ui/test_namespace_store.py +++ b/tests/manage/mcg/ui/test_namespace_store.py @@ -3,6 +3,7 @@ from ocs_ci.ocs.ocp import OCP from ocs_ci.ocs import constants +from ocs_ci.framework import config from ocs_ci.framework.pytest_customization.marks import black_squad from ocs_ci.framework.testlib import tier1, ui, polarion_id from ocs_ci.ocs.ui.mcg_ui import NamespaceStoreUI @@ -41,7 +42,7 @@ def test_create_namespace_store_ui(self, setup_ui_class, pvc_factory): """ self.namespace_store_obj = None - openshift_storage_ns_obj = OCP(namespace=constants.OPENSHIFT_STORAGE_NAMESPACE) + openshift_storage_ns_obj = OCP(namespace=config.ENV_DATA["cluster_namespace"]) pvc_obj = pvc_factory( interface=constants.CEPHFILESYSTEM, project=openshift_storage_ns_obj, diff --git a/tests/manage/z_cluster/test_add_mds_to_cluster.py b/tests/manage/z_cluster/test_add_mds_to_cluster.py index 48e2ade9a0d..352d6d911a3 100644 --- a/tests/manage/z_cluster/test_add_mds_to_cluster.py +++ b/tests/manage/z_cluster/test_add_mds_to_cluster.py @@ -9,7 +9,6 @@ from ocs_ci.framework import config from ocs_ci.framework.pytest_customization.marks import brown_squad from ocs_ci.framework.testlib import ManageTest -from ocs_ci.ocs.defaults import ROOK_CLUSTER_NAMESPACE from ocs_ci.ocs.resources.ocs import OCS from ocs_ci.utility.utils import TimeoutSampler @@ -28,9 +27,12 @@ def finalizer(): fs_data = cephfs.get(defaults.CEPHFILESYSTEM_NAME) fs_data["spec"]["metadataServer"]["activeCount"] = original_active_count ceph_obj.apply(**fs_data) - pod = ocp.OCP(kind=constants.POD, namespace=ROOK_CLUSTER_NAMESPACE) + pod = ocp.OCP( + kind=constants.POD, namespace=config.ENV_DATA["cluster_namespace"] + ) mds_pods = pod.get( - selector=constants.MDS_APP_LABEL, all_namespaces=ROOK_CLUSTER_NAMESPACE + selector=constants.MDS_APP_LABEL, + all_namespaces=config.ENV_DATA["cluster_namespace"], )["items"] mds_names = [pod.get("metadata").get("name") for pod in mds_pods] for mds in mds_names: diff --git a/tests/manage/z_cluster/test_delete_local_volume_sym_link.py b/tests/manage/z_cluster/test_delete_local_volume_sym_link.py index 6594476b52d..3d9886146c4 100644 --- a/tests/manage/z_cluster/test_delete_local_volume_sym_link.py +++ b/tests/manage/z_cluster/test_delete_local_volume_sym_link.py @@ -2,7 +2,6 @@ import pytest from ocs_ci.ocs.utils import get_pod_name_by_pattern -from ocs_ci.ocs.defaults import ROOK_CLUSTER_NAMESPACE from ocs_ci.framework.testlib import E2ETest, tier4b from ocs_ci.ocs import ocp, constants from ocs_ci.framework.pytest_customization.marks import skipif_no_lso, brown_squad @@ -33,12 +32,16 @@ def test_delete_local_volume_sym_link(self): """ # Get rook-ceph-crashcollector pod objects crashcollector_pods = get_pod_name_by_pattern( - pattern="rook-ceph-crashcollector", namespace=ROOK_CLUSTER_NAMESPACE + pattern="rook-ceph-crashcollector", + namespace=config.ENV_DATA["cluster_namespace"], ) crashcollector_pods_objs = [] for crashcollector_pod in crashcollector_pods: crashcollector_pods_objs.append( - get_pod_obj(name=crashcollector_pod, namespace=ROOK_CLUSTER_NAMESPACE) + get_pod_obj( + name=crashcollector_pod, + namespace=config.ENV_DATA["cluster_namespace"], + ) ) # Get Node object @@ -47,12 +50,14 @@ def test_delete_local_volume_sym_link(self): # Get Sym link osd_pvcs = get_deviceset_pvcs() pv_name = osd_pvcs[0].data["spec"]["volumeName"] - ocp_obj = ocp.OCP(namespace=ROOK_CLUSTER_NAMESPACE, kind=constants.PV) + ocp_obj = ocp.OCP( + namespace=config.ENV_DATA["cluster_namespace"], kind=constants.PV + ) pv_obj = ocp_obj.get(resource_name=pv_name) path = pv_obj["spec"]["local"]["path"] log.info("Delete sym link") - oc_cmd = ocp.OCP(namespace=ROOK_CLUSTER_NAMESPACE) + oc_cmd = ocp.OCP(namespace=config.ENV_DATA["cluster_namespace"]) cmd = f"rm -rfv {path}" oc_cmd.exec_oc_debug_cmd(node=node_obj.name, cmd_list=[cmd]) diff --git a/tests/manage/z_cluster/test_multiple_mon_pods_stays_on_same_node.py b/tests/manage/z_cluster/test_multiple_mon_pods_stays_on_same_node.py index e2195f2a695..a407fb7d49a 100644 --- a/tests/manage/z_cluster/test_multiple_mon_pods_stays_on_same_node.py +++ b/tests/manage/z_cluster/test_multiple_mon_pods_stays_on_same_node.py @@ -15,7 +15,6 @@ from ocs_ci.ocs.constants import ( ROOK_CEPH_MON_ENDPOINTS, CONFIGMAP, - OPENSHIFT_STORAGE_NAMESPACE, STATUS_RUNNING, STATUS_PENDING, MON_APP_LABEL, @@ -36,7 +35,7 @@ from ocs_ci.framework import config log = logging.getLogger(__name__) -POD_OBJ = OCP(kind=POD, namespace=OPENSHIFT_STORAGE_NAMESPACE) +POD_OBJ = OCP(kind=POD, namespace=config.ENV_DATA["cluster_namespace"]) @brown_squad @@ -130,7 +129,9 @@ def test_multiple_mon_pod_stays_on_same_node(self): # Edit the rook-ceph-mon-endpoints log.info(f"Edit the configmap {ROOK_CEPH_MON_ENDPOINTS}") - configmap_obj = OCP(kind=CONFIGMAP, namespace=OPENSHIFT_STORAGE_NAMESPACE) + configmap_obj = OCP( + kind=CONFIGMAP, namespace=config.ENV_DATA["cluster_namespace"] + ) rook_ceph_mon_configmap = configmap_obj.get( resource_name=ROOK_CEPH_MON_ENDPOINTS ) @@ -150,7 +151,7 @@ def test_multiple_mon_pod_stays_on_same_node(self): ) # Delete one mon deployment which had been edited - dep_obj = OCP(kind=DEPLOYMENT, namespace=OPENSHIFT_STORAGE_NAMESPACE) + dep_obj = OCP(kind=DEPLOYMENT, namespace=config.ENV_DATA["cluster_namespace"]) mon_deployment_name_to_del = f"{rook_ceph_mon}-{mon_name_to_del}" log.info(f"Deleting mon {mon_deployment_name_to_del} deployments") dep_obj.delete(resource_name=mon_deployment_name_to_del) diff --git a/tests/manage/z_cluster/test_no_liveness_probe.py b/tests/manage/z_cluster/test_no_liveness_probe.py index e76e6bf3603..54a87135767 100644 --- a/tests/manage/z_cluster/test_no_liveness_probe.py +++ b/tests/manage/z_cluster/test_no_liveness_probe.py @@ -2,13 +2,13 @@ from logging import getLogger from ocs_ci.ocs.constants import ( - OPENSHIFT_STORAGE_NAMESPACE, CSI_CEPHFSPLUGIN_LABEL, POD, CSI_CEPHFSPLUGIN_PROVISIONER_LABEL, CSI_RBDPLUGIN_LABEL, CSI_RBDPLUGIN_PROVISIONER_LABEL, ) +from ocs_ci.framework import config from ocs_ci.framework.pytest_customization.marks import ( tier1, bugzilla, @@ -34,21 +34,23 @@ def test_no_liveness_container(): """ csi_plugin_pod = OCP( - kind=POD, namespace=OPENSHIFT_STORAGE_NAMESPACE, selector=CSI_CEPHFSPLUGIN_LABEL + kind=POD, + namespace=config.ENV_DATA["cluster_namespace"], + selector=CSI_CEPHFSPLUGIN_LABEL, ) csi_prov_pod = OCP( kind=POD, - namespace=OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], selector=CSI_CEPHFSPLUGIN_PROVISIONER_LABEL, ) rbd_plugin_pod = OCP( kind=POD, - namespace=OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], selector=CSI_RBDPLUGIN_LABEL, ) rbd_prov_pod = OCP( kind=POD, - namespace=OPENSHIFT_STORAGE_NAMESPACE, + namespace=config.ENV_DATA["cluster_namespace"], selector=CSI_RBDPLUGIN_PROVISIONER_LABEL, ) for pods in (csi_plugin_pod, rbd_plugin_pod, rbd_prov_pod, csi_prov_pod):