summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-07-27 09:02:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-07-27 17:08:54 +0100
commitf1c868dae24056ebc27e4f3c197724ce9b956a8a (patch)
tree2ee21aa8332e43e32054d1ae88d2f14e51ac136f /tests
parenta21999477545c2aed1e6a80dc93f87368614c7e5 (diff)
igt/drv_module_reload: Don't reload on exit
The next test will happily load whatever module it requires. v2: Unload at start, mandate tests cleanup after themselves. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/drv_module_reload.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/tests/drv_module_reload.c b/tests/drv_module_reload.c
index 34f55eab..cf4aea80 100644
--- a/tests/drv_module_reload.c
+++ b/tests/drv_module_reload.c
@@ -220,20 +220,6 @@ static void store_all(int fd)
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
-static int
-reload(const char *opts_i915)
-{
- int err = IGT_EXIT_SUCCESS;
-
- if ((err = igt_i915_driver_unload()))
- return err;
-
- if ((err = igt_i915_driver_load(opts_i915)))
- return err;
-
- return err;
-}
-
static int open_parameters(const char *module_name)
{
char path[256];
@@ -340,21 +326,30 @@ hda_dynamic_debug(bool enable)
igt_main
{
- int err;
+ igt_subtest("basic-reload") {
+ int load_error;
+
+ igt_i915_driver_unload();
- igt_fixture
hda_dynamic_debug(true);
+ load_error = igt_i915_driver_load(NULL);
+ hda_dynamic_debug(false);
- igt_subtest("basic-reload") {
- if ((err = reload(NULL)))
- igt_fail(err);
+ igt_assert_eq(load_error, 0);
gem_sanitycheck();
gem_exec_store();
+
+ /* only default modparams, can leave module loaded */
}
- igt_subtest("basic-no-display")
- igt_assert_eq(reload("disable_display=1"), 0);
+ igt_subtest("basic-no-display") {
+ igt_i915_driver_unload();
+
+ igt_assert_eq(igt_i915_driver_load("disable_display=1"), 0);
+
+ igt_i915_driver_unload();
+ }
igt_subtest("basic-reload-inject") {
int i = 0;
@@ -366,14 +361,9 @@ 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);
+ /* inject_fault() leaves the module unloaded */
}
+
+ /* Subtests should unload the module themselves if they use modparams */
}