kunit: tool: catch warnings generated by the kernel
PATCH 1/1 kunit: tool: catch warnings generated by the kernel
If the kunit being run generates a WARN for some reason kunit.py ignores it and declares the tested PASSED. This is very much not desirable, as tests that are hitting WARN's are probably actually failing.
Take the simple approach to reducing this by setting panic_on_warn when running the kernel. The kernel crashes and kunit.py shows the WARN and reports the test fails.
Signed-off-by Jason Gunthorpe <[email protected]>
--- tools/testing/kunit/kunit_kernel.py | 2 ++ 1 file changed, 2 insertions(+)
I saw there was an earlier series working to make tests that deliberately made WARNs not do that, so this would be consistent with that idea, tests should not make WARNs, and WARNs should not be ignored..
tools/testing/kunit/kunit_kernel.py +2 -0
@@ -342,6 +342,8 @@ class LinuxSourceTree: if filter_action: args.append('kunit.filter_action=' + filter_action) args.append('kunit.enable=1') + args.append('panic_on_warn=1') + args.append('panic=-1') process = self._ops.start(args, build_dir) assert process.stdout is not None # tell mypy it's set
base-commit: 2872987b1d009df556c0061ecdeede6a5f9bf42c
Signature · 1 line
2.46.2