Skip to content

Commit

Permalink
In the test "test_add_capacity_node_restart" restart the nodes withou…
Browse files Browse the repository at this point in the history
…t waiting for the Reboot event when using vSphere IPI 4.11 #8076 (#8358)


Signed-off-by: ikave <[email protected]>
  • Loading branch information
yitzhak12 authored Oct 23, 2023
1 parent 742ec29 commit c2f17c2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
14 changes: 14 additions & 0 deletions ocs_ci/ocs/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c2f17c2

Please sign in to comment.