[parted-devel] [PATCH 2/2] tests: add t0301-overwrite-gpt-pmbr.sh

Brian C. Lane bcl at redhat.com
Mon Mar 26 16:09:52 UTC 2012


On Sat, Mar 24, 2012 at 10:07:49AM +0100, Jim Meyering wrote:
> Brian C. Lane wrote:
> > From: "Brian C. Lane" <bcl at redhat.com>
> >
> > Make sure parted checks the PMBR before the GPT partition table.
> >
> > * NEWS: Update with new GPT behavior
> > * tests/Makefile.am: Add new test
> > * tests/overwrite-gpt-pmbr.sh: new test
> > ---
> ...
> > diff --git a/tests/t0301-overwrite-gpt-pmbr.sh b/tests/t0301-overwrite-gpt-pmbr.sh
> ...
> > +PARTED_SECTOR_SIZE=4096
> > +export PARTED_SECTOR_SIZE
> 
> I suppose the above two lines were just for testing?
> Their presence would serve solely to disable tests with a
> smaller simulated sector size.  I've removed them.

That was carried over from t0300 test which I used as a template for
this. You may want to remove it there as well.

> 
> > +dev=loop-file
> > +# create a backing file large enough for a GPT partition table
> > +dd if=/dev/null of=$dev seek=4001 2> /dev/null || framework_failure
> > +
> > +# create a GPT partition table
> > +parted -s $dev mklabel gpt > out 2>&1 || fail=1
> > +# expect no output
> > +compare /dev/null out || fail=1
> > +
> > +# create a DOS partition table
> > +fdisk $dev > out 2>&1 <<EOF
> > +o
> > +w
> > +EOF
> 
> This would be our first use of fdisk.
> Technically, we'd have to skip the test when fdisk is not available.
> Instead, I've adjusted the test not to require that: instead, create
> an MSDOS table in a separate file and transplant it into the GPT-labeled one.
> 
> I've also adjusted the NEWS entry.
> I'll wait for your ACK before pushing this.

Looks good, thanks.

Brian

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20120326/4c1378d1/attachment.pgp>


More information about the parted-devel mailing list