From: Mathieu Dubois-Briand Date: Thu, 8 Jan 2026 13:54:04 +0000 (+0100) Subject: testimage: Print last lines of kernel log on test fail X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fea3c445a9ccb803468b83ea4e8fa92fe442b8e0;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git testimage: Print last lines of kernel log on test fail 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 Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass index 844c0f19ad..b8685bc2b1 100644 --- a/meta/classes-recipe/testimage.bbclass +++ b/meta/classes-recipe/testimage.bbclass @@ -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):