diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-05 19:30:08 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-09 19:04:02 +0100 |
commit | d1a3f5098bd6d5c50b421f8d4c183724a9a4ea6b (patch) | |
tree | 38b91c28d4aa8f721fbfe8b90f02b1fd38ef2bea | |
parent | b1b23359a3dcf9a958fff8413bae840e9348b446 (diff) | |
download | poky-d1a3f5098bd6d5c50b421f8d4c183724a9a4ea6b.tar.gz |
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
(From OE-Core rev: 417245923c1c2c35a60d6db29cbe5a78548860d2)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/runqemu.py | 19 |
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 e57f503a57..edc2e424e6 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py | |||
@@ -166,14 +166,17 @@ class QemuTest(OESelftestTestCase): | |||
166 | # when qemu was shutdown by the above shutdown command | 166 | # when qemu was shutdown by the above shutdown command |
167 | qemu.runner.stop_thread() | 167 | qemu.runner.stop_thread() |
168 | time_track = 0 | 168 | time_track = 0 |
169 | while True: | 169 | try: |
170 | is_alive = qemu.check() | 170 | while True: |
171 | if not is_alive: | 171 | is_alive = qemu.check() |
172 | return True | 172 | if not is_alive: |
173 | if time_track > timeout: | 173 | return True |
174 | return False | 174 | if time_track > timeout: |
175 | time.sleep(1) | 175 | return False |
176 | time_track += 1 | 176 | time.sleep(1) |
177 | time_track += 1 | ||
178 | except SystemExit: | ||
179 | return True | ||
177 | 180 | ||
178 | def test_qemu_can_shutdown(self): | 181 | def test_qemu_can_shutdown(self): |
179 | self.assertExists(self.qemuboot_conf) | 182 | self.assertExists(self.qemuboot_conf) |