]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: rm/fail-eperm: require-non-root in perl, not sh
authorJim Meyering <meyering@redhat.com>
Tue, 11 Dec 2007 14:06:29 +0000 (15:06 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 9 Feb 2008 09:30:34 +0000 (10:30 +0100)
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.

tests/rm/fail-eperm

index 7bc89da158c83eb2f5e079afd16320ca59426e47..5fa54b097b403946ba8f0d88032c4b0980461aa1 100755 (executable)
@@ -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.