[parted-devel] [PATCH] master branch

Jim Meyering jim at meyering.net
Sun May 17 17:03:53 UTC 2009


Joel Granados Moreno wrote:
> This is a patch set that I have had in my git repo for some time now.  I
> really think these should go in.  They are already in fedora.
>
> One of these patches still has an unanswered comment from Otavio.  The
> suggestion was to split a commit to increase readability of the patches.
> I still think that this should not be done.  My additional reasons,
> besides the ones I have already given in the previous thread with
> Otavio, is that splitting the commit requires the addition of an ifdef
> (and closing statement) that will immediately get erased once the move
> is done.  This, to me, seems illogical.  I strongly suggest that this
> patch remain as is. (691793483b48362f968d9567f2bf3656c9ba4e4e)
>
> The patches have a pretty good explination in the commit messages.  I do
> want to address one issue that I encountered while I was doing the test
> for the msdos-starting-sector patch.  I noticed that I need to use
> $(pwd) in the output strings.  I did not notice this in any other tests.
> If someone knows of a better way of formating that test, I am open to
> suggestions.

One must not mention $(pwd) like that because it
will cause test failures when pwd prints a name
that's different from what parted computes.

Model your test after one of these:

    $ git grep Model: tests
    tests/t0100-print.sh:Model:  (file)
    tests/t4100-dvh-partition-limits.sh:Model:  (file)
    tests/t4100-msdos-partition-limits.sh:Model:  (file)
    tests/t5000-tags.sh:Model:  (file)
    tests/t5000-tags.sh:Model:  (file)
    tests/t6000-dm.sh:Model: Linux device-mapper (linear) (dm)
    tests/t6000-dm.sh:Model: Linux device-mapper (multipath) (dm)

They should all filter out the Disk.*: part:

    test_expect_success \
        'print the result' \
        'parted -s $dev unit s p > out 2>&1 &&
         sed "s/Disk .*:/Disk:/;s/ *$//" out > k && mv k out &&
         diff -u out exp
        '

Better still, look at e.g., tests/t5000-tags.sh on the "next" branch.
It uses parted's -m option, to further reduce risk of spurious failures
due to format-related output mismatch:

    test_expect_success \
        'print the table (before adding a partition)' \
        'parted -m -s $dev unit s print > t 2>&1 &&
         sed 's,.*/$dev:,$dev:,' t > out'



More information about the parted-devel mailing list