summaryrefslogtreecommitdiff
path: root/tests/intel-ci
diff options
context:
space:
mode:
authorJanusz Krzysztofik <janusz.krzysztofik@intel.com>2019-03-14 15:41:53 +0100
committerJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>2020-04-17 09:50:53 +0200
commit559cd8fd8146d8c2a6487d91dcd722f1c3ed1575 (patch)
treebccb11a9cf73bdd052813b4fb356099969113548 /tests/intel-ci
parent391929b7402fd0417dcb9026c202241413653942 (diff)
tests: Add a test for device hot unplug
There is a test which verifies unloading of i915 driver module but no test exists that checks how a driver behaves when it gets unbound from a device or when the device gets unplugged. Implement such test using sysfs interface. Two minimalistic subtests - "unbind-rebind" and "unplug-rescan" - perform the named operations on a DRM device which is believed to be not in use. Another pair of subtests named "hotunbind-lateclose" and hotunplug-lateclose" do the same on a DRM device while keeping its file descriptor open and close it thereafter. v2: Run a subprocess with dummy_load instead of external command (Antonio). v3: Run dummy_load from the test process directly (Antonio). v4: Run dummy_load from inside subtests (Antonio). v5: Try to restore the device to a working state after each subtest (Petri, Daniel). v6: Run workload inside an igt helper subprocess so resources consumed by the workload are cleaned up automatically on workload subprocess crash, without affecting test results, - move the igt helper with workload back from subtests to initial fixture so workload crash also does not affect test results, - other cleanups suggested by Katarzyna and Chris. v7: No changes. v8: Move workload functions back from fixture to subtests, - register different actions and different workloads in respective tables and iterate over those tables while enumerating subtests, - introduce new subtest flavors by simply omitting module unload step, - instead of simply requesting bus rescan or not, introduce action specific device recovery helpers, required specifically with those new subtests not touching the module, - split workload functions in two parts, one spawning the workload, the other waiting for its completion, - for the new subtests not requiring module unload, run workload functions directly from the test process and use new workload completion wait functions in place of subprocess completion wait, - take more control over logging, longjumps and exit codes in workload subprocesses, - add some debug messages for easy progress watching, - move function API descriptions on top of respective typedefs. v9: All changes after Daniel's comments - thanks! - flatten the code, don't try to create a midlayer (Daniel), - provide minimal subtests that even don't keep device open (Daniel), - don't use driver unbind in more advanced subtests (Daniel), - provide subtests with different level of resources allocated during device unplug (Daniel), - provide subtests which check driver behavior after device hot unplug (Daniel). v10 Rename variables and function arguments to something that indicates they're file descriptors (Daniel), - introduce a data structure that contains various file descriptors and a helper function to set them all (Daniel), - fix strange indentation (Daniel), - limit scope to first three subtests as the initial set of tests to merge (Daniel). v11 Fix typos in some comments, - use SPDX license identifier, - include a per-patch changelog in the commit message (Daniel). v12 We don't use SPDX license identifiers nor GPL-2.0 in IGT (Petri), - avoid chipset, make sure we reopen the same device (Chris), - rename subtest "drm_open-hotunplug" to "hotunplug-lateclose", - add subtest "hotunbind-lateclose" (less affected by IOMMU issues), - move some redundant code to helpers, - reorder some helpers, - reword some messages and comments, - clean up headers. v13 Add test / subtest descriptions (patchwork). v14 Extract redundant device rescan and reopen code to a 'healthcheck' helper, - call igt_abort_on_f() on device reopen failure (Petri), - if any timeout set with igt_set_timeout() inside a subtest expires, call igt_abort_on_f() from a follow-up igt_fixture (Petri), - when running on a i915 device, require GEM and call igt_abort_on_f() if no usable GEM is detected on device reopen. v15 Add the test to CI blacklist (Martin). v16 Separate blacklist entry with a descriptive comment (Petri). Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/intel-ci')
-rw-r--r--tests/intel-ci/blacklist.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/intel-ci/blacklist.txt b/tests/intel-ci/blacklist.txt
index ee7045f0..08333aff 100644
--- a/tests/intel-ci/blacklist.txt
+++ b/tests/intel-ci/blacklist.txt
@@ -117,3 +117,7 @@ igt@.*@.*pipe-f($|-.*)
# Since 5.7-rc1, this test has produced tens of megabytes of kernel
# logs.
igt@perf_pmu@cpu-hotplug
+
+# Currently fails and leaves the machine in a very bad state, and
+# causes coverage loss for other tests.
+igt@core_hotunplug@.*