From 39137a5d05df940410261f4cad2e4a695faf0f7f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 8 Dec 2007 12:29:25 +0100 Subject: tests: Remove priv-check. Use new require_root_ function instead. * tests/priv-check: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove priv-check. * tests/test-lib.sh (require_root_): New function. Use this function rather than sourcing the priv-check file. * tests/sample-test: Use require_root_ rather than priv-check. * tests/chown/basic: Likewise. * tests/cp/cp-a-selinux: Likewise. * tests/cp/preserve-gid: Likewise. * tests/cp/special-bits: Likewise. * tests/ls/nameless-uid: Likewise. * tests/misc/chcon: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/rm/no-give-up: Likewise. * tests/rm/one-file-system: Likewise. * tests/tail-2/append-only: Likewise. * tests/touch/now-owned-by-other: Likewise. * tests/rm/fail-eperm: Use skip_if_root_ rather than priv-check. * Makefile.maint (sc_root_tests): Reflect this change: search for the new function name. --- tests/test-lib.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/test-lib.sh') diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 3b8d2ce98..b273f1a81 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -100,6 +100,7 @@ environment variable set to yes. E.g., fi } +require_root_() { uid_is_privileged_ || skip_test_ "must be run as root"; } skip_if_root_() { uid_is_privileged_ && skip_test_ "must be run as non-root"; } error_() { echo "$0: $@" 1>&2; (exit 1); exit 1; } framework_failure() { error_ 'failure in testing framework'; } -- cgit v1.2.3-54-g00ecf