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]>
---
These two patches have been sitting in my branch for a few weeks now,
trying to address a test timeout bug entry [1].

[1]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15999
---
Changes in v2:
- Fixing the kernel log patch, so the failure message is printed last.
- v1 of the test timeout patch was merged, so this series is down to
  only 1 patch.
- Link to v1: 
https://lore.kernel.org/r/[email protected]
---
 meta/classes-recipe/testimage.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes-recipe/testimage.bbclass 
b/meta/classes-recipe/testimage.bbclass
index 844c0f19ad02..b8685bc2b136 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):

---
base-commit: 235e6d49e5888ad04416219e10b6df91a738661a
change-id: 20251229-mathieu-oeqa-15999-fixes-885a5d52fa88

Best regards,
-- 
Mathieu Dubois-Briand <[email protected]>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#229073): 
https://lists.openembedded.org/g/openembedded-core/message/229073
Mute This Topic: https://lists.openembedded.org/mt/117152177/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to