[parted-devel] [PATCH v2] tests: skip tests requiring mkfs.hfs if it is not available

Petr Uzel petr.uzel at suse.cz
Mon Mar 1 16:04:51 UTC 2010


Testsuite fails if mkfs.hfs is not installed on the system.
* tests/t-lib.sh (require_hfs_): New function.
* tests/t3000-resize-fs.sh: Use require_hfs_
---
 tests/t-lib.sh           |    6 ++++++
 tests/t3000-resize-fs.sh |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tests/t-lib.sh b/tests/t-lib.sh
index 73454ce..50c7c91 100644
--- a/tests/t-lib.sh
+++ b/tests/t-lib.sh
@@ -54,6 +54,12 @@ require_acl_()
     || skip_test_ "This test requires a local user named bin."
 }
 
+require_hfs_()
+{
+  ( mkfs.hfs 2>&1 | grep '^usage:' ) > /dev/null \
+    || skip_test_ "This test requires HFS support."
+}
+
 # Skip this test if we're not in SELinux "enforcing" mode.
 require_selinux_enforcing_()
 {
diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh
index d6af67d..4d0f5cb 100755
--- a/tests/t3000-resize-fs.sh
+++ b/tests/t3000-resize-fs.sh
@@ -23,6 +23,7 @@ fi
 
 : ${srcdir=.}
 . $srcdir/t-lib.sh
+require_hfs_
 
 require_root_
 require_scsi_debug_module_
-- 
1.6.4.2


Petr

--
Petr Uzel, openSUSE Boosters Team
IRC: ptr_uzl @ freenode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20100301/55999283/attachment.pgp>


More information about the parted-devel mailing list