summaryrefslogtreecommitdiff
path: root/tests/rm/fail-eperm
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2007-12-11 15:06:29 +0100
committerJim Meyering <meyering@redhat.com>2008-02-09 10:30:34 +0100
commit64b39468b8a5f43e6beeffc6fb7369ef05c16f53 (patch)
tree158c6b016c701e503bf1cd8aeaa45a418f52eddb /tests/rm/fail-eperm
parent39137a5d05df940410261f4cad2e4a695faf0f7f (diff)
downloadcoreutils-64b39468b8a5f43e6beeffc6fb7369ef05c16f53.tar.xz
tests: rm/fail-eperm: require-non-root in perl, not sh
Since it creates no temporaries and since it requires non-root, do the require-non-root bit in perl, rather than using test-lib.sh.
Diffstat (limited to 'tests/rm/fail-eperm')
-rwxr-xr-xtests/rm/fail-eperm11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/rm/fail-eperm b/tests/rm/fail-eperm
index 7bc89da15..5fa54b097 100755
--- a/tests/rm/fail-eperm
+++ b/tests/rm/fail-eperm
@@ -27,12 +27,6 @@ fi
# searching below. root can simply create the required
# dir/files and run the test as someone else.
-. $srcdir/../test-lib.sh
-skip_if_root_
-
-: ${srcdir=.}
-. $srcdir/../require-perl
-
ARGV_0=$0
export ARGV_0
@@ -42,6 +36,11 @@ use strict;
(my $ME = $ENV{ARGV_0}) =~ s|.*/||;
+my $uid = $<;
+# skip if root
+$uid == 0
+ and (warn "$ME: can't run this test as root: skipping this test"), exit 77;
+
my $verbose = $ENV{VERBOSE} && $ENV{VERBOSE} eq 'yes';
# Ensure that the diagnostics are in English.