summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2007-10-24 08:50:09 +0200
committerJim Meyering <meyering@redhat.com>2007-10-24 08:50:09 +0200
commitb924d0380eefddc4a6dd5b8521b91c3a4bc4527a (patch)
treeec3a803c9d55e2c5df4898238161dc0089897e34 /tests
parentdef157c9271c3fc601ec8fe7085fb63b25b3e26f (diff)
downloadcoreutils-b924d0380eefddc4a6dd5b8521b91c3a4bc4527a.tar.xz
Don't fail part 2 of tests/rm/unreadable when run as root.
* tests/rm/unreadable: With UID == 0, expect different results. Reported by Mike Frysinger.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rm/unreadable6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/rm/unreadable b/tests/rm/unreadable
index 2fbe0320d..4af8280de 100755
--- a/tests/rm/unreadable
+++ b/tests/rm/unreadable
@@ -38,6 +38,7 @@ use strict;
my $d = "dir-$$";
my $mkdir = {PRE => sub {mkdir $d,0100 or die "$d: $!\n"}};
my $prog = 'rm';
+my $uid = $<;
my @Tests =
(
@@ -47,8 +48,9 @@ my @Tests =
['unreadable-1', '-rf', $d, {EXIT => 0}, $mkdir],
['unreadable-2', '-rf', $d,
- {EXIT => 1},
- {ERR => "$prog: cannot remove \`$d': Permission denied\n"},
+ {EXIT => $uid == 0 ? 0 : 1},
+ {ERR => $uid == 0 ? ''
+ : "$prog: cannot remove \`$d': Permission denied\n"},
{PRE => sub { (mkdir $d,0700 and mkdir "$d/x",0700 and chmod 0100,$d)
or die "$d: $!\n"}} ],
);