Skip to contentSkip to conversation

tests: Basic tools tester

PATCH In review Ben Widawsky 2 participants 2 messages Jul 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: Basic tools tester

---
 tests/Makefile.am |  1 +
 tests/drm_lib.sh  |  4 ++++
 tests/tools_test  | 20 ++++++++++++++++++++
 3 files changed, 25 insertions(+)
 create mode 100755 tests/tools_test
tests/Makefile.am +1 -0
index a422899..ccc97b8 100644
@@ -115,6 +115,7 @@ TESTS_scripts_M = \
 
 TESTS_scripts = \
 	test_rte_check \
+	tools_test \
 	debugfs_reader \
 	debugfs_emon_crash \
 	sysfs_l3_parity \
tests/drm_lib.sh +4 -0
index 5ca815b..5975b58 100755
@@ -4,6 +4,10 @@ die() {
 	exit 1
 }
 
+do_or_die() {
+	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1)
+}
+
 if [ -d /debug/dri ] ; then
 	debugfs_path=/debug/dri
 fi
tests/tools_test new file +20 -0
new file mode 100755
index 0000000..bca726c
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Test some of the most critical tools we have accidentally broken before.
+# TODO: Possibly make tests parse output
+
+whoami | grep -q root || ( echo ERROR: not running as root; exit 1 )
+
+SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
+. $SOURCE_DIR/drm_lib.sh
+
+# ARB_MODE has existed for many gens
+do_or_die "$SOURCE_DIR/../tools/intel_reg_read 0x4030"
+# ARB_MODE should have mask bits, so it should be safe to write
+do_or_die "$SOURCE_DIR/../tools/intel_reg_write 0x4030 0"
+
+do_or_die "$SOURCE_DIR/../tools/intel_reg_dumper"
+
+# TODO: Add more tests
+
+exit 0
+
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 45 lines · Ben Widawsky
---
 tests/Makefile.am |  1 +
 tests/drm_lib.sh  |  4 ++++
 tests/tools_test  | 20 ++++++++++++++++++++
 3 files changed, 25 insertions(+)
 create mode 100755 tests/tools_test
tests/Makefile.am +1 -0
index a422899..ccc97b8 100644
@@ -115,6 +115,7 @@ TESTS_scripts_M = \
 
 TESTS_scripts = \
 	test_rte_check \
+	tools_test \
 	debugfs_reader \
 	debugfs_emon_crash \
 	sysfs_l3_parity \
tests/drm_lib.sh +4 -0
index 5ca815b..5975b58 100755
@@ -4,6 +4,10 @@ die() {
 	exit 1
 }
 
+do_or_die() {
+	$@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1)
+}
+
 if [ -d /debug/dri ] ; then
 	debugfs_path=/debug/dri
 fi
tests/tools_test new file +3 -0
new file mode 100755
index 0000000..bca726c
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Test some of the most critical tools we have accidentally broken before.
+# TODO: Possibly make tests parse output

tests/tools_test line 13

Quoted 10 lines
tests/tools_test new file +10 -0
+
+whoami | grep -q root || ( echo ERROR: not running as root; exit 1 )
+
+SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
+. $SOURCE_DIR/drm_lib.sh
+
+# ARB_MODE has existed for many gens
+do_or_die "$SOURCE_DIR/../tools/intel_reg_read 0x4030"
+# ARB_MODE should have mask bits, so it should be safe to write
+do_or_die "$SOURCE_DIR/../tools/intel_reg_write 0x4030 0"

As discussed on irc there doesn't seem to be a safe register & value to test intel_reg_write accross all platforms. I'd vote to just remove it, we can solve that little issue once it breaks for real.

Otherwise lgtm, thanks for doing this, pls push.
-Daniel

Quoted 14 lines
tests/tools_test new file +7 -0
+
+do_or_die "$SOURCE_DIR/../tools/intel_reg_dumper"
+
+# TODO: Add more tests
+
+exit 0
+
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch