Merge "bug #941794 VIF and intf drivers for Quantum Linux Bridge plugin"
This commit is contained in:
1
Authors
1
Authors
@@ -163,6 +163,7 @@ Scott Moser <smoser@ubuntu.com>
|
||||
Soren Hansen <soren.hansen@rackspace.com>
|
||||
Stanislaw Pitucha <stanislaw.pitucha@hp.com>
|
||||
Stephanie Reese <reese.sm@gmail.com>
|
||||
Sumit Naiksatam <snaiksat@cisco.com>
|
||||
Thierry Carrez <thierry@openstack.org>
|
||||
Tim Simpson <tim.simpson@rackspace.com>
|
||||
Todd Willey <todd@ansolabs.com>
|
||||
|
||||
@@ -98,6 +98,7 @@ filterlist = [
|
||||
filters.CommandFilter("/sbin/ip", "root"),
|
||||
|
||||
# nova/virt/libvirt/vif.py: 'tunctl', '-b', '-t', dev
|
||||
# nova/network/linux_net.py: 'tunctl', '-b', '-t', dev
|
||||
filters.CommandFilter("/usr/sbin/tunctl", "root"),
|
||||
|
||||
# nova/virt/libvirt/vif.py: 'ovs-vsctl', ...
|
||||
|
||||
@@ -35,6 +35,7 @@ filterlist = [
|
||||
# nova/network/linux_net.py: 'ip', 'addr', 'show', 'dev', interface, ..
|
||||
# nova/network/linux_net.py: 'ip', 'link', 'set', dev, "address", ..
|
||||
# nova/network/linux_net.py: 'ip', 'link', 'set', dev, 'up'
|
||||
# nova/network/linux_net.py: 'ip', 'tuntap', 'add', dev, 'mode', 'tap'
|
||||
filters.CommandFilter("/sbin/ip", "root"),
|
||||
|
||||
# nova/network/linux_net.py: 'ip[6]tables-save' % (cmd,), '-t', ...
|
||||
|
||||
@@ -23,7 +23,9 @@ from nova.virt import firewall
|
||||
from nova.virt import vif
|
||||
from nova.virt.libvirt import connection
|
||||
from nova.virt.libvirt.vif import LibvirtBridgeDriver, \
|
||||
LibvirtOpenVswitchDriver, LibvirtOpenVswitchVirtualPortDriver
|
||||
LibvirtOpenVswitchDriver, \
|
||||
LibvirtOpenVswitchVirtualPortDriver, \
|
||||
QuantumLinuxBridgeVIFDriver
|
||||
|
||||
FLAGS = flags.FLAGS
|
||||
|
||||
@@ -157,3 +159,21 @@ class LibvirtVifTestCase(test.TestCase):
|
||||
|
||||
self.assertTrue(iface_id_found)
|
||||
d.unplug(None, self.net, self.mapping)
|
||||
|
||||
def test_quantum_bridge_ethernet_driver(self):
|
||||
d = QuantumLinuxBridgeVIFDriver()
|
||||
xml = self._get_instance_xml(d, 'ethernet')
|
||||
|
||||
doc = ElementTree.fromstring(xml)
|
||||
ret = doc.findall('./devices/interface')
|
||||
self.assertEqual(len(ret), 1)
|
||||
node = ret[0]
|
||||
self.assertEqual(node.get("type"), "ethernet")
|
||||
dev_name = node.find("target").get("dev")
|
||||
self.assertTrue(dev_name.startswith("tap"))
|
||||
mac = node.find("mac").get("address")
|
||||
self.assertEqual(mac, self.mapping['mac'])
|
||||
script = node.find("script").get("path")
|
||||
self.assertEquals(script, "")
|
||||
|
||||
d.unplug(None, self.net, self.mapping)
|
||||
|
||||
Reference in New Issue
Block a user