summaryrefslogtreecommitdiff
path: root/tests/cp
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-08-16 21:53:56 +0000
committerJim Meyering <jim@meyering.net>2006-08-16 21:53:56 +0000
commit0142be6908d7b930dd1d1d392bf19b61027a4939 (patch)
tree68e7ef7608dacdf97ad502897e220bf916b2e191 /tests/cp
parent60d8c895296606aac684e94cc884b7a49f1e3c45 (diff)
downloadcoreutils-0142be6908d7b930dd1d1d392bf19b61027a4939.tar.xz
* tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
* tests/cp/acl: Instead, skip the test if either setfacl or getfacl fails.
Diffstat (limited to 'tests/cp')
-rw-r--r--tests/cp/Makefile.am1
-rwxr-xr-xtests/cp/acl23
2 files changed, 18 insertions, 6 deletions
diff --git a/tests/cp/Makefile.am b/tests/cp/Makefile.am
index 5fa40e4bb..acbb22df9 100644
--- a/tests/cp/Makefile.am
+++ b/tests/cp/Makefile.am
@@ -1,7 +1,6 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
AUTOMAKE_OPTIONS = 1.1 gnits
-XFAIL_TESTS = acl
TESTS = \
link-no-deref \
cp-deref \
diff --git a/tests/cp/acl b/tests/cp/acl
index 8abb6c1c3..3c7274732 100755
--- a/tests/cp/acl
+++ b/tests/cp/acl
@@ -19,20 +19,33 @@ trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
-mkdir -p $tmp/a $tmp/b || framework_failure=1
+mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
+mkdir -p a b || framework_failure=1
+touch a/file || framework_failure=1
+
if test $framework_failure = 1; then
echo 'failure in testing framework'
(exit 1); exit 1
fi
-# copy a file without preserving permissions
-touch a/file || framework_failure=1
-setfacl -m user:bin:rw a/file || framework_failure=1
+skip=no
+# Ensure that setfacl and getfacl work on this file system.
+setfacl -m user:bin:rw a/file 2> /dev/null || skip=yes
acl1=`cd a && getfacl file | grep -v ':bin:' | grep -v 'mask::'` \
- || framework_failure=1
+ || skip=yes
+
+test $skip = yes &&
+ {
+ echo "$0: '.' is not on a suitable file system for this test" 1>&2
+ echo "$0: skipping this test" 1>&2
+ (exit 77); exit 77
+ }
+
+# copy a file without preserving permissions
cp a/file b/ || fail=1
+
acl2=`cd b && getfacl file` || framework_failure=1
test "$acl1" = "$acl2" || fail=1
rm a/file || framework_failure=1