Re: [virt-manager PATCH 2/3] tests: Add test for vhostuser

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

 



On 10/20/2017 11:08 AM, Lin Ma wrote:
> Signed-off-by: Lin Ma <lma@xxxxxxxx>
> ---
>  tests/xmlparse-xml/add-devices-out.xml |  5 +++++
>  tests/xmlparse.py                      | 12 ++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/tests/xmlparse-xml/add-devices-out.xml b/tests/xmlparse-xml/add-devices-out.xml
> index e7e153b..563c8da 100644
> --- a/tests/xmlparse-xml/add-devices-out.xml
> +++ b/tests/xmlparse-xml/add-devices-out.xml
> @@ -44,6 +44,11 @@
>        <mac address="1A:2A:3A:4A:5A:6A"/>
>        <address type="spapr-vio"/>
>      </interface>
> +    <interface type="vhostuser">
> +      <source type="unix" path="/tmp/vhost1.sock" mode="server"/>
> +      <mac address="00:11:22:33:44:66"/>
> +      <model type="virtio"/>
> +    </interface>
>      <watchdog model="i6300esb" action="reset"/>
>    </devices>
>    <seclabel type="static" model="selinux">
> diff --git a/tests/xmlparse.py b/tests/xmlparse.py
> index 1cceebc..90e399a 100644
> --- a/tests/xmlparse.py
> +++ b/tests/xmlparse.py
> @@ -968,6 +968,18 @@ class XMLParseTest(unittest.TestCase):
>          guest.remove_device(adddev)
>          guest.add_device(adddev)
>  
> +        adddev1 = virtinst.VirtualNetworkInterface(conn=conn)
> +        adddev1.type = "vhostuser"
> +        adddev1.source_type = "unix"
> +        adddev1.source_mode = "server"
> +        adddev1.source_path = "/tmp/vhost1.sock"
> +        adddev1.model = "virtio"
> +        adddev1.macaddr = "00:11:22:33:44:66"
> +
> +        guest.add_device(adddev1)
> +        guest.remove_device(adddev1)
> +        guest.add_device(adddev1)
> +
>          guest.add_device(virtinst.VirtualAudio(conn,
>              parsexml="""<sound model='pcspk'/>"""))
>  
> 

This doesn't really add any code coverage; XML building for vhostuser is
already tested via clitest, and there isn't anything special about
adding/removing the device here. This patch isn't needed IMO

(I pushed a patch with comments explaining the particular bits that
AddRemoveDevice are actually testing which hopefully explains things better)

Thanks,
Cole

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux