tests: Move root check to lib/drm_lib.sh
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 23 Jul 2014 12:21:27 +0000 (14:21 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 23 Jul 2014 19:03:07 +0000 (21:03 +0200)
All tests want that anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/drm_lib.sh
tests/test_rte_check
tests/tools_test

index 97f6f92..38befa8 100755 (executable)
@@ -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
index 6389592..eb12416 100755 (executable)
@@ -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
 
index 4c5577a..8bda263 100755 (executable)
@@ -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