From eaa61c1d42dc605654a0e3073ac693a50bf1d2b8 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Wed, 22 May 2013 00:53:50 +0200 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ tests/test-chown.h | 4 ++-- tests/test-lchown.h | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 35b6dd2af..9241e189c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-05-22 Bernhard Voelker + + 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 regex: fix dfa race in multithreaded uses diff --git a/tests/test-chown.h b/tests/test-chown.h index 1f66d4cf3..1e56b756f 100644 --- a/tests/test-chown.h +++ b/tests/test-chown.h @@ -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) diff --git a/tests/test-lchown.h b/tests/test-lchown.h index d4e66e7aa..7a66c1026 100644 --- a/tests/test-lchown.h +++ b/tests/test-lchown.h @@ -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) -- 2.11.0