[PATCH] kunit: tool: catch warnings generated by the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jgg@xxxxxxxxxx>
---
 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..

diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index 61931c4926fd66..7a4228568dd73c 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -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
-- 
2.46.2





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux