From a628d564709aec0dda98ae71c24bff7cfe9268c0 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 May 2012 11:02:09 +0200 Subject: tests: add module reload testcase We've broken this way too often in the past. --- tests/Makefile.am | 1 + tests/module_reload | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 tests/module_reload diff --git a/tests/Makefile.am b/tests/Makefile.am index 18caf78..c7f4f73 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 0000000..06f3674 --- /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" -- cgit v1.2.3