From 98e17c2736d4c9b6e7f35cebf78db242631703a9 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 16 Oct 2019 08:20:41 +0200 Subject: [PATCH] tests/nordic_softdevice: cleanup test script and fix test Adding a 1s delay before sending ifconfig makes this test works reliably because it gives the softdevice enough time to get in a ready state. --- tests/nordic_softdevice/tests/01-run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/nordic_softdevice/tests/01-run.py b/tests/nordic_softdevice/tests/01-run.py index 7329c74091..f7159611a3 100755 --- a/tests/nordic_softdevice/tests/01-run.py +++ b/tests/nordic_softdevice/tests/01-run.py @@ -1,14 +1,17 @@ #!/usr/bin/env python3 import sys +import time from testrunner import run def testfunc(child): - child.expect("All up, running the shell now") + child.expect_exact("All up, running the shell now") + child.expect_exact(">") + time.sleep(1) # Wait 1s to let some time for the interface to be fully ready child.sendline("ifconfig") child.expect(r"Iface\s+(\d+)\s+HWaddr:") if __name__ == "__main__": - sys.exit(run(testfunc, timeout=1, echo=False)) + sys.exit(run(testfunc))