aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-05 19:30:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-09 12:02:41 +0100
commit417245923c1c2c35a60d6db29cbe5a78548860d2 (patch)
treea5be81c25aa9bb5f7e45a9b03f7daedf22bc2ceb
parent1b63ce7bb83134f84bf07d1075d5ca0d5466ed3d (diff)
downloadopenembedded-core-contrib-417245923c1c2c35a60d6db29cbe5a78548860d2.tar.gz
openembedded-core-contrib-417245923c1c2c35a60d6db29cbe5a78548860d2.tar.bz2
openembedded-core-contrib-417245923c1c2c35a60d6db29cbe5a78548860d2.zip
selftest/runqemu: Handle SystemExit
The sigchld handler in runqemu can raise a SystemExit when qemu shuts down. Rather than backtracing, accept this as a successful test result. ERROR: runqemu.QemuTest.test_qemu_can_shutdown (subunit.RemotedTestCase) testtools.testresult.real._StringException: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/runqemu.py", line 183, in test_qemu_can_shutdown qemu_shutdown_succeeded = self._start_qemu_shutdown_check_if_shutdown_succeeded(qemu, shutdown_timeout) File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/runqemu.py", line 175, in _start_qemu_shutdown_check_if_shutdown_succeeded time.sleep(1) File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/qemurunner.py", line 100, in handleSIGCHLD raise SystemExit SystemExit Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/runqemu.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index e57f503a577..edc2e424e6e 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -166,14 +166,17 @@ class QemuTest(OESelftestTestCase):
# when qemu was shutdown by the above shutdown command
qemu.runner.stop_thread()
time_track = 0
- while True:
- is_alive = qemu.check()
- if not is_alive:
- return True
- if time_track > timeout:
- return False
- time.sleep(1)
- time_track += 1
+ try:
+ while True:
+ is_alive = qemu.check()
+ if not is_alive:
+ return True
+ if time_track > timeout:
+ return False
+ time.sleep(1)
+ time_track += 1
+ except SystemExit:
+ return True
def test_qemu_can_shutdown(self):
self.assertExists(self.qemuboot_conf)