summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-07-27 14:03:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-27 23:29:14 +0100
commit7f9b42a90f1653ded23115b1119df94f9ebd3d2a (patch)
treefb131d132957f956ed5019f8ae9d0314d525a8eb /meta/lib/oeqa/utils/qemurunner.py
parent4855ec380fb210d9c13f5caa8fc539e1664b9253 (diff)
downloadpoky-7f9b42a90f1653ded23115b1119df94f9ebd3d2a.tar.gz
oeqa/utils/qemurunner: avoid blocking on stty when running under oe-selftest
runqemu-internal runs stty to return the terminal to its previous state in case QEMU hasn't done that properly (which it at least used to do when it crashed). For some reason I have yet to determine, stty blocks (on tcsetattr() according to gdb) when run within QemuRunner() under oe-selftest, with the result that we always wait until the timeout and then we kill the script, which adds an extra delay after QEMU is stopped. Naturally you would assume that this is something to do with the nature of the terminal under which it is being run; however no amount of playing around with stdin/stdout/stderr seemed to fix the issue, apart from passing in subprocess.PIPE as stdin which makes stty error out with "stty: standard input: Inappropriate ioctl for device". I was also unable to come up with a reliable test for the terminal which we could use inside runqemu-internal to avoid calling stty. For now, go with the stdin=subprocess.PIPE workaround to at least avoid the delay with minimal ill effect. (From OE-Core rev: a058d07cd7251749fa9c1c8eca3caa80144664fe) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 4de3c64d7d..11186d6b26 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -94,7 +94,11 @@ class QemuRunner:
94 self.qemuparams = self.qemuparams[:-1] + " " + qemuparams + " " + '\"' 94 self.qemuparams = self.qemuparams[:-1] + " " + qemuparams + " " + '\"'
95 95
96 launch_cmd = 'runqemu %s %s %s' % (self.machine, self.rootfs, self.qemuparams) 96 launch_cmd = 'runqemu %s %s %s' % (self.machine, self.rootfs, self.qemuparams)
97 self.runqemu = subprocess.Popen(launch_cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,preexec_fn=os.setpgrp) 97 # FIXME: We pass in stdin=subprocess.PIPE here to work around stty
98 # blocking at the end of the runqemu script when using this within
99 # oe-selftest (this makes stty error out immediately). There ought
100 # to be a proper fix but this will suffice for now.
101 self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, preexec_fn=os.setpgrp)
98 102
99 logger.info("runqemu started, pid is %s" % self.runqemu.pid) 103 logger.info("runqemu started, pid is %s" % self.runqemu.pid)
100 logger.info("waiting at most %s seconds for qemu pid" % self.runqemutime) 104 logger.info("waiting at most %s seconds for qemu pid" % self.runqemutime)