diff --git a/pytest.ini b/pytest.ini index 186e3cbef..5f21fedbb 100644 --- a/pytest.ini +++ b/pytest.ini @@ -18,6 +18,7 @@ markers = fuzzer: Mark tests that use fuzzing and are probably going to generate unanticipated failures. ocp_interop: Interop testing with Openshift. downstream_only: Tests that are specific to downstream + cluster_health: Tests that verifies that cluster is healthy to begin testing # Model server modelmesh: Mark tests which are model mesh tests diff --git a/tests/cluster_health/__init__.py b/tests/cluster_health/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cluster_health/test_cluster_health.py b/tests/cluster_health/test_cluster_health.py new file mode 100644 index 000000000..9b3e76151 --- /dev/null +++ b/tests/cluster_health/test_cluster_health.py @@ -0,0 +1,23 @@ +import pytest + +from ocp_resources.data_science_cluster import DataScienceCluster +from ocp_resources.dsc_initialization import DSCInitialization +from ocp_resources.node import Node +from ocp_utilities.infra import assert_nodes_in_healthy_condition, assert_nodes_schedulable +from utilities.infra import wait_for_dsci_status_ready, wait_for_dsc_status_ready + + +@pytest.mark.cluster_health +def test_cluster_node_healthy(nodes: list[Node]): + assert_nodes_in_healthy_condition(nodes=nodes, healthy_node_condition_type={"KubeletReady": "True"}) + assert_nodes_schedulable(nodes=nodes) + + +@pytest.mark.cluster_health +def test_data_science_cluster_initialization_healthy(dsci_resource: DSCInitialization): + wait_for_dsci_status_ready(dsci_resource=dsci_resource) + + +@pytest.mark.cluster_health +def test_data_science_cluster_healthy(dsc_resource: DataScienceCluster): + wait_for_dsc_status_ready(dsc_resource=dsc_resource)