changeset 14028:2d32f7c9e2d3

rename, renameat: Avoid test failures at NFS mounted locations. * tests/test-rename.h (assert_nonexistent): Remove the old directory, so that subsequent mkdir calls succeed.
author Bruno Haible <bruno@clisp.org>
date Sat, 25 Dec 2010 17:17:36 +0100
parents 5e4ea8b4bde8
children 01400c528402
files ChangeLog tests/test-rename.h
diffstat 2 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-25  Bruno Haible  <bruno@clisp.org>
+
+	rename, renameat: Avoid test failures at NFS mounted locations.
+	* tests/test-rename.h (assert_nonexistent): Remove the old directory,
+	so that subsequent mkdir calls succeed.
+
 2010-12-25  Bruno Haible  <bruno@clisp.org>
 
 	iswblank: Fix C++ link error on Solaris 8.
--- a/tests/test-rename.h
+++ b/tests/test-rename.h
@@ -56,11 +56,16 @@
   if (stat (filename, &st) == -1)
     ASSERT (errno == ENOENT);
   else
-    /* But after renaming a directory over an empty directory on an NFS-mounted
-       file system, on Linux 2.6.18, for a period of 30 seconds the old
-       directory name is "present" according to stat() but "nonexistent"
-       according to dentry_exists().  */
-    ASSERT (!dentry_exists (filename));
+    {
+      /* But after renaming a directory over an empty directory on an NFS-
+         mounted file system, on Linux 2.6.18, for a period of 30 seconds the
+         old directory name is "present" according to stat() but "nonexistent"
+         according to dentry_exists().  */
+      ASSERT (!dentry_exists (filename));
+      /* Remove the old directory name, so that subsequent mkdir calls
+         succeed.  */
+      (void) rmdir (filename);
+    }
 }
 
 static int