Skip to content

Commit

Permalink
Redefining the fixure switch_to_provider_for_test to include HCI Prov…
Browse files Browse the repository at this point in the history
…ider

Signed-off-by: suchita-g <[email protected]>
  • Loading branch information
suchita-g committed Nov 9, 2023
1 parent b63cd66 commit 8153952
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ocs_ci/framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 11 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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
Expand Down

0 comments on commit 8153952

Please sign in to comment.