[Intel-gfx] [PATCH 2/2] tests: wedged + error_state read test

Ben Widawsky ben at bwidawsk.net
Wed Apr 4 08:02:59 CEST 2012


A bit quirky because wedged doesn't like being written to by normal users

Signed-off-by: Ben Widawsky <benjamin.widawsky at intel.com>
---
 tests/Makefile.am          |    3 ++-
 tests/ZZ_check_error_state |    9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100755 tests/ZZ_check_error_state

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6544ec7..4cb1093 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -65,6 +65,7 @@ TESTS_scripts = \
 	debugfs_emon_crash \
 	sysfs_edid_timing \
 	ZZ_check_dmesg \
+	ZZ_check_error_state \
 	$(NULL)
 
 kernel_tests = \
@@ -88,7 +89,7 @@ HANG = \
 	$(NULL)
 
 EXTRA_PROGRAMS = $(TESTS_progs) $(HANG)
-EXTRA_DIST = $(TESTS_scripts) check_drm_clients
+EXTRA_DIST = $(TESTS_scripts) drm_lib.sh check_drm_clients
 CLEANFILES = $(EXTRA_PROGRAMS)
 
 AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \
diff --git a/tests/ZZ_check_error_state b/tests/ZZ_check_error_state
new file mode 100755
index 0000000..48992ed
--- /dev/null
+++ b/tests/ZZ_check_error_state
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. ./drm_lib.sh
+
+# To run this from make test we have to use sudo. That is unfortunate
+#[[ `id -u` -eq "0" ]] || die "You must be root"
+#[[ `echo 1 > ${i915_path}/i915_wedged` ]] || die "Couldn't write to ${i915_path}/i915_wedged"
+[[ `echo 1 | sudo tee ${i915_path}/i915_wedged` ]] || die "Couldn't write to ${i915_path}/i915_wedged"
+cat $i915_path/i915_error_state > /dev/null 2>&1
-- 
1.7.9.5




More information about the Intel-gfx mailing list