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

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Wed Jan 31 18:03:52 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>
---
 lib/igt_kmod.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 1d57ea708d..53c54b1a0d 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -1165,6 +1165,7 @@ static void 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");
@@ -1192,6 +1193,7 @@ static void kunit_get_tests(struct igt_list_head *tests,
 	}
 
 	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