Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] testing/infra/emulator: allow to specify pexpect timeout
@ 2017-07-04 18:58 Andrey Smirnov
  2017-07-04 18:58 ` [Buildroot] [PATCH 2/3] testing/tests/package/test_python: refactor to support better code reuse Andrey Smirnov
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Andrey Smirnov @ 2017-07-04 18:58 UTC (permalink / raw)
  To: buildroot

Some commands take more than 5 seconds to complete under QEMU, so add
provisions to allow individual unit-test to specify different duration
to avoid false negative test failures.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 support/testing/infra/emulator.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py
index a39d59b..4e988a4 100644
--- a/support/testing/infra/emulator.py
+++ b/support/testing/infra/emulator.py
@@ -26,7 +26,10 @@ class Emulator(object):
     #
     # options: array of command line options to pass to Qemu
     #
-    def boot(self, arch, kernel=None, kernel_cmdline=None, options=None):
+    # timeout: timeout to wait for when excuting commands
+    #
+    def boot(self, arch, kernel=None, kernel_cmdline=None,
+             options=None, timeout=5):
         if arch in ["armv7", "armv5"]:
             qemu_arch = "arm"
         else:
@@ -65,7 +68,7 @@ class Emulator(object):
             qemu_cmd += ["-append", " ".join(kernel_cmdline)]
 
         self.logfile.write("> starting qemu with '%s'\n" % " ".join(qemu_cmd))
-        self.qemu = pexpect.spawn(qemu_cmd[0], qemu_cmd[1:], timeout=5)
+        self.qemu = pexpect.spawn(qemu_cmd[0], qemu_cmd[1:], timeout=timeout)
         # We want only stdout into the log to avoid double echo
         self.qemu.logfile_read = self.logfile
 
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-07-06  7:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-04 18:58 [Buildroot] [PATCH 1/3] testing/infra/emulator: allow to specify pexpect timeout Andrey Smirnov
2017-07-04 18:58 ` [Buildroot] [PATCH 2/3] testing/tests/package/test_python: refactor to support better code reuse Andrey Smirnov
2017-07-05 10:59   ` Thomas Petazzoni
2017-07-05 21:30     ` Andrey Smirnov
2017-07-05 22:09       ` Arnout Vandecappelle
2017-07-06  7:08         ` Thomas Petazzoni
2017-07-04 18:58 ` [Buildroot] [PATCH 3/3] testing/tests/package: add basic unit test for IPython Andrey Smirnov
2017-07-06  1:29   ` Ricardo Martincoski
2017-07-05 10:57 ` [Buildroot] [PATCH 1/3] testing/infra/emulator: allow to specify pexpect timeout Thomas Petazzoni
2017-07-05 21:27   ` Andrey Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox