[PATCH 1/4] tests: attempt to resize a FAT file system
Jim Meyering
meyering at redhat.com
Sat Sep 19 06:22:20 UTC 2009
* tests/t3000-resize-fat.sh: New file.
---
tests/t3000-resize-fat.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 66 insertions(+), 0 deletions(-)
create mode 100755 tests/t3000-resize-fat.sh
diff --git a/tests/t3000-resize-fat.sh b/tests/t3000-resize-fat.sh
new file mode 100755
index 0000000..496e15f
--- /dev/null
+++ b/tests/t3000-resize-fat.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+test_description='exercise the resize sub-command'
+
+: ${srcdir=.}
+. $srcdir/test-lib.sh
+
+require_512_byte_sector_size_
+dev=$DEVICE_TO_ERASE
+
+N=62M
+
+test_expect_success \
+ 'create a partition table' \
+ 'parted -s $dev mklabel gpt > out 2>&1'
+test_expect_success 'expect no output' 'compare out /dev/null'
+
+test_expect_success \
+ 'create an empty FAT partition' \
+ 'parted -s $dev mkpart primary fat32 50s 70000s > out 2>&1'
+test_expect_success 'expect no output' 'compare out /dev/null'
+
+test_expect_success \
+ 'print partition table' \
+ 'parted -m -s $dev u b p > out 2>&1'
+
+# FIXME: check expected output
+
+# There's a race condition here: on udev-based systems, the partition#1
+# device, ${dev}1 (i.e., /dev/sde1) is not created immediately, and
+# without some delay, this mount command would fail. Using a flash card
+# as $dev, the loop below typically iterates 7-20 times.
+test_expect_success \
+ 'wait for new partition device to appear' \
+ 'i=0; while :; do
+ test -e "${dev}1" && break; test $i = 90 && break;
+ i=$(expr $i + 1); done; test $i != 90'
+
+test_expect_success \
+ 'create the file system' \
+ 'mkfs.vfat -F 32 ${dev}1'
+
+test_expect_success \
+ 'resize that file system' \
+ 'parted -s $dev resize 1 50s 71000s'
+
+test_expect_success \
+ 'print partition table' \
+ 'parted -m -s $dev u b p'
+
+test_done
--
1.6.5.rc2.177.ga9dd6
More information about the parted-devel
mailing list