[Intel-gfx] [PATCH 1/2] tests: Move root check to lib/drm_lib.sh
Daniel Vetter
daniel.vetter at ffwll.ch
Wed Jul 23 14:37:30 CEST 2014
All tests want that anyway.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
tests/drm_lib.sh | 2 ++
tests/test_rte_check | 2 --
tests/tools_test | 2 --
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 97f6f9253072..38befa88acb8 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 6389592dba9e..eb12416af6be 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 4c5577a787a9..8bda2638564f 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
--
2.0.1
More information about the Intel-gfx
mailing list