bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] tests: exercise the "GPT vs other-sized partition entry arra


From: Jim Meyering
Subject: [PATCH 4/4] tests: exercise the "GPT vs other-sized partition entry arrays" fixes
Date: Thu, 3 Nov 2011 22:18:58 +0100

From: Jim Meyering <address@hidden>

* tests/t0210-gpt-resized-partition-entry-array.sh: New file.
* tests/Makefile.am (TESTS): Add it.
---
 tests/Makefile.am                                |    1 +
 tests/t0210-gpt-resized-partition-entry-array.sh |   38 ++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100755 tests/t0210-gpt-resized-partition-entry-array.sh

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9638248..47fd8b6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,6 +19,7 @@ TESTS = \
   t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh \
   t0207-IEC-binary-notation.sh \
   t0208-mkpart-end-in-IEC.sh \
+  t0210-gpt-resized-partition-entry-array.sh \
   t0220-gpt-msftres.sh \
   t0250-gpt.sh \
   t0280-gpt-corrupt.sh \
diff --git a/tests/t0210-gpt-resized-partition-entry-array.sh 
b/tests/t0210-gpt-resized-partition-entry-array.sh
new file mode 100755
index 0000000..8a3dcea
--- /dev/null
+++ b/tests/t0210-gpt-resized-partition-entry-array.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# exercise GPT handling of n_partition_array_entries != 128
+
+# Copyright (C) 2009-2011 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/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../parted $srcdir
+
+N=2M
+dev=loop-file
+# create a file large enough to hold a GPT partition table
+dd if=/dev/null of=$dev bs=1 seek=$N || framework_failure
+
+# create a GPT partition table
+parted -s $dev mklabel gpt > out 2>&1 || fail=1
+# expect no output
+compare out /dev/null || fail=1
+
+gpt-header-munge --n=9 $dev || fail=1
+
+parted -m -s $dev u s p > out 2>&1 || fail=1
+sed 's/.*:gpt:/:gpt:/' out > k && mv k out
+printf 'BYT;\n:gpt:;\n' > exp || fail=1
+compare out exp || fail=1
+
+Exit $fail
-- 
1.7.8.rc0.32.g87bf9




reply via email to

[Prev in Thread] Current Thread [Next in Thread]