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

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