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

[test_reboot]Wait a few seconds before checking the reboot-cause #1367

Merged
merged 3 commits into from
Feb 9, 2020
Merged
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
5 changes: 3 additions & 2 deletions tests/platform/test_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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 @@ -132,7 +132,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