Re: [PATCH v2 3/7] tests: qemuxml2argv: Add infrastructure for testing with real qemuCaps

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

 



On Wed, 2018-04-18 at 13:44 +0200, Peter Krempa wrote:
> On Wed, Apr 18, 2018 at 13:09:52 +0200, Ján Tomko wrote:
> > Even introducting new capabilities could cause libvirt to take different
> > code paths, therefore we should prefer DO_TEST_CAPS_VER.
> 
> This is actually the exact reason why I think DO_TEST_CAPS_NEW is better
> than DO_TEST_CAPS_VER. If we do changes to code used in multiple places
> which are gated on presence of a capability, the places using
> DO_TEST_CAPS_VER could change without us being able to catch that.

A note on naming: both the macro and the output file should use the
world "latest" rather than "new" to be more informative and avoid
any confusion.

> > I do not find DO_TEST_CAPS_NEW that beneficial - if QEMU introduced a
> > new capability that needs to be handled by libvirt, the code author
> > should introduce a new DO_TEST_CAPS_VER test for that.
> 
> In such reason, the author adding the code should fork the test by
> adding a DO_TEST_CAPS_VER along with the existing DO_TEST_CAPS_NEW and
> then add the new capability bit. With such approach it will be even
> visible which options changed.
> 
> > Otherwise it would just be checking whether QEMU did not break something
> > for us. And since the soonest we update capabilities is at the time of
> 
> Actually no. It will also check that something other will not break:
> 
> https://www.redhat.com/archives/libvir-list/2018-April/msg01066.html
> tried to introduce a new property for the memory-backing-file object.
> This object is used in multiple places. The property is gated by a
> capability bit. Our tests were not able to catch, that this would add
> the property to the NVDIMM device which needs to persist the data, which
> would actually break it.
> 
> While I agree that DO_TEST_CAPS_VER is very useful for checking old
> command line, I think that the true value is also in DO_TEST_CAPS_NEW
> when used together with DO_TEST_CAPS_VER, so when a new addition would
> change some tests using DO_TEST_CAPS_NEW we should fork them to cover
> both recent and old versions.

I think using real-life capabilities instead of the syntetic data
we use now is a step in the right direction.

I'm still a bit uneasy about the "moving target" factor, though
I've spent some time trying to come up with possible failure
scenarios without much success...

I think ideally with each new feature the author would introduce
three tests: a negative one locked to a QEMU version that doesn't
have the required bits, a positive one locked to a QEMU version
that has them, and a positive one against the latest QEMU version.

This way, we would make sure both that new QEMU versions work
correctly with the feature and that changes in libvirt don't
affect the behavior for existing QEMU versions.

Does that sound reasonable?

-- 
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