summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-23 14:21:27 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-23 21:03:07 +0200
commit91f536dc42c667b908072ee064fd150826349ec6 (patch)
tree0f7a404735dcf6aa28b35bf991e50df4d6b6f18c
parent8cb89f7c4cb764a819410e05440cc9dcb9f8df1f (diff)
tests: Move root check to lib/drm_lib.sh
All tests want that anyway. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rwxr-xr-xtests/drm_lib.sh2
-rwxr-xr-xtests/test_rte_check2
-rwxr-xr-xtests/tools_test2
3 files changed, 2 insertions, 4 deletions
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 97f6f925..38befa88 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -34,6 +34,8 @@ if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
die "ERROR: other drm clients running"
fi
+whoami | grep -q root || ( echo ERROR: not running as root; exit 1 )
+
i915_sfs_path=
if [ -d /sys/class/drm ] ; then
sysfs_path=/sys/class/drm
diff --git a/tests/test_rte_check b/tests/test_rte_check
index 6389592d..eb12416a 100755
--- a/tests/test_rte_check
+++ b/tests/test_rte_check
@@ -1,7 +1,5 @@
#!/bin/bash
-whoami | grep root || ( echo ERROR: not running as root; exit 1 )
-
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
. $SOURCE_DIR/drm_lib.sh
diff --git a/tests/tools_test b/tests/tools_test
index 4c5577a7..8bda2638 100755
--- a/tests/tools_test
+++ b/tests/tools_test
@@ -2,8 +2,6 @@
# 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