changeset 17420:7266df63bb4d

test-lchown, test-chown: also skip test if lchown/chown fails with EPERM 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.
author Bernhard Voelker <mail@bernhard-voelker.de>
date Wed, 22 May 2013 00:53:50 +0200
parents 020c917cba9d
children ce63398f847f
files ChangeLog tests/test-chown.h tests/test-lchown.h
diffstat 3 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/tests/test-chown.h
+++ b/tests/test-chown.h
@@ -57,9 +57,9 @@
   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)
--- a/tests/test-lchown.h
+++ b/tests/test-lchown.h
@@ -65,9 +65,9 @@
   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)