Blob Blame History Raw
From d704c4919e7e95c3a2e28f48bb8eeacaf17a7cc8 Mon Sep 17 00:00:00 2001
From: Mike Fleetwood <mike.fleetwood@googlemail.com>
Date: Sun, 28 Sep 2014 16:15:49 +0100
Subject: [PATCH 5/6] tests: t3000-resize-fs.sh: Add FAT16 resizing test

Add FAT16 resizing test so that we don't regress again.
---
 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 8cab476..9084eb4 100755
--- a/tests/t3000-resize-fs.sh
+++ b/tests/t3000-resize-fs.sh
@@ -46,7 +46,7 @@ device_sectors_required=$(echo $default_end | sed 's/s$//')
 # Ensure that $dev is large enough for this test
 test $device_sectors_required -le $dev_n_sectors || fail=1
 
-for fs_type in hfs+ fat32; do
+for fs_type in hfs+ fat32 fat16; do
 
   # create an empty $fs_type partition, cylinder aligned, size > 256 MB
   parted -a min -s $dev mkpart p1 $start $default_end > out 2>&1 || fail=1
@@ -59,6 +59,7 @@ for fs_type in hfs+ fat32; do
   wait_for_dev_to_appear_ ${dev}1
 
   case $fs_type in
+    fat16) mkfs_cmd='mkfs.vfat -F 16'; fsck='fsck.vfat -v';;
     fat32) mkfs_cmd='mkfs.vfat -F 32'; fsck='fsck.vfat -v';;
     hfs*) mkfs_cmd='mkfs.hfs';         fsck=fsck.hfs;;
     *) error "internal error: unhandled fs type: $fs_type";;
@@ -70,8 +71,17 @@ for fs_type in hfs+ fat32; do
   # NOTE: shrinking is the only type of resizing that works.
   # resize that file system to be one cylinder (8MiB) smaller
   fs-resize ${dev}1 0 $new_end > out 2>&1 || fail=1
-  # expect no output
-  compare /dev/null out || fail=1
+
+  # check for expected output
+  case $fs_type in
+    fat16) cat << EOF > exp || framework_failure
+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.
+EOF
+      ;;
+    fat32) cat /dev/null > exp || framework_failure;;     # expect no output
+    hfs*)  cat /dev/null > exp || framework_failure;;     # expect no output
+  esac
+  compare exp out || fail=1
 
   # This is known to segfault with fsck.hfs from
   # Fedora 16's hfsplus-tools-332.14-12.fc15.x86_64.
-- 
1.9.3