[PATCH i-g-t 3/3] lib/kunit: Process module remove error after list errors

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Thu Jan 25 16:52:12 UTC 2024


Skip on any error from test case list gathering phase first, then, in
preparation for executing those test cases, from unloading the test module
loaded in list only mode, so it is more clear if listing the test cases
was successful or not.

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

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 01198e75dc..436aad58b3 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -1245,10 +1245,10 @@ static void kunit_get_tests(struct igt_list_head *tests,
 		free(case_name);
 	}
 
-	igt_skip_on(kmod_module_remove_module(tst->kmod, KMOD_REMOVE_FORCE));
-
 	igt_skip_on_f(err,
 		      "KTAP parser failed while getting a list of test cases\n");
+
+	igt_skip_on(kmod_module_remove_module(tst->kmod, KMOD_REMOVE_FORCE));
 }
 
 static void __igt_kunit(struct igt_ktest *tst,
-- 
2.43.0



More information about the Intel-xe mailing list