From c2f17c2d67d6824cc73b1b84d0fc8b8a1a636c8b Mon Sep 17 00:00:00 2001 From: Itzhak Kave Date: Mon, 23 Oct 2023 15:01:43 +0300 Subject: [PATCH] In the test "test_add_capacity_node_restart" restart the nodes without waiting for the Reboot event when using vSphere IPI 4.11 #8076 (#8358) Signed-off-by: ikave --- ocs_ci/ocs/cluster.py | 14 ++++++++++++++ .../test_add_capacity_with_node_restart.py | 14 ++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ocs_ci/ocs/cluster.py b/ocs_ci/ocs/cluster.py index a73ea68d11f..82b40c63a30 100644 --- a/ocs_ci/ocs/cluster.py +++ b/ocs_ci/ocs/cluster.py @@ -2979,3 +2979,17 @@ def get_lvm_full_version(): image = getattr(redhat_operators_catalogesource_ocs, "data")["spec"]["image"] full_version = image.split(":")[1] return full_version + + +def is_vsphere_ipi_cluster(): + """ + Check if the cluster is a vSphere IPI cluster + + Returns: + bool: True, if the cluster is a vSphere IPI cluster. False, otherwise + + """ + return ( + config.ENV_DATA["platform"].lower() == constants.VSPHERE_PLATFORM + and config.ENV_DATA["deployment_type"] == "ipi" + ) diff --git a/tests/manage/z_cluster/cluster_expansion/test_add_capacity_with_node_restart.py b/tests/manage/z_cluster/cluster_expansion/test_add_capacity_with_node_restart.py index a243aa2ce8c..fd93294b9cc 100644 --- a/tests/manage/z_cluster/cluster_expansion/test_add_capacity_with_node_restart.py +++ b/tests/manage/z_cluster/cluster_expansion/test_add_capacity_with_node_restart.py @@ -12,11 +12,12 @@ from ocs_ci.ocs.ocp import OCP from ocs_ci.ocs.resources import pod as pod_helpers from ocs_ci.ocs.resources import storage_cluster -from ocs_ci.ocs.node import get_ocs_nodes +from ocs_ci.ocs.node import get_ocs_nodes, wait_for_nodes_status from ocs_ci.ocs.resources.storage_cluster import osd_encryption_verification from ocs_ci.ocs.cluster import ( check_ceph_health_after_add_capacity, is_flexible_scaling_enabled, + is_vsphere_ipi_cluster, ) logger = logging.getLogger(__name__) @@ -77,9 +78,14 @@ def test_add_capacity_node_restart( logger.info("add capacity failed") # Restart nodes while additional storage is being added - logger.info("Restart nodes:") - logger.info([n.name for n in node_list]) - nodes.restart_nodes(nodes=node_list, wait=True) + node_names = [n.name for n in node_list] + logger.info(f"Restart nodes: {node_names}") + if is_vsphere_ipi_cluster(): + nodes.restart_nodes(nodes=node_list, wait=False) + wait_for_nodes_status(node_names, constants.STATUS_READY, timeout=300) + else: + nodes.restart_nodes(nodes=node_list, wait=True) + logger.info("Finished restarting the node list") # The exit criteria verification conditions here are not complete. When the branch