Blame SOURCES/0005-tests-t3000-resize-fs.sh-Add-FAT16-resizing-test.patch

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