summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2021-07-15 08:27:00 -0700
committerBrian C. Lane <bcl@redhat.com>2021-07-15 09:58:20 -0700
commit262a9242f5ad121ddcb42edaacadbc2e6a650333 (patch)
tree79abd26bbf4491a669f4691b973986d5e3eb6b5b
parent0caf2d7f1363b9c4b3b63cf7d3a1260eb5a72f34 (diff)
downloadparted-262a9242f5ad121ddcb42edaacadbc2e6a650333.tar.gz
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
-rwxr-xr-xtests/t3000-resize-fs.sh16
1 files 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 <http://www.gnu.org/licenses/>.
. "${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