From fcdf32c1594cd0f9f525f39fb5340130877ba14d Mon Sep 17 00:00:00 2001 From: Bob Proulx Date: Mon, 25 Feb 2008 20:38:23 +0100 Subject: 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. --- tests/rm/fail-eperm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/rm') diff --git a/tests/rm/fail-eperm b/tests/rm/fail-eperm index 5fa54b097..e9e2108ec 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; -- cgit v1.2.3-54-g00ecf