Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[T2] [chassis] change default wait time for links to come up for T2 #16051

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions tests/common/platform/processes_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
logger = logging.getLogger(__name__)


def reset_timeout(duthost):
def reset_timeout(duthost, reset_timeout):
"""
return: if timeout is specified in inventory file for this dut, return new timeout
if not specified, return 300 sec as default timeout
Expand All @@ -21,11 +21,9 @@ def reset_timeout(duthost):
timeout: 400
wait: 60
"""
reset_timeout = 300
plt_reboot_ctrl = get_plt_reboot_ctrl(duthost, 'processes_utils.py', 'cold')
if plt_reboot_ctrl:
reset_timeout = plt_reboot_ctrl.get('timeout', 300)
return reset_timeout


def get_critical_processes_status(dut):
Expand Down Expand Up @@ -63,12 +61,13 @@ def check_critical_processes(dut, watch_secs=0):
watch_secs = watch_secs - 5


def wait_critical_processes(dut):
def wait_critical_processes(dut, timeout=300):
"""
@summary: wait until all critical processes are healthy.
@param dut: The AnsibleHost object of DUT. For interacting with DUT.
timeout: we give it default 300sec as usual, also give the option to pass a timeout value
"""
timeout = reset_timeout(dut)
reset_timeout(dut, timeout)
# No matter what we set in inventory file, we always set sup timeout to 900
# because most SUPs have 10+ dockers that need to come up
if dut.is_supervisor_node():
Expand Down
7 changes: 5 additions & 2 deletions tests/platform_tests/test_link_down.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def link_status_on_all_fanouts(fanouts_and_ports, up=True):
def check_interfaces_and_services_all_LCs(duthosts, conn_graph_facts, xcvr_skip_list):
for LC in duthosts.frontend_nodes:
check_interfaces_and_services(
LC, conn_graph_facts["device_conn"][LC.hostname], xcvr_skip_list)
LC, conn_graph_facts["device_conn"][LC.hostname], xcvr_skip_list, interfaces_wait_time=400)


def test_link_down_on_sup_reboot(duthosts, localhost, enum_supervisor_dut_hostname,
Expand Down Expand Up @@ -206,6 +206,7 @@ def test_link_status_on_host_reboot(duthosts, localhost, enum_rand_one_per_hwsku
conn_graph_facts,
fanouthosts, xcvr_skip_list):
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
wait_time = 300
set_max_to_reboot(duthost)
hostname = duthost.hostname

Expand Down Expand Up @@ -238,8 +239,10 @@ def test_link_status_on_host_reboot(duthosts, localhost, enum_rand_one_per_hwsku
assert rebooted, "Device {} did not reboot".format(hostname)

# After test, check all interfaces and services are up
if len(duthosts.nodes) > 1:
wait_time = 400
check_interfaces_and_services(
duthost, conn_graph_facts.get("device_conn", {}).get("hostname", {}), xcvr_skip_list)
duthost, conn_graph_facts.get("device_conn", {}).get("hostname", {}), xcvr_skip_list, interfaces_wait_time=wait_time)

# Also make sure fanout hosts' links are up
link_status_on_host(fanouts_and_ports)
Loading