Skip to content
Snippets Groups Projects
Commit 10d42083 authored by Janusz Krzysztofik's avatar Janusz Krzysztofik
Browse files

lib/kunit: Fail / skip on kernel taint


Similar to how igt_kselftest() handles kernel taints, fail current dynamic
sub-subtest and skip remaining ones when a kernel taint is detected during
execution of kunit test cases.

Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 94dbcc8b
No related branches found
No related tags found
Loading
......@@ -761,6 +761,7 @@ static void __igt_kunit(struct igt_ktest *tst, const char *opts)
bool is_builtin;
struct ktap_test_results *results;
struct ktap_test_results_element *temp;
unsigned long taints;
int flags, ret;
igt_skip_on_f(tst->kmsg < 0, "Could not open /dev/kmsg\n");
......@@ -785,12 +786,20 @@ static void __igt_kunit(struct igt_ktest *tst, const char *opts)
while (READ_ONCE(results->still_running) || READ_ONCE(results->head) != NULL)
{
if (igt_kernel_tainted(&taints)) {
ktap_parser_cancel();
break;
}
if (READ_ONCE(results->head) != NULL) {
pthread_mutex_lock(&results->mutex);
igt_dynamic(results->head->test_name)
igt_dynamic(results->head->test_name) {
igt_assert(READ_ONCE(results->head->passed));
igt_fail_on(igt_kernel_tainted(&taints));
}
temp = results->head;
results->head = results->head->next;
free(temp);
......@@ -801,6 +810,7 @@ static void __igt_kunit(struct igt_ktest *tst, const char *opts)
ret = ktap_parser_stop();
igt_skip_on(igt_kernel_tainted(&taints));
igt_skip_on_f(ret, "KTAP parser failed\n");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment