]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
testimage: Print last lines of kernel log on test fail
authorMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Thu, 8 Jan 2026 13:54:04 +0000 (14:54 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 15 Jan 2026 22:46:04 +0000 (22:46 +0000)
Testimage test fails are often a consequence of issues inside of the
virtual machine, such as the OOM killer firing. Showing the last kernel
log lines on the main log output should help to debug these fails.

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/testimage.bbclass

index 844c0f19ad020e1807aae8bc525586e991f6f786..b8685bc2b1365e965ca9e12912892c0b3862529a 100644 (file)
@@ -412,6 +412,9 @@ def testimage_main(d):
     if not results or not complete:
         bb.error('%s - FAILED - tests were interrupted during execution, check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
     if results and not results.wasSuccessful():
+        with open(bootlog, 'r') as bootlogfile:
+            bootlines = "".join(bootlogfile.readlines()[-20:])
+        bb.plain('%s - FAILED - Last lines of QEMU boot log:\n%s' % (pn, bootlines))
         bb.error('%s - FAILED - also check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
 
 def get_runtime_paths(d):