[libvirt] [PATCH 2/3] tests: Use WHEN_BOTH in qemuxml2xml whenever possible

Andrea Bolognani abologna at redhat.com
Fri Mar 1 15:57:32 UTC 2019


On Fri, 2019-03-01 at 14:59 +0100, Ján Tomko wrote:
> On Thu, Feb 28, 2019 at 05:38:46PM +0100, Andrea Bolognani wrote:
[...]
> > +++ b/tests/qemuxml2xmloutdata/channel-unix-source-path-active.xml
> > @@ -22,14 +22,17 @@
> >       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
> >     </controller>
> >     <channel type='unix'>
> > +      <source mode='bind' path='/tmp/channel/QEMUGuest1.org.qemu.guest_agent.0'/>
> 
> This checks that we correctly omit the auto-generated channel paths from
> inactive XML.

And having the active version side-by-side makes their absence more
obvious, no? So this still seems valuable.

[...]
> > +++ b/tests/qemuxml2xmloutdata/disk-active-commit-inactive.xml
> > @@ -1,4 +1,4 @@
> > -<domain type='qemu' id='1'>
> > +<domain type='qemu'>
> >   <name>QEMUGuest1</name>
> >   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> >   <memory unit='KiB'>219136</memory>
> > @@ -17,15 +17,11 @@
> >     <disk type='file' device='disk'>
> >       <driver name='qemu' type='qcow2'/>
> >       <source file='/tmp/HostVG/QEMUGuest1-snap'/>
> > -      <backingStore type='block' index='1'>
> > +      <backingStore type='block'>
> >         <format type='raw'/>
> >         <source dev='/dev/HostVG/QEMUGuest1'/>
> >         <backingStore/>
> >       </backingStore>
> > -      <mirror type='block' job='active-commit'>
> > -        <format type='raw'/>
> > -        <source dev='/dev/HostVG/QEMUGuest1'/>
> > -      </mirror>
> 
> Checking active-commit in inactive XML does not seem useful either.

Again, it highlights the fact that the active commit feature is, as
the name suggests, only useful for the active XML :)

[...]
> > +++ b/tests/qemuxml2xmloutdata/seclabel-static-labelskip-inactive.xml
> > @@ -1,4 +1,4 @@
> > -<domain type='qemu' id='1'>
> > +<domain type='qemu'>
> >   <name>QEMUGuest1</name>
> >   <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> >   <memory unit='KiB'>219100</memory>
> > @@ -16,9 +16,7 @@
> >     <emulator>/usr/bin/qemu-system-i686</emulator>
> >     <disk type='block' device='disk'>
> >       <driver name='qemu' type='raw'/>
> > -      <source dev='/dev/HostVG/QEMUGuest1'>
> > -        <seclabel model='selinux' labelskip='yes'/>
> > -      </source>
> > +      <source dev='/dev/HostVG/QEMUGuest1'/>
> 
> And labelskip is an active-XML only feature.

Same as above.

Basically I see no reason not to cover both active and inactive
when possible, because even when the feature is only going to
manifest itself only in one of the two output files, the fact that
it does *not* show up in the other one represent some amount of
useful (negative) coverage.

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list