tests/periph_wdt: wait for prompt

This commit is contained in:
Francisco Molina 2020-02-07 15:46:19 +01:00
parent 2e542a2488
commit dd4f6600b8
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8

View File

@ -37,6 +37,7 @@ def get_reset_time(child):
def testfunc(child):
child.expect_exact(">")
child.sendline("range")
child.expect(r"lower_bound: (\d+) upper_bound: (\d+)\s*\r\n",
timeout=1)
@ -44,10 +45,12 @@ def testfunc(child):
wdt_upper_bound = int(child.match.group(2))
for rst_time in reset_times_ms:
child.expect_exact(">")
child.sendline("setup 0 {}".format(rst_time))
if rst_time < wdt_lower_bound or rst_time > wdt_upper_bound:
child.expect_exact("invalid time, see \"range\"", timeout=1)
else:
child.expect_exact(">")
child.sendline("startloop")
child.expect(r"start time: (\d+) us", timeout=1)
start_time_us = int(child.match.group(1))