skip (don't fail) root-only tests for common set-up failures
authorJim Meyering <meyering@redhat.com>
Fri, 13 Jun 2008 20:26:15 +0000 (22:26 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 13 Jun 2008 20:45:50 +0000 (22:45 +0200)
Address 2 of 4 failures reported by Jarod Wilson in
http://bugzilla.redhat.com/442352.  More details here:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803
* tests/cp/cp-a-selinux: Skip the test if "mkfs -t ext2" fails.
* tests/rm/fail-2eperm: Skip the test if "rm" is not accessible.

THANKS
tests/cp/cp-a-selinux
tests/rm/fail-2eperm

diff --git a/THANKS b/THANKS
index e1d2089a0536d7ca8af3fd84ca68a798f676b29e..3e5443ba93c5179f030d76114a88167b9dfa8824 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -240,6 +240,7 @@ Jan Moringen                        jan.moringen@uni-bielefeld.de
 Jan Nieuwenhuizen                   janneke@gnu.org
 Janos Farkas                        chexum@shadow.banki.hu
 Jarkko Hietaniemi                   jhi@epsilon.hut.fi
 Jan Nieuwenhuizen                   janneke@gnu.org
 Janos Farkas                        chexum@shadow.banki.hu
 Jarkko Hietaniemi                   jhi@epsilon.hut.fi
+Jarod Wilson                        jwilson@redhat.com
 Jean Charles Delepine               delepine@u-picardie.fr
 Jeff Moore                          jbm@mordor.com
 Jeff Sheinberg                      jeff@bsrd.net
 Jean Charles Delepine               delepine@u-picardie.fr
 Jeff Moore                          jbm@mordor.com
 Jeff Sheinberg                      jeff@bsrd.net
index feb66f9ac0dea6a0f8337cd1283fb7b6f0631a92..03d515399aa847a1f92b15d7bea23ab7dc4a73a7 100755 (executable)
@@ -33,7 +33,8 @@ cleanup_() { cd /; umount "$cwd/mnt"; }
 dd if=/dev/zero of=blob bs=8192 count=200 > /dev/null 2>&1 \
                                              || framework_failure
 mkdir mnt                                    || framework_failure
 dd if=/dev/zero of=blob bs=8192 count=200 > /dev/null 2>&1 \
                                              || framework_failure
 mkdir mnt                                    || framework_failure
-mkfs -t ext2 -F blob                         || framework_failure
+mkfs -t ext2 -F blob ||
+  skip_test_ "failed to create an ext2 file system"
 
 # This context is special: it works even when mcstransd isn't running.
 ctx=root:object_r:tmp_t:s0
 
 # This context is special: it works even when mcstransd isn't running.
 ctx=root:object_r:tmp_t:s0
index 132e22cec5bede5ccf04a124b28d6ea61ed967ce..6cc66ef80f44a021faa8e08ae58a2d1731e689fa 100755 (executable)
@@ -39,8 +39,7 @@ fail=0
 rm_version=`setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version|sed -n '1s/.* //p'`
 case $rm_version in
   $PACKAGE_VERSION) ;;
 rm_version=`setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version|sed -n '1s/.* //p'`
 case $rm_version in
   $PACKAGE_VERSION) ;;
-  *) echo "$0: cannot access just-built rm as user $NON_ROOT_USERNAME" 1>&2
-     fail=1 ;;
+  *) skip_test_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
 esac
 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm -rf a 2> out-t && fail=1
 
 esac
 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm -rf a 2> out-t && fail=1