diff --git a/ocs_ci/framework/__init__.py b/ocs_ci/framework/__init__.py index d2b66a211fac..67cd59484a49 100644 --- a/ocs_ci/framework/__init__.py +++ b/ocs_ci/framework/__init__.py @@ -375,7 +375,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 @@ -386,7 +386,7 @@ def is_hci_client_exist(self): cluster_types = [cluster.ENV_DATA["cluster_type"] for cluster in self.clusters] 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 diff --git a/ocs_ci/framework/pytest_customization/marks.py b/ocs_ci/framework/pytest_customization/marks.py index 0587f2720bd0..2ef0f41c2ceb 100644 --- a/ocs_ci/framework/pytest_customization/marks.py +++ b/ocs_ci/framework/pytest_customization/marks.py @@ -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 @@ -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", ) @@ -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", ) @@ -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", ) diff --git a/ocs_ci/ocs/cluster.py b/ocs_ci/ocs/cluster.py index 301c2d657cfc..e02527b62b59 100644 --- a/ocs_ci/ocs/cluster.py +++ b/ocs_ci/ocs/cluster.py @@ -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 ) @@ -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 ) diff --git a/ocs_ci/ocs/constants.py b/ocs_ci/ocs/constants.py index 0ac717589e9c..3e58000cd696 100644 --- a/ocs_ci/ocs/constants.py +++ b/ocs_ci/ocs/constants.py @@ -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" diff --git a/ocs_ci/utility/utils.py b/ocs_ci/utility/utils.py index 0d04a9d22079..0692c4d0b2cd 100644 --- a/ocs_ci/utility/utils.py +++ b/ocs_ci/utility/utils.py @@ -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: diff --git a/tests/hci_provider_client/test_hci_pc_markers.py b/tests/libtest/test_hci_pc_markers.py similarity index 100% rename from tests/hci_provider_client/test_hci_pc_markers.py rename to tests/libtest/test_hci_pc_markers.py