summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-07-30 11:26:25 -0400
committerRussell Bryant <rbryant@redhat.com>2012-07-30 20:18:38 -0400
commit564def16ba2b684c0fbdaef1861b5fddd9ed4b5c (patch)
treecc909b0d204956fc9ad4e1a2bddd0c87ddb23410 /nova/tests
parent9302771de4324ac86aad4a8ec0dfe13d4ec3a0cc (diff)
Send a full instance in resume_instance.
Change the resume_instance method of the compute rpc API to take a full instance over rpc instead of just the instance UUID. This cuts down on database access needed by nova-compute. Part of blueprint no-db-messaging. Change-Id: I57789eab047de7ff9b84e2bb5367139a9a7b8e40
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/compute/test_compute.py7
-rw-r--r--nova/tests/compute/test_rpcapi.py6
2 files changed, 6 insertions, 7 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 831763f13..4e1c57201 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -499,12 +499,11 @@ class ComputeTestCase(BaseTestCase):
def test_suspend(self):
"""ensure instance can be suspended and resumed"""
- instance = self._create_fake_instance()
+ instance = jsonutils.to_primitive(self._create_fake_instance())
instance_uuid = instance['uuid']
self.compute.run_instance(self.context, instance_uuid)
- self.compute.suspend_instance(self.context,
- instance=jsonutils.to_primitive(instance))
- self.compute.resume_instance(self.context, instance_uuid)
+ self.compute.suspend_instance(self.context, instance=instance)
+ self.compute.resume_instance(self.context, instance=instance)
self.compute.terminate_instance(self.context, instance_uuid)
def test_suspend_error(self):
diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py
index 8defc7608..f47d081be 100644
--- a/nova/tests/compute/test_rpcapi.py
+++ b/nova/tests/compute/test_rpcapi.py
@@ -59,8 +59,8 @@ class ComputeRpcAPITestCase(test.TestCase):
'power_on_instance', 'pre_live_migration', 'reboot_instance',
'rebuild_instance', 'remove_fixed_ip_from_instance',
'remove_volume_connection', 'rescue_instance', 'reset_network',
- 'resize_instance', 'start_instance', 'stop_instance',
- 'suspend_instance', 'unpause_instance'
+ 'resize_instance', 'resume_instance', 'start_instance',
+ 'stop_instance', 'suspend_instance', 'unpause_instance'
]
if 'rpcapi_class' in kwargs:
@@ -281,7 +281,7 @@ class ComputeRpcAPITestCase(test.TestCase):
def test_resume_instance(self):
self._test_compute_api('resume_instance', 'cast',
- instance=self.fake_instance)
+ instance=self.fake_instance, version='1.30')
def test_revert_resize(self):
self._test_compute_api('revert_resize', 'cast',