[oe-commits] [openembedded-core] 18/18: selftest/runqemu: Handle SystemExit
git at git.openembedded.org
git at git.openembedded.org
Mon Oct 8 15:12:18 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 21b08611d881b6d663e5de5a5911b1a4cf37b8c2
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Oct 5 19:30:08 2018 +0100
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 at linuxfoundation.org>
---
meta/lib/oeqa/selftest/cases/runqemu.py | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index e57f503..9550ca0 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)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list