Ejemplo n.º 1
0
 def testCreateSRIOVVF(self):
     dev_spec = {'type': hwclass.NIC, 'device': 'hostdev',
                 'hostdev': _SRIOV_VF, 'macAddr': 'ff:ff:ff:ff:ff:ff',
                 'specParams': {'vlanid': 3},
                 'bootOrder': '9'}
     device = network.Interface(self.conf, self.log, **dev_spec)
     self.assertXMLEqual(device.getXML().toxml(),
                         _DEVICE_XML[_SRIOV_VF] % ('',))
Ejemplo n.º 2
0
 def testCreateSRIOVVFWithAddress(self):
     dev_spec = {'type': hwclass.NIC, 'device': 'hostdev',
                 'hostdev': _SRIOV_VF, 'macAddr': 'ff:ff:ff:ff:ff:ff',
                 'specParams': {'vlanid': 3},
                 'bootOrder': '9', 'address':
                 {'slot': '0x02', 'bus': '0x01', 'domain': '0x0000',
                  'function': '0x0', 'type': 'pci'}}
     device = network.Interface(self.conf, self.log, **dev_spec)
     self.assertXMLEqual(
         device.getXML().toxml(),
         _DEVICE_XML[_SRIOV_VF] % (self._PCI_ADDRESS_XML))