[igt-dev] [PATCH i-g-t] igt/drv_module_reload: Don't reload on exit

Chris Wilson chris at chris-wilson.co.uk
Fri Jul 27 08:06:57 UTC 2018


The next test will happily load whatever module it requires.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/drv_module_reload.c | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/tests/drv_module_reload.c b/tests/drv_module_reload.c
index 34f55eab1..4c06e4caf 100644
--- a/tests/drv_module_reload.c
+++ b/tests/drv_module_reload.c
@@ -340,21 +340,21 @@ hda_dynamic_debug(bool enable)
 
 igt_main
 {
-	int err;
-
-	igt_fixture
+	igt_subtest("basic-reload") {
 		hda_dynamic_debug(true);
 
-	igt_subtest("basic-reload") {
-		if ((err = reload(NULL)))
-			igt_fail(err);
+		igt_assert_eq(reload(NULL), 0);
 
 		gem_sanitycheck();
 		gem_exec_store();
+
+		hda_dynamic_debug(false);
 	}
 
-	igt_subtest("basic-no-display")
+	igt_subtest("basic-no-display") {
 		igt_assert_eq(reload("disable_display=1"), 0);
+		igt_i915_driver_unload();
+	}
 
 	igt_subtest("basic-reload-inject") {
 		int i = 0;
@@ -367,13 +367,4 @@ igt_main
 		/* We expect to hit at least one fault! */
 		igt_assert(i > 1);
 	}
-
-	igt_fixture {
-		if ((err = reload(NULL)))
-			igt_fail(err);
-
-		gem_sanitycheck();
-		gem_exec_store();
-		hda_dynamic_debug(false);
-	}
 }
-- 
2.18.0



More information about the igt-dev mailing list