From: Bob Proulx Date: Mon, 25 Feb 2008 19:38:23 +0000 (+0100) Subject: Fix test failure where rm would appear to succeed incorrectly. X-Git-Tag: v6.11~117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcdf32c1594cd0f9f525f39fb5340130877ba14d;p=thirdparty%2Fcoreutils.git Fix test failure where rm would appear to succeed incorrectly. * tests/rm/fail-eperm: Ignore files that were opportunistically chosen to test permission failures but disappear before we can finish the test. --- diff --git a/tests/rm/fail-eperm b/tests/rm/fail-eperm index 5fa54b097b..e9e2108ec8 100755 --- a/tests/rm/fail-eperm +++ b/tests/rm/fail-eperm @@ -96,6 +96,17 @@ foreach my $dir (@dir_list) close RM; my $rc = $?; + # This test opportunistically looks for files that can't + # be removed but those files may already have been removed + # by their owners by the time we get to them. It is a + # race condition. If so then the rm is successful and our + # test is thwarted. Detect this case and ignore. + if ($rc == 0) + { + next if ! -e $target_file; + die "$ME: unexpected exit status from `$cmd';\n" + . " got 0, expected 1\n"; + } if (0x80 < $rc) { my $status = $rc >> 8;