Пример #1
0
 def test_quantum_hybrid_driver(self):
     br_want = "qbr" + self.vif_ovs['id']
     br_want = br_want[:network_model.NIC_NAME_LEN]
     d = vif.LibvirtHybridOVSBridgeDriver(self._get_conn())
     self._check_neutron_hybrid_driver(d,
                                       self.vif_ovs_legacy,
                                       br_want)
Пример #2
0
    def test_quantum_hybrid_driver(self):
        def get_connection():
            return fakelibvirt.Connection("qemu:///session", False)

        br_want = "qbr" + self.mapping_ovs['vif_uuid']
        br_want = br_want[:network_model.NIC_NAME_LEN]
        d = vif.LibvirtHybridOVSBridgeDriver(get_connection)
        self._check_quantum_hybrid_driver(d, self.net_ovs,
                                          self.mapping_ovs_legacy, br_want)
Пример #3
0
    def test_quantum_hybrid_driver(self):
        d = vif.LibvirtHybridOVSBridgeDriver()
        xml = self._get_instance_xml(d, self.net_ovs, self.mapping_ovs)

        doc = etree.fromstring(xml)
        ret = doc.findall('./devices/interface')
        self.assertEqual(len(ret), 1)
        node = ret[0]
        self.assertEqual(node.get("type"), "bridge")
        br_name = node.find("source").get("bridge")
        self.assertEqual(br_name, self.net_ovs['bridge'])
        mac = node.find("mac").get("address")
        self.assertEqual(mac, self.mapping_ovs['mac'])