@@ -556,6 +556,12 @@ def _assertPciEqual(self, node, vif, type=None):
556556 pci_slot_want = vif ['profile' ]['pci_slot' ]
557557 self .assertEqual (pci_slot , pci_slot_want )
558558
559+ def _assertQueueSizeEquals (self , node , rx_want , tx_want ):
560+ rx_queue_size = node .find ("driver" ).get ("rx_queue_size" )
561+ tx_queue_size = node .find ("driver" ).get ("tx_queue_size" )
562+ self .assertEqual (rx_queue_size , rx_want )
563+ self .assertEqual (tx_queue_size , tx_want )
564+
559565 def _assertXmlEqual (self , expectedXmlstr , actualXmlstr ):
560566 if not isinstance (actualXmlstr , six .string_types ):
561567 actualXmlstr = etree .tostring (actualXmlstr , encoding = 'unicode' ,
@@ -1296,24 +1302,8 @@ def test_vhostuser_driver_queue_sizes(self):
12961302 self .flags (tx_queue_size = 1024 , group = 'libvirt' )
12971303 d = vif .LibvirtGenericVIFDriver ()
12981304 xml = self ._get_instance_xml (d , self .vif_vhostuser )
1299- self ._assertXmlEqual ("""
1300- <domain type="qemu">
1301- <uuid>fake-uuid</uuid>
1302- <name>fake-name</name>
1303- <memory>102400</memory>
1304- <vcpu>4</vcpu>
1305- <os>
1306- <type>None</type>
1307- </os>
1308- <devices>
1309- <interface type="vhostuser">
1310- <mac address="ca:fe:de:ad:be:ef"/>
1311- <model type="virtio"/>
1312- <driver rx_queue_size="512" tx_queue_size="1024"/>
1313- <source mode="client" path="/tmp/vif-xxx-yyy-zzz" type="unix"/>
1314- </interface>
1315- </devices>
1316- </domain>""" , xml )
1305+ node = self ._get_node (xml )
1306+ self ._assertQueueSizeEquals (node , "512" , "1024" )
13171307
13181308 def test_vhostuser_driver_no_path (self ):
13191309 d = vif .LibvirtGenericVIFDriver ()
@@ -1554,6 +1544,7 @@ def test_config_os_vif_vhostuser(self):
15541544 <model type="virtio"/>
15551545 <source mode="client"
15561546 path="/var/run/openvswitch/vhudc065497-3c" type="unix"/>
1547+ <target dev="vhudc065497-3c"/>
15571548 </interface>"""
15581549
15591550 self ._test_config_os_vif (os_vif_type , vif_type , expected_xml )
@@ -1591,6 +1582,7 @@ def test_config_os_vif_agilio_ovs_forwarder(self):
15911582 <model type="virtio"/>
15921583 <source mode="client"
15931584 path="/var/run/openvswitch/vhudc065497-3c" type="unix"/>
1585+ <target dev="nicdc065497-3c"/>
15941586 </interface>"""
15951587
15961588 self ._test_config_os_vif (os_vif_type , vif_type , expected_xml )
0 commit comments