GNU bug report logs - #17105
[PATCH 4/4] tests: Use msdos-overlap to setup t0283

Previous Next

Package: parted;

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

Date: Wed, 26 Mar 2014 18:34:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 17105 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#17105; Package parted. (Wed, 26 Mar 2014 18:34:02 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, 26 Mar 2014 18:34: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 4/4] tests: Use msdos-overlap to setup t0283
Date: Wed, 26 Mar 2014 10:56:22 -0700
xxd isn't present in minimal build systems, as it is part of vim. Change
to using a simple python script to mangle the msdos disklabel for the
test.

* tests/msdos-overlap.py: New file
* tests/t0283-overlap-partitions.sh: Use msdos-overlap.py
---
 tests/msdos-overlap.py            | 25 ++++++++++++++++++++++++
 tests/t0283-overlap-partitions.sh | 40 +++------------------------------------
 2 files changed, 28 insertions(+), 37 deletions(-)
 create mode 100755 tests/msdos-overlap.py

diff --git a/tests/msdos-overlap.py b/tests/msdos-overlap.py
new file mode 100755
index 0000000..5bddfb0
--- /dev/null
+++ b/tests/msdos-overlap.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+"""
+    Write an overlapping partition to a msdos disk
+
+    Call with disk image/device to mangle
+"""
+import sys
+
+BAD_ENTRY = (0x72, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+             0x01, 0x10, 0x83, 0x03, 0x20, 0x4f, 0x00, 0x08,
+             0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
+             0x00, 0x50, 0x83, 0x00, 0x0a, 0x7a, 0xff, 0x27,
+             0x00, 0x00, 0x0a, 0x15, 0x00, 0x00, 0x00, 0x00 )
+OFFSET = 0x1b8
+
+if len(sys.argv) < 2:
+    print "%s: <image or device>"
+    sys.exit(1)
+
+data = "".join(chr(c) for c in BAD_ENTRY)
+with open(sys.argv[1], "rb+") as f:
+    f.seek(OFFSET, 0)
+    f.write(data)
+
+sys.exit(0)
diff --git a/tests/t0283-overlap-partitions.sh b/tests/t0283-overlap-partitions.sh
index c7ae52a..221332d 100644
--- a/tests/t0283-overlap-partitions.sh
+++ b/tests/t0283-overlap-partitions.sh
@@ -21,43 +21,9 @@
 require_512_byte_sector_size_
 dev=loop-file
 
-truncate -s 10m $dev || fail=1
-
-# write damaged label
-xxd -r - $dev <<EOF
-0000000: fab8 0010 8ed0 bc00 b0b8 0000 8ed8 8ec0  ................
-0000010: fbbe 007c bf00 06b9 0002 f3a4 ea21 0600  ...|.........!..
-0000020: 00be be07 3804 750b 83c6 1081 fefe 0775  ....8.u........u
-0000030: f3eb 16b4 02b0 01bb 007c b280 8a74 018b  .........|...t..
-0000040: 4c02 cd13 ea00 7c00 00eb fe00 0000 0000  L.....|.........
-0000050: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000080: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000090: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00000a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00000f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000100: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000110: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000120: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000150: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000160: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000170: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-0000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00001a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00001b0: 0000 0000 0000 0000 72f5 0000 0000 0000  ........r.......
-00001c0: 0110 8303 204f 0008 0000 0020 0000 0000  .... O..... ....
-00001d0: 0050 8300 0a7a ff27 0000 0a15 0000 0000  .P...z.'........
-00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
-00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
-EOF
+truncate -s 10m $dev || framework_failure
+parted -s $dev mklabel msdos || framework_failure
+python ../msdos-overlap.py $dev || framework_failure
 
 # print the empty table
 parted ---pretend-input-tty $dev <<EOF > out 2>&1 || fail=1
-- 
1.8.5.3





Information forwarded to bug-parted <at> gnu.org:
bug#17105; Package parted. (Thu, 27 Mar 2014 02:51:02 GMT) Full text and rfc822 format available.

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

From: Phillip Susi <psusi <at> ubuntu.com>
To: "Brian C. Lane" <bcl <at> redhat.com>, 17105 <at> debbugs.gnu.org
Subject: Re: bug#17105: [PATCH 4/4] tests: Use msdos-overlap to setup t0283
Date: Wed, 26 Mar 2014 22:49:57 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 03/26/2014 01:56 PM, Brian C. Lane wrote:
> xxd isn't present in minimal build systems, as it is part of vim.
> Change to using a simple python script to mangle the msdos
> disklabel for the test.

Hrm... on Debian based systems vim is part of the minimal seed, but
python is not.  I suppose we could switch to python, but I'm curious;
redhat does not consider vim to be the most basic and essential text
editor to have in a minimalist environment?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCgAGBQJTM5HVAAoJEI5FoCIzSKrwqi4IAJq5iRr/DE1BqXaFs/EUv+5N
F5NuNQYBxoBUV9gDR8IAmSsjJbX1bLl2u49ugHMk6Ki+2HzYSUkYBQI0HKUUuFbF
INo5VPsvCztXLdZSRXPHiBVnj8ExsMwp5X0xKlNXdpN+oPkmBXKd3PkEPtQcbql8
RVocLpKHhmNG1dm44j6LYLy3tfQxmHePFfadTXafrTuIcqzko7gyHHDOXu+XL0FK
YW/FCukwusjErGb4xgK+Szypau8fzsitvUFsSKhnQgZF/Jo0QgijdKB8sO0uom5c
+hUBYmAes5k+HB8I8Dp+RAVaZUmnmTgzWpWMl6SYTRVHGB8W97R+hu3/WD/AWQ4=
=QVwd
-----END PGP SIGNATURE-----




Information forwarded to bug-parted <at> gnu.org:
bug#17105; Package parted. (Thu, 27 Mar 2014 15:08:01 GMT) Full text and rfc822 format available.

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

From: "Brian C. Lane" <bcl <at> redhat.com>
To: Phillip Susi <psusi <at> ubuntu.com>
Cc: 17105 <at> debbugs.gnu.org
Subject: Re: bug#17105: [PATCH 4/4] tests: Use msdos-overlap to setup t0283
Date: Thu, 27 Mar 2014 08:07:12 -0700
On Wed, Mar 26, 2014 at 10:49:57PM -0400, Phillip Susi wrote:
> On 03/26/2014 01:56 PM, Brian C. Lane wrote:
> > xxd isn't present in minimal build systems, as it is part of vim.
> > Change to using a simple python script to mangle the msdos
> > disklabel for the test.
> 
> Hrm... on Debian based systems vim is part of the minimal seed, but
> python is not.  I suppose we could switch to python, but I'm curious;
> redhat does not consider vim to be the most basic and essential text
> editor to have in a minimalist environment?

You added the gpt-header-move.py so I assumed you had python available,
we use it everywhere. In Fedora the buildroots are very minimal, so vim
is not needed or included in them.

I'd rather see us depending on something standard like Python which can
be used for a wide variety of things than a single purpose tool like
xxd.

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




Information forwarded to bug-parted <at> gnu.org:
bug#17105; Package parted. (Thu, 27 Mar 2014 16:26:02 GMT) Full text and rfc822 format available.

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

From: Phillip Susi <psusi <at> ubuntu.com>
To: "Brian C. Lane" <bcl <at> redhat.com>
Cc: 17105 <at> debbugs.gnu.org
Subject: Re: bug#17105: [PATCH 4/4] tests: Use msdos-overlap to setup t0283
Date: Thu, 27 Mar 2014 12:25:38 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/27/2014 11:07 AM, Brian C. Lane wrote:
> You added the gpt-header-move.py so I assumed you had python
> available, we use it everywhere. In Fedora the buildroots are very
> minimal, so vim is not needed or included in them.
> 
> I'd rather see us depending on something standard like Python which
> can be used for a wide variety of things than a single purpose tool
> like xxd.

Fine by me.


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

iQEcBAEBAgAGBQJTNFECAAoJEI5FoCIzSKrw5/QH/24GGsLJNy0O40HCH+45eNqG
8o7cpqTzr8Eo0z2JGqBvnrc8cvnkYziP6v2cdBqkcv6ZjH7Zt8eRK8Wm4wIm1aKz
rtWgnYT1D2lhR2SVD7k2iBNW2APqZG9RQH58wFzECLsebTV5lGQzbbBnZblIk9ox
sH3FXonJiweXdT4zmAGy3bfBiDA+TLFtL7n9cFsQ13Ldto08T+hzob+vPFcEykFe
6kETonIXvDnct1hPknNpxRAhL9DOSmKahRr+JlfAunryj0AOW3acOmt1axUmkujY
Fdyg7pjrVCdOuIzqK9S85yYLoUJuAukNeKhe77HxD1JndJSHQo1RJ5qDM213qtI=
=iaO1
-----END PGP SIGNATURE-----




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

Previous Next


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