summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-08-04 11:45:24 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-08-04 11:45:24 -0400
commitae6b54cc1748d7b9c7bfa55374e9355665343b82 (patch)
tree1d2e9a8f267663415847c6d3cdcba89826528dec /nova
parent9da88eac8fe728f506633f86ec6e75cf0212795b (diff)
downloadnova-ae6b54cc1748d7b9c7bfa55374e9355665343b82.tar.gz
nova-ae6b54cc1748d7b9c7bfa55374e9355665343b82.tar.xz
nova-ae6b54cc1748d7b9c7bfa55374e9355665343b82.zip
add test for spawning a xenapi instance with an empty dns list
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/test_xenapi.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py
index a795b3c74..5f3aec700 100644
--- a/nova/tests/test_xenapi.py
+++ b/nova/tests/test_xenapi.py
@@ -397,7 +397,7 @@ class XenAPIVMTestCase(test.TestCase):
instance_type_id="3", os_type="linux",
architecture="x86-64", instance_id=1,
check_injection=False,
- create_record=True):
+ create_record=True, empty_dns=False):
stubs.stubout_loopingcall_start(self.stubs)
if create_record:
values = {'id': instance_id,
@@ -426,12 +426,22 @@ class XenAPIVMTestCase(test.TestCase):
'label': 'fake',
'mac': 'DE:AD:BE:EF:00:00',
'rxtx_cap': 3})]
+ if empty_dns:
+ network_info[0][1]['dns'] = []
+
self.conn.spawn(self.context, instance, network_info)
self.create_vm_record(self.conn, os_type, instance_id)
self.check_vm_record(self.conn, check_injection)
self.assertTrue(instance.os_type)
self.assertTrue(instance.architecture)
+ def test_spawn_empty_dns(self):
+ """"Test spawning with an empty dns list"""
+ self._test_spawn(glance_stubs.FakeGlance.IMAGE_VHD, None, None,
+ os_type="linux", architecture="x86-64",
+ empty_dns=True)
+ self.check_vm_params_for_linux()
+
def test_spawn_not_enough_memory(self):
self.assertRaises(Exception,
self._test_spawn,