tests: cp-a-selinux: skip the test if mounting a loop device fails
authorOndřej Vašík <ovasik@redhat.com>
Mon, 1 Feb 2010 15:29:27 +0000 (16:29 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 1 Feb 2010 15:46:34 +0000 (16:46 +0100)
* tests/cp/cp-a-selinux: Skip the test (instead of fail) if we
fail to mount a loop device (e.g., none available).

tests/cp/cp-a-selinux

index 313f13279fe08c1da98acd4ff78d560758b8b5e9..770dcc4fc42951129a0346e381bf8390f6e2327c 100755 (executable)
@@ -48,12 +48,15 @@ ls -Z f | grep $ctx || fail=1
 
 # Create a file system, then mount it with the context=... option.
 dd if=/dev/zero of=blob bs=8192 count=200 > /dev/null 2>&1 \
-                                             || framework_failure
-mkdir mnt                                    || framework_failure
+                                             || skip=1
+mkdir mnt                                    || skip=1
 mkfs -t ext2 -F blob ||
   skip_test_ "failed to create an ext2 file system"
 
-mount -oloop,context=$ctx blob mnt           || framework_failure
+mount -oloop,context=$ctx blob mnt           || skip=1
+test $skip = 1 \
+  && skip_test_ "insufficient mount/ext2 support"
+
 cd mnt                                       || framework_failure
 
 echo > f                                     || framework_failure