From 262a9242f5ad121ddcb42edaacadbc2e6a650333 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 15 Jul 2021 08:27:00 -0700 Subject: [PATCH 23/24] tests/t3000: Check for hfs and vfat support separately Previously the whole test would be skipped if either mkfs.hfs or mkfs.vfat were not installed, leading to missing test coverage. This change checks for them individually so that the test will run with either or both of them installed --- tests/t3000-resize-fs.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh index 1f2e46e..282b6fc 100755 --- a/tests/t3000-resize-fs.sh +++ b/tests/t3000-resize-fs.sh @@ -17,12 +17,22 @@ # along with this program. If not, see . . "${srcdir=.}/init.sh"; path_prepend_ ../parted . -require_hfs_ -require_fat_ require_root_ require_scsi_debug_module_ require_512_byte_sector_size_ + +FSTYPES="" + +# Is mkfs.hfs available? +mkfs.hfs 2>&1 | grep '^usage:' && FSTYPES="hfs+" + +# Is mkfs.vfat available? +mkfs.vfat 2>&1 | grep '^Usage:' && FSTYPES="$FSTYPES fat32 fat16" + +[ -n "$FSTYPES" ] || skip_ "Neither mkfs.hfs nor mkfs.vfat installed" + + ss=$sector_size_ start=63s @@ -53,7 +63,7 @@ mkdir "$mount_point" || fail=1 # be sure to unmount upon interrupt, failure, etc. cleanup_fn_() { umount "${dev}1" > /dev/null 2>&1; } -for fs_type in hfs+ fat32 fat16; do +for fs_type in $FSTYPES; do echo "fs_type=$fs_type" # create an empty $fs_type partition, cylinder aligned, size > 256 MB -- 2.31.1