summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2011-11-02 19:36:39 +0000
committerGerrit Code Review <review@openstack.org>2011-11-02 19:36:39 +0000
commit040139ec338ea34e2d3bd526d8072cb3a8335650 (patch)
tree619e368fddaa100cb641761aecc1eac507ea5847 /nova/tests
parent54dc193e413a6c258e390bc3bcca714aa5015efe (diff)
parent057138540df2b067bd3cd2857cceb97d1ecd86d0 (diff)
Merge "APIs should not wait on scheduler for builds in single zone deployment"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/ec2/test_cloud.py5
-rw-r--r--nova/tests/api/openstack/test_servers.py8
-rw-r--r--nova/tests/test_compute.py19
3 files changed, 8 insertions, 24 deletions
diff --git a/nova/tests/api/ec2/test_cloud.py b/nova/tests/api/ec2/test_cloud.py
index c0f3d44d7..f76690831 100644
--- a/nova/tests/api/ec2/test_cloud.py
+++ b/nova/tests/api/ec2/test_cloud.py
@@ -1013,8 +1013,6 @@ class CloudTestCase(test.TestCase):
self.assertDictListUnorderedMatch(result['blockDeviceMapping'],
self._expected_bdms2, 'deviceName')
- self.stubs.UnsetAll()
-
def test_describe_image_attribute(self):
describe_image_attribute = self.cloud.describe_image_attribute
@@ -1216,6 +1214,9 @@ class CloudTestCase(test.TestCase):
self.stubs.UnsetAll()
self.stubs.Set(fake._FakeImageService, 'show', fake_show)
+ # NOTE(comstud): Make 'cast' behave like a 'call' which will
+ # ensure that operations complete
+ self.stubs.Set(rpc, 'cast', rpc.call)
result = run_instances(self.context, **kwargs)
instance = result['instancesSet'][0]
diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py
index 4518ef8e2..31c87e630 100644
--- a/nova/tests/api/openstack/test_servers.py
+++ b/nova/tests/api/openstack/test_servers.py
@@ -1354,7 +1354,7 @@ class ServersControllerCreateTest(test.TestCase):
self.instance_cache_num += 1
instance = {
'id': self.instance_cache_num,
- 'display_name': 'server_test',
+ 'display_name': inst['display_name'] or 'test',
'uuid': FAKE_UUID,
'instance_type': dict(inst_type),
'access_ip_v4': '1.2.3.4',
@@ -1390,8 +1390,10 @@ class ServersControllerCreateTest(test.TestCase):
request_spec['instance_properties']))
return instances
- def server_update(context, id, params):
- return instance_create(context, id)
+ def server_update(context, instance_id, params):
+ inst = self.instance_cache[instance_id]
+ inst.update(params)
+ return inst
def fake_method(*args, **kwargs):
pass
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index addb6084d..7295c9f1f 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -1409,25 +1409,6 @@ class ComputeTestCase(test.TestCase):
self.assertEqual(instance['reservation_id'], resv_id)
db.instance_destroy(self.context, instance['id'])
- def test_reservation_ids_two_instances_no_wait(self):
- """Verify building 2 instances at once without waiting for
- instance IDs results in a reservation_id being returned equal
- to reservation id set in both instances
- """
- (refs, resv_id) = self.compute_api.create(self.context,
- instance_types.get_default_instance_type(), None,
- min_count=2, max_count=2, wait_for_instances=False)
- try:
- self.assertEqual(refs, None)
- self.assertNotEqual(resv_id, None)
- finally:
- instances = self.compute_api.get_all(self.context,
- search_opts={'reservation_id': resv_id})
- self.assertEqual(len(instances), 2)
- for instance in instances:
- self.assertEqual(instance['reservation_id'], resv_id)
- db.instance_destroy(self.context, instance['id'])
-
def test_create_with_specified_reservation_id(self):
"""Verify building instances with a specified
reservation_id results in the correct reservation_id