Hello,

as reported in rhbz #558898 , cp-a-selinux test could fail if there are
no loop devices available or if the kernel has no support for loop
devices. Other similar tests just skip if the mount or filesystem
creation fails. Attached patch does the same for the cp/cp-a-selinux
test.

Greetings,
         Ondřej Vašík
From 67bc8118e98f99f59d1f601d06c121f3ed2c4f58 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <[email protected]>
Date: Mon, 1 Feb 2010 16:29:27 +0100
Subject: [PATCH] tests: cp-a-selinux :skip the test if no loopdevices available

* tests/cp/cp-a-selinux: skip the test (instead of fail) if no
loopdevices available
---
 tests/cp/cp-a-selinux |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/cp/cp-a-selinux b/tests/cp/cp-a-selinux
index b1359c0..539c512 100755
--- a/tests/cp/cp-a-selinux
+++ b/tests/cp/cp-a-selinux
@@ -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
-- 
1.5.6.1.156.ge903b

Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy

Reply via email to