Skip to content

Commit

Permalink
Incorperating Review Comments
Browse files Browse the repository at this point in the history
Signed-off-by: suchita-g <[email protected]>
  • Loading branch information
suchita-g committed Nov 14, 2023
1 parent 7524037 commit 070cae9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
9 changes: 5 additions & 4 deletions ocs_ci/framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import logging
from collections.abc import Mapping
from dataclasses import dataclass, field, fields
from ocs_ci.ocs.constants import HCI_CLIENT, HCI_PROVIDER
from ocs_ci.ocs.exceptions import ClusterNotFoundException

THIS_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -375,7 +376,7 @@ def is_consumer_exist(self):
cluster_types = [cluster.ENV_DATA["cluster_type"] for cluster in self.clusters]
return "consumer" in cluster_types

def is_hci_client_exist(self):
def hci_client_exist(self):
"""
Check if the hci_client cluster exists in the clusters
Expand All @@ -384,9 +385,9 @@ def is_hci_client_exist(self):
"""
cluster_types = [cluster.ENV_DATA["cluster_type"] for cluster in self.clusters]
return "hci_client" in cluster_types
return HCI_CLIENT in cluster_types

def is_hci_provider_exist(self):
def hci_provider_exist(self):
"""
Check if the provider cluster exists in the clusters
Expand All @@ -395,7 +396,7 @@ def is_hci_provider_exist(self):
"""
cluster_types = [cluster.ENV_DATA["cluster_type"] for cluster in self.clusters]
return "provider" in cluster_types
return HCI_PROVIDER in cluster_types

def is_cluster_type_exist(self, cluster_type):
"""
Expand Down
18 changes: 10 additions & 8 deletions ocs_ci/framework/pytest_customization/marks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
MANAGED_SERVICE_PLATFORMS,
HPCS_KMS_PROVIDER,
HCI_PROVIDER_CLIENT_PLATFORMS,
HCI_CLIENT,
HCI_PROVIDER,
)
from ocs_ci.utility import version
from ocs_ci.utility.aws import update_config_from_s3
Expand Down Expand Up @@ -279,7 +281,7 @@
not (
config.default_cluster_ctx.ENV_DATA["platform"].lower()
in HCI_PROVIDER_CLIENT_PLATFORMS
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == "hci_client"
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == HCI_CLIENT
),
reason="Test runs ONLY on Fusion HCI Client cluster",
)
Expand All @@ -288,15 +290,15 @@
not (
config.default_cluster_ctx.ENV_DATA["platform"].lower()
in HCI_PROVIDER_CLIENT_PLATFORMS
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == "provider"
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == HCI_PROVIDER
),
reason="Test runs ONLY on Fusion HCI Provider cluster",
)
hci_provider_and_client_required = pytest.mark.skipif(
not (
config.ENV_DATA["platform"].lower() in HCI_PROVIDER_CLIENT_PLATFORMS
and config.is_hci_provider_exist()
and config.is_hci_client_exist()
and config.hci_provider_exist()
and config.hci_client_exist()
),
reason="Test runs ONLY on Fusion HCI provider and client clusters",
)
Expand Down Expand Up @@ -371,21 +373,21 @@
skipif_hci_provider = pytest.mark.skipif(
config.default_cluster_ctx.ENV_DATA["platform"].lower()
in HCI_PROVIDER_CLIENT_PLATFORMS
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == "provider",
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == HCI_PROVIDER,
reason="Test will not run on Fusion HCI provider cluster",
)

skipif_hci_client = pytest.mark.skipif(
config.default_cluster_ctx.ENV_DATA["platform"].lower()
in HCI_PROVIDER_CLIENT_PLATFORMS
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == "hci_client",
and config.default_cluster_ctx.ENV_DATA["cluster_type"].lower() == HCI_CLIENT,
reason="Test will not run on Fusion HCI client cluster",
)

skipif_hci_provider_and_client = pytest.mark.skipif(
config.ENV_DATA["platform"].lower() in HCI_PROVIDER_CLIENT_PLATFORMS
and config.is_hci_provider_exist()
and config.is_hci_client_exist(),
and config.hci_provider_exist()
and config.hci_client_exist(),
reason="Test will not run on Fusion HCI provider and Client clusters",
)

Expand Down
4 changes: 2 additions & 2 deletions ocs_ci/ocs/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,7 @@ def is_hci_client_cluster():
"""
return (
config.ENV_DATA["platform"].lower() in constants.HCI_PROVIDER_CLIENT_PLATFORMS
and config.ENV_DATA["cluster_type"].lower() == "hci_client"
and config.ENV_DATA["cluster_type"].lower() == constants.HCI_CLIENT
)


Expand Down Expand Up @@ -2240,7 +2240,7 @@ def is_hci_provider_cluster():
"""
return (
config.ENV_DATA["platform"].lower() in constants.HCI_PROVIDER_CLIENT_PLATFORMS
and config.ENV_DATA["cluster_type"].lower() == "provider"
and config.ENV_DATA["cluster_type"].lower() == constants.HCI_PROVIDER
)


Expand Down
4 changes: 4 additions & 0 deletions ocs_ci/ocs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@
MS_PROVIDER_TYPE = "provider"
NON_MS_CLUSTER_TYPE = "non_ms"

# HCI cluster types
HCI_CLIENT = "hci_client"
HCI_PROVIDER = "provider"

OCP_QE_MISC_REPO = "https://gitlab.cee.redhat.com/aosqe/flexy-templates.git"
CRITICAL_ERRORS = ["core dumped", "oom_reaper"]
must_gather_pod_label = "app=must-gather"
Expand Down
2 changes: 1 addition & 1 deletion ocs_ci/utility/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ def get_ocs_build_number():
operator_name = defaults.ODF_OPERATOR_NAME
if (
config.ENV_DATA.get("platform") in constants.HCI_PROVIDER_CLIENT_PLATFORMS
and config.ENV_DATA.get("cluster_type") == "hci_client"
and config.ENV_DATA.get("cluster_type") == constants.HCI_CLIENT
):
operator_name = defaults.HCI_CLIENT_ODF_OPERATOR_NAME
else:
Expand Down
File renamed without changes.

0 comments on commit 070cae9

Please sign in to comment.