Skip to content

Commit

Permalink
[test_reboot]Wait a few seconds before checking the reboot-cause (son…
Browse files Browse the repository at this point in the history
…ic-net#1367)

In the reboot cause test it is assumed that the reboot-cause is available as soon as the critical services ready. However, PR Delay process-reboot-cause service until network connection is stable sonic-net#4003 introduces an extra amount of seconds and fails the assumption.
  • Loading branch information
stephenxs authored and Stephen Sun committed Feb 13, 2020
1 parent 1772d78 commit f4c9b45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/platform/test_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def check_reboot_cause(dut, reboot_cause_expected):
reboot_cause_got = output["stdout"]
logging.debug("show reboot-cause returns {}".format(reboot_cause_got))
m = re.search(reboot_cause_expected, reboot_cause_got)
assert m is not None, "got reboot-cause %s after rebooted by %s" % (reboot_cause_got, reboot_cause_expected)
return m is not None


def reboot_and_check(localhost, dut, interfaces, reboot_type=REBOOT_TYPE_COLD, reboot_helper=None, reboot_kwargs=None):
Expand Down Expand Up @@ -139,7 +139,8 @@ def reboot_and_check(localhost, dut, interfaces, reboot_type=REBOOT_TYPE_COLD, r
check_critical_services(dut)

logging.info("Check reboot cause")
check_reboot_cause(dut, reboot_cause)
assert wait_until(120, 20, check_reboot_cause, dut, reboot_cause), \
"got reboot-cause failed after rebooted by %s" % reboot_cause

if reboot_ctrl_dict[reboot_type]["test_reboot_cause_only"]:
logging.info("Further checking skipped for %s test which intends to verify reboot-cause only".format(reboot_type))
Expand Down

0 comments on commit f4c9b45

Please sign in to comment.