]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/utils/commands: Add extra qemu failure logging
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 27 Nov 2018 23:38:44 +0000 (23:38 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 1 Dec 2018 11:36:29 +0000 (11:36 +0000)
Rather than just referring the user to the logs containing the failure, print
them on the console. This aids debugging with oe-selftest with parallelisation
as the logs may otherwise be lost.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/commands.py

index 01add686897c3e8f16aa392cd6426fd3eab4095b..e6a35d3d259f24049e7d0be8193da2c8487e0a47 100644 (file)
@@ -336,7 +336,11 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
         try:
             qemu.start(params=qemuparams, ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd, discard_writes=discard_writes)
         except bb.build.FuncFailed:
-            raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
+            msg = 'Failed to start QEMU - see the logs in %s' % logdir
+            if os.path.exists(qemu.qemurunnerlog):
+                with open(qemu.qemurunnerlog, 'r') as f:
+                    msg = msg + "Qemurunner log output from %s:\n%s" % (qemu.qemurunnerlog, f.read())
+            raise Exception(msg)
 
         yield qemu