From 91f536dc42c667b908072ee064fd150826349ec6 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 23 Jul 2014 14:21:27 +0200 Subject: [PATCH] tests: Move root check to lib/drm_lib.sh All tests want that anyway. Signed-off-by: Daniel Vetter --- 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 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