test-lchown, test-chown: also skip test if lchown/chown fails with EPERM
authorBernhard Voelker <mail@bernhard-voelker.de>
Tue, 21 May 2013 22:53:50 +0000 (00:53 +0200)
committerPádraig Brady <P@draigBrady.com>
Wed, 22 May 2013 09:01:52 +0000 (10:01 +0100)
These tests abort on FAT file systems right after the test for
filtering out situation without ownership support; errno is EPERM
in such a case.

* tests/test-lchown.h (test_lchown): Add EPERM to the condition to
skip this test.
* tests/test-chown.h (test_chown): Likewise.

ChangeLog
tests/test-chown.h
tests/test-lchown.h

index 35b6dd2..9241e18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-05-22  Bernhard Voelker <mail@bernhard-voelker.de>
+
+       test-lchown, test-chown: also skip test if chown fails with EPERM
+       * tests/test-lchown.h (test_lchown): Add EPERM to the condition to
+       skip this test, to handle FAT file systems.
+       * tests/test-chown.h (test_chown): Likewise.
+
 2013-05-19  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: fix dfa race in multithreaded uses
index 1f66d4c..1e56b75 100644 (file)
@@ -57,9 +57,9 @@ test_chown (int (*func) (char const *, uid_t, gid_t), bool print)
   ASSERT (mkdir (BASE "dir", 0700) == 0);
   ASSERT (stat (BASE "dir", &st1) == 0);
 
-  /* Filter out mingw, which has no concept of groups.  */
+  /* Filter out mingw and file systems which have no concept of groups.  */
   result = func (BASE "dir", st1.st_uid, getegid ());
-  if (result == -1 && errno == ENOSYS)
+  if (result == -1 && (errno == ENOSYS || errno == EPERM))
     {
       ASSERT (rmdir (BASE "dir") == 0);
       if (print)
index d4e66e7..7a66c10 100644 (file)
@@ -65,9 +65,9 @@ test_lchown (int (*func) (char const *, uid_t, gid_t), bool print)
   ASSERT (mkdir (BASE "dir", 0700) == 0);
   ASSERT (stat (BASE "dir", &st1) == 0);
 
-  /* Filter out mingw, which has no concept of groups.  */
+  /* Filter out mingw and file systems which have no concept of groups.  */
   result = func (BASE "dir", st1.st_uid, getegid ());
-  if (result == -1 && errno == ENOSYS)
+  if (result == -1 && (errno == ENOSYS || errno == EPERM))
     {
       ASSERT (rmdir (BASE "dir") == 0);
       if (print)