From 8153952c6ee31f904deff3de0a3365f7f66a2b1e Mon Sep 17 00:00:00 2001 From: suchita-g Date: Thu, 9 Nov 2023 21:10:08 +0530 Subject: [PATCH] Redefining the fixure switch_to_provider_for_test to include HCI Provider Signed-off-by: suchita-g --- ocs_ci/framework/__init__.py | 2 +- tests/conftest.py | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ocs_ci/framework/__init__.py b/ocs_ci/framework/__init__.py index 87b03dfac542..d2b66a211fac 100644 --- a/ocs_ci/framework/__init__.py +++ b/ocs_ci/framework/__init__.py @@ -355,7 +355,7 @@ def current_cluster_name(self): def is_provider_exist(self): """ - Check ifq the provider cluster exists in the clusters + Check if the provider cluster exists in the clusters Returns: bool: True, if the provider cluster exists in the clusters. False, otherwise. diff --git a/tests/conftest.py b/tests/conftest.py index 4015cd33e92b..2aab1397bec4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5934,7 +5934,7 @@ def toolbox_on_faas_consumer(): @pytest.fixture(scope="function", autouse=True) def switch_to_provider_for_test(request): """ - Switch to provider cluster as required by the test. Applicable for Managed Services only if + Switch to provider cluster as required by the test. Applicable for Managed Services and HCI Provider-client only if the marker 'runs_on_provider' is added in the test. """ @@ -5943,11 +5943,18 @@ def switch_to_provider_for_test(request): if ( request.node.get_closest_marker("runs_on_provider") and ocsci_config.multicluster - and current_cluster.ENV_DATA.get("platform", "").lower() - in constants.MANAGED_SERVICE_PLATFORMS + and ( + current_cluster.ENV_DATA.get("platform", "").lower() + in constants.MANAGED_SERVICE_PLATFORMS + or current_cluster.ENV_DATA.get("platform", "").lower() + in constants.HCI_PROVIDER_CLIENT_PLATFORMS + ) ): for cluster in ocsci_config.clusters: - if cluster.ENV_DATA.get("cluster_type") == "provider": + if ( + cluster.ENV_DATA.get("cluster_type") == "provider" + or cluster.ENV_DATA.get("cluster_type") == "hci_provider" + ): provider_cluster = cluster log.debug("Switching to the provider cluster context") # TODO: Use 'switch_to_provider' function introduced in PR 5541