[parted-devel] Adding a test for ticket #22 (resizing ext2 partitions)

Jim Meyering jim at meyering.net
Thu May 31 06:43:10 UTC 2007


"Matt Davis" <mattdavis9 at gmail.com> wrote:
...
> 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.

> +test_description='Test to check if resizing a ext2 parition fails.'
> +
> +. ./init.sh
> +
> +# create a file of size N bytes
> +N=128M

Thanks for adding a test too.
I haven't tried running it yet, but noticed your comment saying 320M
or greater, yet the test itself uses a smaller size: 128M

Please change your lines like this:

    test_expect_success 'check for mklabel succsess' '$compare out /dev/null'

to read something like this:

    test_expect_success 'check for empty output' '$compare out /dev/null'

The test that runs the command checks for success.
In a way, the "check for empty output" part is a little redundant,
but a good safety check, in case a tool ever outputs a diagnostic
even though its exit status mistakenly indicates success.

Also, please remove this section:

    > +../parted/parted --version > /dev/null 2>&1
    > +if test $? != 0; then
    > +  echo >&2 'You have not built parted yet.'
    > +  exit 1
    > +fi
    > +

That belongs only in the very first test, t0000.



More information about the parted-devel mailing list