summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2013-01-04 12:44:00 +0000
committerDaniel P. Berrange <berrange@redhat.com>2013-01-15 09:56:23 +0000
commitfa96bbf489fac8d16104d51c393d3d7777e0c65c (patch)
tree08661ab4ea8874ead7a3ecbb70257a8a507fa3ca /nova/tests
parent8fddd6ad445586dc2c59ace0b292ff9da7048561 (diff)
Add 'devname' to nova.network.model.VIF class
Add a 'devname' field to nova.network.model.VIF to allow network drivers to specify a desired TAP device name. Update the Quantum driver to set a device name, and update the libvirt VIF drivers to honour it. Blueprint: libvirt-vif-driver Change-Id: Ia8dd546af36e7f6c22efd7c696fb58b37aac0061 Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/network/test_manager.py1
-rw-r--r--nova/tests/test_libvirt_vif.py3
-rw-r--r--nova/tests/utils.py3
3 files changed, 6 insertions, 1 deletions
diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py
index 385aea1ee..1552630fb 100644
--- a/nova/tests/network/test_manager.py
+++ b/nova/tests/network/test_manager.py
@@ -186,6 +186,7 @@ class FlatNetworkTestCase(test.TestCase):
'mac': 'DE:AD:BE:EF:00:%02x' % nid,
'rxtx_cap': 30,
'vif_type': net_model.VIF_TYPE_BRIDGE,
+ 'vif_devname': None,
'vif_uuid':
'00000000-0000-0000-0000-00000000000000%02d' % nid,
'should_create_vlan': False,
diff --git a/nova/tests/test_libvirt_vif.py b/nova/tests/test_libvirt_vif.py
index 9271afb13..11ffa020f 100644
--- a/nova/tests/test_libvirt_vif.py
+++ b/nova/tests/test_libvirt_vif.py
@@ -47,7 +47,8 @@ class LibvirtVifTestCase(test.TestCase):
'gateway_v6': net['gateway_v6'],
'ips': [{'ip': '101.168.1.9'}],
'dhcp_server': '191.168.1.1',
- 'vif_uuid': 'vif-xxx-yyy-zzz'
+ 'vif_uuid': 'vif-xxx-yyy-zzz',
+ 'vif_devname': 'tap-xxx-yyy-zzz'
}
instance = {
diff --git a/nova/tests/utils.py b/nova/tests/utils.py
index 00b70ceb3..6437f9537 100644
--- a/nova/tests/utils.py
+++ b/nova/tests/utils.py
@@ -20,6 +20,7 @@ import nova.context
import nova.db
from nova.image import glance
from nova.network import minidns
+from nova.network import model as network_model
from nova.openstack.common import cfg
CONF = cfg.CONF
@@ -91,6 +92,8 @@ def get_test_network_info(count=1):
'bridge_interface': fake_bridge_interface,
'injected': False}
mapping = {'mac': fake,
+ 'vif_type': network_model.VIF_TYPE_BRIDGE,
+ 'vif_uuid': 'vif-xxx-yyy-zzz',
'dhcp_server': fake,
'dns': ['fake1', 'fake2'],
'gateway': fake,