test-lchown, test-chown: also skip test if lchown/chown fails with EPERM
[gnulib.git] / tests / test-chown.h
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)