Re: [PATCH 12/12] tests: qemuxml2xml: Add DO_TEST_CAPS*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2019-04-11 at 14:15 +0200, Ján Tomko wrote:
> On Thu, Apr 11, 2019 at 12:44:16PM +0200, Andrea Bolognani wrote:
> > On Mon, 2019-04-01 at 12:47 -0400, Cole Robinson wrote:
> > >      if (virAsprintf(&info->outfile,
> > > -                    "%s/qemuxml2xmloutdata/%s-%s.xml",
> > > +                    "%s/qemuxml2xmloutdata/%s-%s%s.xml",
> 
> I'd definitely put another minus between these suffixes (also, I'd like
> to see them in use).

Looking at xml2argv, and as I suggested the implementation should be
the same in xml2xml, we have

  # define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \
      DO_TEST_INTERNAL(name, "." arch "-" ver, \
                       ARG_CAPS_ARCH, arch, \
                       ARG_CAPS_VER, ver, \
                       __VA_ARGS__)

  # define DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ...) \
      DO_TEST_CAPS_INTERNAL(name, arch, "latest", __VA_ARGS__)

  # define DO_TEST_CAPS_ARCH_LATEST(name, arch) \
      DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, ARG_END)

  # define DO_TEST_CAPS_LATEST(name) \
      DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")

so when you use
  
    DO_TEST_CAPS_LATEST("virtio-transitional");

'suffix' will be ".x86_64-latest" and the resulting filename
will be

  qemuxml2xmloutdata/virtio-transitional.x86_64-latest.xml

If you had a similar test for WHEN_ACTIVE only, then you'd get

  qemuxml2xmloutdata/virtio-transitional-active.x86_64-latest.xml

It doesn't look to me like any extra separators are necessary.

[...]
> > None of the above is really connected to whether or not we should
> > use 'suffix' as I suggested earlier: we should definitely format it,
> > even if it causes test suite churn. Not only that: you should also
> > make sure...
> 
> The reason for the suffix in xml2argv is to allow the CAPS_LATEST tests
> to coexist with the ones with enumerated capabilities.
> 
> But it also contains the architecture, so even if -latest would be the
> prevailing case, I'd rather format it anyway.

Looks like we agree then :)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux