Skip to content

Commit fea3c44

Browse files
mbriandrpurdie
authored andcommitted
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 <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent da4ac27 commit fea3c44

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

meta/classes-recipe/testimage.bbclass

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ def testimage_main(d):
412412
if not results or not complete:
413413
bb.error('%s - FAILED - tests were interrupted during execution, check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
414414
if results and not results.wasSuccessful():
415+
with open(bootlog, 'r') as bootlogfile:
416+
bootlines = "".join(bootlogfile.readlines()[-20:])
417+
bb.plain('%s - FAILED - Last lines of QEMU boot log:\n%s' % (pn, bootlines))
415418
bb.error('%s - FAILED - also check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
416419

417420
def get_runtime_paths(d):

0 commit comments

Comments
 (0)