From 09892fb60a33d010fc56efad8cc7b3d88dd58581 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 16 May 2007 00:41:14 +0200 Subject: tests: code refactoring -- new ts_skip_nonroot function The patch moves "if $UID != 0" test to a new function. That's better than duplicate the code on many places. Signed-off-by: Karel Zak --- tests/functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/functions.sh') diff --git a/tests/functions.sh b/tests/functions.sh index c04022b3b..969592f7e 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -9,6 +9,12 @@ function ts_skip { exit 0 } +function ts_skip_nonroot { + if [ $UID != 0 ]; then + ts_skip "not root permissions" + fi +} + function ts_failed { if [ x"$1" == x"" ]; then echo " FAILED ($TS_NAME)" -- cgit v1.2.3-55-g7522