summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-12-08 22:48:30 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-12-11 09:21:52 +0000
commit3a9999573ecc07703fb51d1342e8415ff455c69b (patch)
tree42a5b78a7234a5d12114a40540b3345ba0c6a3ff /tests
parentf7ac0ea5b79f07a70c39eb5a8e3974ce32625917 (diff)
igt/drv_module_reload: Keep injecting load failures until it passes
Keep reloading the module with the next load failure until we run out of injection sites and the module loads successfully. Or it goes boom. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/drv_module_reload.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/drv_module_reload.c b/tests/drv_module_reload.c
index e812e5ec..3046d822 100644
--- a/tests/drv_module_reload.c
+++ b/tests/drv_module_reload.c
@@ -303,14 +303,12 @@ hda_dynamic_debug(bool enable)
igt_main
{
- int i, err;
- char buf[64];
+ int err;
igt_fixture
hda_dynamic_debug(true);
igt_subtest("basic-reload") {
-
if ((err = reload(NULL)))
igt_fail(err);
@@ -322,11 +320,12 @@ igt_main
igt_assert_eq(reload("disable_display=1"), 0);
igt_subtest("basic-reload-inject") {
- for (i = 0; i < 4; i++) {
- memset(buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf), "inject_load_failure=%d", i);
- reload(buf);
- }
+ char buf[64];
+ int i = 0;
+ do {
+ snprintf(buf, sizeof(buf),
+ "inject_load_failure=%d", ++i);
+ } while (reload(buf));
}
igt_fixture {