diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-07 10:38:53 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-08 13:59:02 +0000 |
commit | fec3b9c7d88357144f0d7a1447b9316a1c81da1a (patch) | |
tree | 09d6b905dce29e692286fd61f17588075a654b84 /lib/igt_kmod.c | |
parent | 532d6e84ab7fab9568dabc63a4620a257ea2fdff (diff) |
lib/kmod: Check for kernel taints before/after selftests
If the kernel generates a bad taint during the selftest (e.g. a
warning), declare the selftest to be a failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_kmod.c')
-rw-r--r-- | lib/igt_kmod.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c index ebeacd6f..2ae45a1a 100644 --- a/lib/igt_kmod.c +++ b/lib/igt_kmod.c @@ -29,6 +29,7 @@ #include "igt_core.h" #include "igt_kmod.h" #include "igt_sysfs.h" +#include "igt_taints.h" /** * SECTION:igt_kmod @@ -582,9 +583,12 @@ int igt_kselftest_execute(struct igt_kselftest *tst, const char *options, const char *result) { + unsigned long taints; char buf[1024]; int err; + igt_skip_on(igt_kernel_tainted(&taints)); + lseek(tst->kmsg, 0, SEEK_END); snprintf(buf, sizeof(buf), "%s=1 %s", tl->param, options ?: ""); @@ -607,6 +611,8 @@ int igt_kselftest_execute(struct igt_kselftest *tst, "kselftest \"%s %s\" failed: %s [%d]\n", tst->module_name, buf, strerror(-err), -err); + igt_assert_eq(igt_kernel_tainted(&taints), 0); + return err; } |