| Summary: | qemurunner.run_serial() might report a false failure when command generate kernel log | ||
|---|---|---|---|
| Product: | [QA/Testing] Functional (self) Testing | Reporter: | Yoann Congal <yoann.congal> |
| Component: | oe-selftest | Assignee: | Yoann Congal <yoann.congal> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | Harish.Sadineni, randy.macleod, ross.burton |
| Version: | unspecified | ||
| Target Milestone: | 6.1 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
Only seen on arm host and qemuarm64 emulator. Ross mentioned that LabGrid had the same problem and they have a fix/work-around. https://github.com/labgrid-project/labgrid/blob/master/labgrid/driver/shelldriver.py has the labgrid code where they generate a marker (taking care not to accidentally generate something like "ERROR") and use that to mark up where the exit code is. Josh mentioned that labgrid also turns off kernel console messages when it connects, so we should likely do both. Patch sent: [PATCH] qemurunner: Hide kernel messages on first non-raw run_serial() call https://lists.openembedded.org/g/openembedded-core/message/233091 Merged: qemurunner: Hide kernel messages on first non-raw run_serial() call - openembedded-core - OpenEmbedded Core layer https://git.openembedded.org/openembedded-core/commit/?id=2dc4d2f8b5c7a6e87291385fb860436593767199&h=master |
While developing rust support for linux, I wrote a test containing status, _ = qemu.run_serial("modprobe rust_out_of_tree") self.assertEqual(status, 1, "Loading rust_out_of_tree module failed!") these lines did fail intermittently. With Harish Sadineni added logs[0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3432/steps/15/logs/stdio (qemu) Waiting at most 1000 seconds for login banner (03/02/26 10:29:57) Connection from 127.0.0.1:35160 Reached login banner in 2.84 seconds (03/02/26 10:30:00) Logged in as root in serial console 2026-03-02 10:30:03,561 - oe-selftest - INFO - modprobe rust_minimal -> status=0, output= [ 5.910903] rust_minimal: Rust minimal sample (init) 0[ 5.911126] rust_minimal: Am I built-in? false 2026-03-02 10:30:09,346 - oe-selftest - INFO - 11: 13/57 301/670 (521.04s) (0 failed) (runtime_test.RustKernel.test_kernel_rust_sample) 2026-03-02 10:30:09,346 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last): File "/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/runtime_test.py", line 528, in test_kernel_rust_sample self.assertEqual(status, 1, "Loading rust_minimal module failed!") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/unittest/case.py", line 907, in assertEqual assertion_func(first, second, msg=msg) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/unittest/case.py", line 900, in _baseAssertEqual raise self.failureException(msg) AssertionError: 0 != 1 : Loading rust_minimal module failed! run_serial code is here: https://git.openembedded.org/openembedded-core/tree/meta/lib/oeqa/utils/qemurunner.py#n661: It runs "$command; echo $?" and read the last line to get the command exit code. I wonder if the kernel printing on the console prevents run_serial to correctly read the command exit code... Maybe removing all console printing after banner (with the kernel.printk sysctl maybe) is a good idea? Also, this intermittent error only happened on arm host and qemuarm64 machine, so maybe it's KVM timing related or/and qemuarm64 serial console configuration related... [0]: https://lore.kernel.org/openembedded-core/56f69f79-77b8-4bdc-8401-f51d3e7d3bed@windriver.com/T/#u