Bug 207923 - kunit_tool should print an error if UML doesn't start
Summary: kunit_tool should print an error if UML doesn't start
Status: RESOLVED CODE_FIX
Alias: None
Product: Tools
Classification: Unclassified
Component: KUnit (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Tools/KUnit virtual default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-27 23:18 UTC by David Gow
Modified: 2021-08-07 04:16 UTC (History)
0 users

See Also:
Kernel Version: 5.6.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Gow 2020-05-27 23:18:38 UTC
At present, kunit_tool simply reports "0 tests run" if UML fails to start, which can be misleading.

It'd be nice if a "Couldn't start kernel", or even a "No KUnit output detected" or similar message could be displayed if the kernel is never able to get to the point of running KUnit tests. "0 tests run" should ideally only show up if an explicit test plan with only 0 tests is present in the log.

See, as an example of where this was confusing: https://lore.kernel.org/linux-kselftest/ef994ce9-ccd8-e9c9-9838-049a62a3a561@intel.com/
Comment 1 David Gow 2021-06-16 02:55:16 UTC
This currently reports no tests having been run as an error:

[19:13:18] Starting KUnit Kernel ...
[ERROR] no tests run!
[19:13:18] ============================================================
[19:13:18] Testing complete. 0 tests run. 0 failed. 0 crashed.
[19:13:18] Elapsed time: 0.000s

And Python errors are generated instead for cases where the UML kernel cannot start at all, e.g.:
[Stacktrace elided]
FileNotFoundError: [Errno 2] No such file or directory: '.kunit/linux' 

If there are zero tests configured, we report:

[ERROR] could not parse test results!

The raw TAP output in this case is:
TAP version 14
1..0

It seems to me like these two error messages should really be the other way around, but this is otherwise _mostly_ fixed.
Comment 2 David Gow 2021-06-29 22:58:27 UTC
The error messages will be the right way around once this patch is accepted:
https://lore.kernel.org/linux-kselftest/20210629223541.1512296-1-rmoar@google.com/

Note You need to log in before you can comment on or make changes to this bug.