summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-04 23:33:44 +0000
committerGerrit Code Review <review@openstack.org>2013-02-04 23:33:44 +0000
commit9fbc5688dcbb2cad6258a38ecd54fe0462af2fb4 (patch)
tree5ffd63595b7e1d4d094a8b260632d244ac7829a8 /nova/tests
parentfe826317ad3122c07e7c74e72e759ef0d7325066 (diff)
parent194b23c422b4120db8a9c2e16d2371fc31092a6b (diff)
Merge "Merge LibvirtOpenVswitchDriver class into LibvirtGenericVIFDriver"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_libvirt_vif.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/nova/tests/test_libvirt_vif.py b/nova/tests/test_libvirt_vif.py
index 58504dcd8..6a3530588 100644
--- a/nova/tests/test_libvirt_vif.py
+++ b/nova/tests/test_libvirt_vif.py
@@ -98,9 +98,18 @@ class LibvirtVifTestCase(test.TestCase):
'dhcp_server': '191.168.1.1',
'vif_uuid': 'vif-xxx-yyy-zzz',
'vif_devname': 'tap-xxx-yyy-zzz',
+ 'vif_type': network_model.VIF_TYPE_OVS,
'ovs_interfaceid': 'aaa-bbb-ccc',
}
+ mapping_ovs_legacy = {
+ 'mac': 'ca:fe:de:ad:be:ef',
+ 'gateway_v6': net_ovs['gateway_v6'],
+ 'ips': [{'ip': '101.168.1.9'}],
+ 'dhcp_server': '191.168.1.1',
+ 'vif_uuid': 'vif-xxx-yyy-zzz',
+ }
+
mapping_none = {
'mac': 'ca:fe:de:ad:be:ef',
'gateway_v6': net_bridge['gateway_v6'],
@@ -300,11 +309,8 @@ class LibvirtVifTestCase(test.TestCase):
self.mapping_bridge_quantum,
br_want)
- def test_ovs_ethernet_driver(self):
- d = vif.LibvirtOpenVswitchDriver()
- xml = self._get_instance_xml(d,
- self.net_ovs,
- self.mapping_ovs)
+ def _check_ovs_ethernet_driver(self, d, net, mapping):
+ xml = self._get_instance_xml(d, net, mapping)
doc = etree.fromstring(xml)
ret = doc.findall('./devices/interface')
@@ -318,6 +324,18 @@ class LibvirtVifTestCase(test.TestCase):
script = node.find("script").get("path")
self.assertEquals(script, "")
+ def test_ovs_ethernet_driver(self):
+ d = vif.LibvirtOpenVswitchDriver()
+ self._check_ovs_ethernet_driver(d,
+ self.net_ovs,
+ self.mapping_ovs_legacy)
+
+ def test_ovs_ethernet_driver(self):
+ d = vif.LibvirtGenericVIFDriver()
+ self._check_ovs_ethernet_driver(d,
+ self.net_ovs,
+ self.mapping_ovs)
+
def test_ovs_virtualport_driver(self):
d = vif.LibvirtOpenVswitchVirtualPortDriver()
xml = self._get_instance_xml(d,