parted/0099-tests-Add-ntfs-vfat-hfsplus-to-t1700-probe-test.patch

65 lines
2.0 KiB
Diff

From f988537d99ae18e9307f99821de8f71953ad8d4f Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Thu, 17 Apr 2014 12:14:48 -0700
Subject: [PATCH] tests: Add ntfs vfat hfsplus to t1700 probe test
Add some new filesystems to test. Adjust how mkfs.* tests, since some of
them don't support -V, and add fsname so that the printed filesystem
name doesn't have to match the type.
* tests/t1700-probe-fs.sh: Add new filesystems to test
---
tests/t1700-probe-fs.sh | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/tests/t1700-probe-fs.sh b/tests/t1700-probe-fs.sh
index bf6ad9c..695f9ef 100755
--- a/tests/t1700-probe-fs.sh
+++ b/tests/t1700-probe-fs.sh
@@ -23,28 +23,37 @@ dev=loop-file
ss=$sector_size_
n_sectors=$((257*1024))
-for type in ext2 ext3 ext4 btrfs xfs nilfs2; do
+for type in ext2 ext3 ext4 btrfs xfs nilfs2 ntfs vfat hfsplus; do
- ( mkfs.$type -V ) >/dev/null 2>&1 \
+ ( mkfs.$type 2>&1 | grep -i '^usage' ) > /dev/null \
|| { warn_ "$ME: no $type support"; continue; }
- case $type in ext*) force=-F;;
+ fsname=$type
+ force=
+ case $type in
+ ext*) force=-F;;
xfs) force=-f;;
- *) force=;; esac
+ nilfs2) force=-f;;
+ ntfs) force=-F;;
+ vfat) fsname=fat16;;
+ hfsplus) fsname=hfs+;;
+ esac
# create an $type file system
+ [ -e $dev ] && rm -f $dev
dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || fail=1
mkfs.$type $force $dev || { warn_ $ME: mkfs.$type failed; fail=1; continue; }
# probe the $type file system
parted -m -s $dev u s print >out 2>&1 || fail=1
- grep '^1:.*:'$type'::;$' out || { cat out; fail=1; }
+ grep '^1:.*:'$fsname'::;$' out || { cat out; fail=1; }
done
# Some features should indicate ext4 by themselves.
for feature in uninit_bg flex_bg; do
# create an ext3 file system
+ [ -e $dev ] && rm -f $dev
dd if=/dev/null of=$dev bs=1024 seek=4096 >/dev/null || fail=1
mkfs.ext3 -F $dev >/dev/null || skip_ "mkfs.ext3 failed"
--
1.9.0