[PATCH i-g-t v4 5/8] lib/kunit: Report early kernel taints explicitly

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Tue Feb 6 10:00:29 UTC 2024


When we find the kernel tainted after loading a KUnit test module in
list only mode, report that taint immediately as the reason for skip
instead of executing and blaming our KTAP parser.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 lib/igt_kmod.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 5931121944..578c8a0909 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -1160,6 +1160,7 @@ static bool kunit_get_tests(struct igt_list_head *tests,
 	char *suite_name = NULL, *case_name = NULL;
 	struct igt_ktap_result *r, *rn;
 	struct igt_ktap_results *ktap;
+	unsigned long taints;
 	int flags, err;
 
 	igt_skip_on_f(tst->kmsg < 0, "Could not open /dev/kmsg\n");
@@ -1182,6 +1183,7 @@ static bool kunit_get_tests(struct igt_list_head *tests,
 		return false;
 
 	igt_skip_on(modprobe(tst->kmod, opts));
+	igt_skip_on(igt_kernel_tainted(&taints));
 
 	ktap = igt_ktap_alloc(tests);
 	igt_require(ktap);
-- 
2.43.0



More information about the igt-dev mailing list