summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPádraig Brady <pbrady@redhat.com>2012-02-10 16:09:07 +0000
committerPádraig Brady <pbrady@redhat.com>2012-02-10 16:09:30 +0000
commit758ee2b84c36aec1665de7ab477e43a5899679c5 (patch)
tree10f2a21295f586640e2db2e41af7560f2edd3548
parent5ad971810aaedcf5c9efd1b56add0e23921899ae (diff)
downloadnova-758ee2b84c36aec1665de7ab477e43a5899679c5.tar.gz
nova-758ee2b84c36aec1665de7ab477e43a5899679c5.tar.xz
nova-758ee2b84c36aec1665de7ab477e43a5899679c5.zip
fix FlatNetworkTestCase.test_get_instance_nw_info
Most of this function was bypassed and the bypassed portion contained syntax errors. So reneable the skipped branch and adjust to pass. Change-Id: I364ccfbe5be5bc050ba0004133f353beed97fae7
-rw-r--r--nova/tests/test_network.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py
index 200251b7e..45d0b947b 100644
--- a/nova/tests/test_network.py
+++ b/nova/tests/test_network.py
@@ -143,43 +143,46 @@ class FlatNetworkTestCase(test.TestCase):
nw_info = fake_get_instance_nw_info(self.stubs, 0, 2)
self.assertFalse(nw_info)
+ nw_info = fake_get_instance_nw_info(self.stubs, 1, 2)
+
for i, (nw, info) in enumerate(nw_info):
check = {'bridge': 'fake_br%d' % i,
'cidr': '192.168.%s.0/24' % i,
- 'cidr_v6': '2001:db8:0:%x::/64' % i,
- 'id': i,
+ 'cidr_v6': 'DONTCARE',
+ 'id': 'DONTCARE',
'multi_host': False,
'injected': False,
- 'bridge_interface': 'fake_eth%d' % i,
+ 'bridge_interface': 'DONTCARE',
'vlan': None}
self.assertDictMatch(nw, check)
check = {'broadcast': '192.168.%d.255' % i,
'dhcp_server': '192.168.%d.1' % i,
- 'dns': ['192.168.%d.3' % n, '192.168.%d.4' % n],
+ 'dns': 'DONTCARE',
'gateway': '192.168.%d.1' % i,
- 'gateway_v6': '2001:db8:0:%x::1' % i,
+ 'gateway_v6': 'DONTCARE',
'ip6s': 'DONTCARE',
'ips': 'DONTCARE',
'label': 'test%d' % i,
'mac': 'DE:AD:BE:EF:00:%02x' % i,
- 'rxtx_cap': "%d" % i * 3,
'vif_uuid':
'00000000-0000-0000-0000-00000000000000%02d' % i,
- 'rxtx_cap': 3,
+ 'rxtx_cap': 0,
'should_create_vlan': False,
'should_create_bridge': False}
self.assertDictMatch(info, check)
check = [{'enabled': 'DONTCARE',
- 'ip': '2001:db8::dcad:beff:feef:%s' % i,
- 'netmask': '64'}]
+ 'ip': 'DONTCARE',
+ 'gateway': 'DONTCARE',
+ 'netmask': 64}]
self.assertDictListMatch(info['ip6s'], check)
num_fixed_ips = len(info['ips'])
check = [{'enabled': 'DONTCARE',
'ip': '192.168.%d.1%02d' % (i, ip_num),
+ 'gateway': 'DONTCARE',
'netmask': '255.255.255.0'}
for ip_num in xrange(num_fixed_ips)]
self.assertDictListMatch(info['ips'], check)