[libvirt PATCH 1/4] test: move nodedev xml2xml output to a separate dir
jjongsma at redhat.com
Wed May 19 16:09:50 UTC 2021
On Wed, 2021-05-19 at 10:46 +0200, Michal Prívozník wrote:
> On 5/14/21 11:28 PM, Jonathon Jongsma wrote:
> > Currently, we're loading and parsing the xml from the input file,
> > and
> > then formatting it and then comparing it directly back to the input
> > file. This works for now, but is severely limiting as it relies on
> > the
> > input file being fully-specified and in the exact order as the
> > output
> > xml format.
> > If optional elements are ommitted in the input XML, the output xml
> > may include default values for the ommitted elements and thus the
> > output
> > will not match the input.
> > In order to allow more flexibility in testing, save the expected
> > output
> > to a seprate 'out' directory similar to what most of the other
> > xml2xml
> > tests are already doing.
> > Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> > ---
> Fair enough - we have plenty of examples around, qemuxml2xmloutdata/
> name the biggest one. However, what we also do (to save disk space)
> to turn those files where input XML is the same as output XML into
> symlinks. I've identified a few which could be just a symlink:
> tests/nodedevxml2xmlout $ for i in *; do if diff $i
> ../nodedevschemadata/$i >/dev/null ; then echo $i; fi; done
> I know you are modifying some of these files (mdev*), that's why I
> the command only after all your patches. For these patches we could
> everything a symlink in 1/4 and then as we need to make changes (in
> and 3/4) remove those symlinks and make regular copies.
> Do you think it's worth doing? If so, no need to resend, it's
> I can fix before pushing. Plus marking @outfile variable in
> testCompareXMLToXMLHelper() as g_autofree (thanks to Pavel who
Sure, that's fine with me. The vast majority of these files are staying
the same (which is why the tests currently pass -- the output is
identical to the input). So symlinks should be fine for those.
More information about the libvir-list