bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: other test failure


From: Jim Meyering
Subject: Re: other test failure
Date: Thu, 17 Aug 2006 09:21:51 +0200

Michael Stone <address@hidden> wrote:
> In a different build environment, the test run fails, but there are no
> FAIL lines, only an "XPASS acl". I'm not sure I understand this (from
> test/Makefile):
>              case " $(XFAIL_TESTS) " in \
>              *" $$tst "*) \
>                xpass=`expr $$xpass + 1`; \
>                failed=`expr $$failed + 1`; \
>                echo "XPASS: $$tst"; \
>              ;; \
> It looks like things that are set as "XFAIL_TESTS" (which is only acl)
> increment the failure counter, even though they would otherwise pass?

Thanks for reporting that.
This fixes it for me:
[This problem shows up only if you have sufficient ACL libraries and headers
 installed, and run in a directory on a file system that supports ACLs. ]

2006-08-16  Jim Meyering  <address@hidden>

        * tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
        * tests/cp/acl: Instead, skip the test if either setfacl
        or getfacl fails.
        Reported by Michael Stone.

Index: tests/cp/Makefile.am
===================================================================
RCS file: /fetish/cu/tests/cp/Makefile.am,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -u -r1.32 -r1.33
--- tests/cp/Makefile.am        3 Jul 2006 12:55:26 -0000       1.32
+++ tests/cp/Makefile.am        16 Aug 2006 21:53:57 -0000      1.33
@@ -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 \
Index: tests/cp/acl
===================================================================
RCS file: /fetish/cu/tests/cp/acl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -u -r1.6 -r1.7
--- tests/cp/acl        16 Aug 2006 10:00:07 -0000      1.6
+++ tests/cp/acl        16 Aug 2006 21:53:57 -0000      1.7
@@ -19,20 +19,33 @@ trap 'status=$?; cd $pwd; chmod -R u+rwx
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]