summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <daniel.vetter@ffwll.ch>2012-05-25 11:02:09 +0200
committerroot <daniel.vetter@ffwll.ch>2012-05-25 11:02:09 +0200
commita628d564709aec0dda98ae71c24bff7cfe9268c0 (patch)
tree473af74eb2b5652de7ea18ee3884e049b89e3633
parent2448a75ff6127a03404e659a5e1046236eef41d4 (diff)
tests: add module reload testcase
We've broken this way too often in the past.
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/module_reload37
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 18caf78e..c7f4f736 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -71,6 +71,7 @@ TESTS_scripts = \
debugfs_reader \
debugfs_emon_crash \
sysfs_edid_timing \
+ module_reload \
ZZ_check_dmesg \
ZZ_hangman \
$(NULL)
diff --git a/tests/module_reload b/tests/module_reload
new file mode 100755
index 00000000..06f36746
--- /dev/null
+++ b/tests/module_reload
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Testcase: Reload the drm module
+#
+# ... we've broken this way too often :(
+#
+
+SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
+. $SOURCE_DIR/drm_lib.sh
+
+# no other drm service should be running, so we can just unbind
+
+# vtcon0 is vga, vtcon1 fbcon and let's pray that won't change due to boot load
+# time changes
+echo 0 > /sys/class/vtconsole/vtcon1/bind || echo "no kms unload support" && exit 77
+
+#ignore errors in ips - gen5 only
+rmmod intel_ips &> /dev/null
+rmmod i915
+#ignore errors in intel-gtt, often built-in
+rmmod intel-gtt &> /dev/null
+rmmod drm_kms_helper
+rmmod drm
+
+if lsmod | grep i915 &> /dev/null ; then
+ echo WARNING: i915.ko still loaded!
+ exitcode=1
+else
+ echo module successfully unloaded
+ exitcode=0
+fi
+
+modprobe i915
+echo 1 > /sys/class/vtconsole/vtcon1/bind
+
+# try to run something
+$SOURCE_DIR/gem_exec_nop > /dev/null && echo "module successfully loaded again"