summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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