|
|
0cb0b9 |
From d704c4919e7e95c3a2e28f48bb8eeacaf17a7cc8 Mon Sep 17 00:00:00 2001
|
|
|
0cb0b9 |
From: Mike Fleetwood <mike.fleetwood@googlemail.com>
|
|
|
0cb0b9 |
Date: Sun, 28 Sep 2014 16:15:49 +0100
|
|
|
0cb0b9 |
Subject: [PATCH 5/6] tests: t3000-resize-fs.sh: Add FAT16 resizing test
|
|
|
0cb0b9 |
|
|
|
0cb0b9 |
Add FAT16 resizing test so that we don't regress again.
|
|
|
0cb0b9 |
---
|
|
|
0cb0b9 |
tests/t3000-resize-fs.sh | 16 +++++++++++++---
|
|
|
0cb0b9 |
1 file changed, 13 insertions(+), 3 deletions(-)
|
|
|
0cb0b9 |
|
|
|
0cb0b9 |
diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh
|
|
|
0cb0b9 |
index 8cab476..9084eb4 100755
|
|
|
0cb0b9 |
--- a/tests/t3000-resize-fs.sh
|
|
|
0cb0b9 |
+++ b/tests/t3000-resize-fs.sh
|
|
|
0cb0b9 |
@@ -46,7 +46,7 @@ device_sectors_required=$(echo $default_end | sed 's/s$//')
|
|
|
0cb0b9 |
# Ensure that $dev is large enough for this test
|
|
|
0cb0b9 |
test $device_sectors_required -le $dev_n_sectors || fail=1
|
|
|
0cb0b9 |
|
|
|
0cb0b9 |
-for fs_type in hfs+ fat32; do
|
|
|
0cb0b9 |
+for fs_type in hfs+ fat32 fat16; do
|
|
|
0cb0b9 |
|
|
|
0cb0b9 |
# create an empty $fs_type partition, cylinder aligned, size > 256 MB
|
|
|
0cb0b9 |
parted -a min -s $dev mkpart p1 $start $default_end > out 2>&1 || fail=1
|
|
|
0cb0b9 |
@@ -59,6 +59,7 @@ for fs_type in hfs+ fat32; do
|
|
|
0cb0b9 |
wait_for_dev_to_appear_ ${dev}1
|
|
|
0cb0b9 |
|
|
|
0cb0b9 |
case $fs_type in
|
|
|
0cb0b9 |
+ fat16) mkfs_cmd='mkfs.vfat -F 16'; fsck='fsck.vfat -v';;
|
|
|
0cb0b9 |
fat32) mkfs_cmd='mkfs.vfat -F 32'; fsck='fsck.vfat -v';;
|
|
|
0cb0b9 |
hfs*) mkfs_cmd='mkfs.hfs'; fsck=fsck.hfs;;
|
|
|
0cb0b9 |
*) error "internal error: unhandled fs type: $fs_type";;
|
|
|
0cb0b9 |
@@ -70,8 +71,17 @@ for fs_type in hfs+ fat32; do
|
|
|
0cb0b9 |
# NOTE: shrinking is the only type of resizing that works.
|
|
|
0cb0b9 |
# resize that file system to be one cylinder (8MiB) smaller
|
|
|
0cb0b9 |
fs-resize ${dev}1 0 $new_end > out 2>&1 || fail=1
|
|
|
0cb0b9 |
- # expect no output
|
|
|
0cb0b9 |
- compare /dev/null out || fail=1
|
|
|
0cb0b9 |
+
|
|
|
0cb0b9 |
+ # check for expected output
|
|
|
0cb0b9 |
+ case $fs_type in
|
|
|
0cb0b9 |
+ fat16) cat << EOF > exp || framework_failure
|
|
|
0cb0b9 |
+Information: Would you like to use FAT32? If you leave your file system as FAT16, then you will have no problems. If you convert to FAT32, and MS Windows is installed on this partition, then you must re-install the MS Windows boot loader. If you want to do this, you should consult the Parted manual (or your distribution's manual). Also, converting to FAT32 will make the file system unreadable by MS DOS, MS Windows 95a, and MS Windows NT.
|
|
|
0cb0b9 |
+EOF
|
|
|
0cb0b9 |
+ ;;
|
|
|
0cb0b9 |
+ fat32) cat /dev/null > exp || framework_failure;; # expect no output
|
|
|
0cb0b9 |
+ hfs*) cat /dev/null > exp || framework_failure;; # expect no output
|
|
|
0cb0b9 |
+ esac
|
|
|
0cb0b9 |
+ compare exp out || fail=1
|
|
|
0cb0b9 |
|
|
|
0cb0b9 |
# This is known to segfault with fsck.hfs from
|
|
|
0cb0b9 |
# Fedora 16's hfsplus-tools-332.14-12.fc15.x86_64.
|
|
|
0cb0b9 |
--
|
|
|
0cb0b9 |
1.9.3
|
|
|
0cb0b9 |
|