GNU bug report logs - #15355
[PATCH 02/19] tests: test creating 20 device-mapper partitions (#803108)

Previous Next

Package: parted;

Reported by: "Brian C. Lane" <bcl <at> redhat.com>

Date: Wed, 11 Sep 2013 20:18:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 15355 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#15355; Package parted. (Wed, 11 Sep 2013 20:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Brian C. Lane" <bcl <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Wed, 11 Sep 2013 20:18:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: bug-parted <at> gnu.org
Subject: [PATCH 02/19] tests: test creating 20 device-mapper partitions
 (#803108)
Date: Wed, 11 Sep 2013 12:24:52 -0700
From: "Brian C. Lane" <bcl <at> redhat.com>

* tests/t6004-dm-many-partitions.sh: Make sure > 17 partitions appear in
  device mapper.
---
 tests/Makefile.am                 |  1 +
 tests/t6004-dm-many-partitions.sh | 60 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100755 tests/t6004-dm-many-partitions.sh

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4ec08da..923839d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -60,6 +60,7 @@ TESTS = \
   t6001-psep.sh \
   t6002-dm-busy.sh \
   t6003-dm-hide.sh \
+  t6004-dm-many-partitions.sh \
   t6100-mdraid-partitions.sh \
   t7000-scripting.sh \
   t8000-loop.sh \
diff --git a/tests/t6004-dm-many-partitions.sh b/tests/t6004-dm-many-partitions.sh
new file mode 100755
index 0000000..4d08e72
--- /dev/null
+++ b/tests/t6004-dm-many-partitions.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+# device-mapper: create many partitions
+# This would not create partitions > 16 when using device-mapper
+
+# Copyright (C) 2012 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
+
+require_root_
+(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
+
+ss=$sector_size_
+ns=300
+n_partitions=20
+start_sector=34
+loop_file=loop-file-$$
+dm_name=dm-test-$$
+
+cleanup_() {
+    dmsetup remove $dm_name
+    test -n "$dev" && losetup -d "$dev"
+    rm -f $loop_file;
+}
+
+# create a file large enough to hold a GPT partition table
+dd if=/dev/null of=$loop_file bs=$ss seek=$ns || framework_failure
+dev=$(losetup --show -f $loop_file) || framework_failure
+dmsetup create $dm_name --table "0 $ns linear $dev 0" || framework_failure
+
+cmd=
+for ((i=1; i<=$n_partitions; i+=1)); do
+  s=$((start_sector + i - 1))
+  cmd="$cmd mkpart p$i ${s}s ${s}s"
+done
+parted -m -a min -s /dev/mapper/$dm_name mklabel gpt $cmd > /dev/null 2>&1 || fail=1
+
+# Make sure all the partitions appeared under /dev/mapper/
+for ((i=1; i<=$n_partitions; i+=1)); do
+    if [ ! -e "/dev/mapper/${dm_name}p$i" ]; then
+        fail=1
+        break
+    fi
+    # remove the partitions as we go, otherwise cleanup won't work.
+    dmsetup remove /dev/mapper/${dm_name}p$i
+done
+
+Exit $fail
-- 
1.8.3.1





Information forwarded to bug-parted <at> gnu.org:
bug#15355; Package parted. (Fri, 28 Feb 2014 18:23:02 GMT) Full text and rfc822 format available.

Message #8 received at 15355 <at> debbugs.gnu.org (full text, mbox):

From: Phillip Susi <psusi <at> ubuntu.com>
To: "Brian C. Lane" <bcl <at> redhat.com>, 15355 <at> debbugs.gnu.org
Subject: Re: bug#15355: [PATCH 02/19] tests: test creating 20 device-mapper
 partitions (#803108)
Date: Fri, 28 Feb 2014 13:22:28 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 9/11/2013 3:24 PM, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl <at> redhat.com>
> 
> * tests/t6004-dm-many-partitions.sh: Make sure > 17 partitions
> appear in device mapper.

Where was this actually fixed?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTENPkAAoJEI5FoCIzSKrwJBoH/RoZRxGp4FNBAiVdk8SE9aJL
QUSX94Sz2driuhahM0xSK+6DkPvy/EP5Vn25dyIi/4m1yyLePYyoG/yf1pvcKBqJ
NgjaNjN3M2k8fJvJZS+A8PVdQT71YiyXJeP9iSjjZwM1AE9TsoY37TMlAMUX3pk9
xPRM2H3Ag473Qjz/j+5V1/iydaVDPrGoXl+DVrupF3sFnoAboTBfaJ9k7oPj2Faj
ODVm8p1wnEamjPv5CzbLlQ4v4m0oEThBOBdM4h3xVsXve2Ri1BFsRX5YW80HvpB7
ZVhPdSBQKlNsZv3FAd+a8V2gVgd0udxvbMhqYP9Xhe2oChVa+7JUWsH+07u/ybA=
=aq+c
-----END PGP SIGNATURE-----




Information forwarded to bug-parted <at> gnu.org:
bug#15355; Package parted. (Fri, 28 Feb 2014 19:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 15355 <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: Phillip Susi <psusi <at> ubuntu.com>
Cc: 15355 <at> debbugs.gnu.org
Subject: Re: bug#15355: [PATCH 02/19] tests: test creating 20 device-mapper
 partitions (#803108)
Date: Fri, 28 Feb 2014 11:27:03 -0800
On Fri, Feb 28, 2014 at 01:22:28PM -0500, Phillip Susi wrote:
> On 9/11/2013 3:24 PM, Brian C. Lane wrote:
> > From: "Brian C. Lane" <bcl <at> redhat.com>
> > 
> > * tests/t6004-dm-many-partitions.sh: Make sure > 17 partitions
> > appear in device mapper.
> 
> Where was this actually fixed?

It was fixed in _dm_reread_part_table which your dm refactor removed
(commit f0c0d53f99).

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




This bug report was last modified 11 years and 112 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.