예제 #1
0
 def _enable_interfaces(self, index, vfs, cfg):
     vpath = self.ovs_properties.get("vpath", "/usr/local")
     vf = self.networks[vfs[0]]
     port_num = vf.get('port_num', 0)
     vpci = PciAddress.parse_address(vf['vpci'].strip(), multi_line=True)
     # Generate the vpci for the interfaces
     slot = index + port_num + 10
     vf['vpci'] = \
         "{}:{}:{:02x}.{}".format(vpci.domain, vpci.bus, slot, vpci.function)
     Libvirt.add_ovs_interface(vpath, port_num, vf['vpci'], vf['mac'],
                               str(cfg))
예제 #2
0
 def test_add_ovs_interfaces(self, mock_et, mock_add_interface_address):
     pci_address = PciAddress.parse_address("0000:00:04.0", multi_line=True)
     result = Libvirt.add_ovs_interface("/usr/local", 0, "0000:00:04.0",
                                        "00:00:00:00:00:01", "xml")
     self.assertIsNone(result)