From 71006c03edac3304aeb7337d5077883a31886a23 Mon Sep 17 00:00:00 2001
From: Matt Davis <mattdavis9@gmail.com>
Date: Wed, 30 May 2007 23:49:58 -0400
Subject: Added a test for ticket #22

Seems that resizing a drive that is ~320M or greater causes issues.
The resize fault seems to occur when the partion is growing towards the boundary of the partition size.
---
 tests/t3100-resize-ext2.sh |   54 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100755 tests/t3100-resize-ext2.sh

diff --git a/tests/t3100-resize-ext2.sh b/tests/t3100-resize-ext2.sh
new file mode 100755
index 0000000..42b515d
--- /dev/null
+++ b/tests/t3100-resize-ext2.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+# Ensure that resizing an ext2 partition does not fail
+
+# Copyright (C) 2007 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 2 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+../parted/parted --version > /dev/null 2>&1
+if test $? != 0; then
+  echo >&2 'You have not built parted yet.'
+  exit 1
+fi
+
+test_description='Test to check if resizing a ext2 parition fails.'
+
+. ./init.sh
+
+# create a file of size N bytes
+N=128M
+dev=loop-file
+
+test_expect_success \
+    'create the test file' \
+    'dd if=/dev/zero of=$dev bs=$N count=1 2> /dev/null'
+
+test_expect_success \
+    'run parted -s FILE mklabel msdos' \
+    'parted -s $dev mklabel msdos > out 2>&1'
+test_expect_success 'check for mklabel succsess' '$compare out /dev/null'
+
+test_expect_success \
+    'create an ext2 primary partition' \
+    'parted -s $dev mkpartfs primary ext2 0 $N > out 2>&1'
+test_expect_success 'check for mkpartfs success' '$compare out /dev/null'
+
+test_expect_success \
+    'resize the ext2 primary partition' \
+    'parted -s $dev resize 1 0 92 > out 2>&1'
+test_expect_success 'check for resize succsess' '$compare out /dev/null'
+
+test_done
-- 
1.5.1.5

