summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-07-20 15:58:49 -0400
committerRussell Bryant <rbryant@redhat.com>2012-07-25 20:00:45 -0400
commit1d0362929d2bbb39a5665b0d0ce9972ca66c643b (patch)
tree32be2f7116052c8c055a332c7adc10863d9e91d8 /nova/tests
parent94018d1f753d62ba75f3262f2c2fcdb1ee7f731b (diff)
Send a full instance via rpc for suspend_instance.
Change the suspend_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: If881fb419a52a2486b2e7b85b4d58a17f72c48a6
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/compute/test_compute.py3
-rw-r--r--nova/tests/compute/test_rpcapi.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 0c4d07e8e..63af3813b 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -503,7 +503,8 @@ class ComputeTestCase(BaseTestCase):
instance = self._create_fake_instance()
instance_uuid = instance['uuid']
self.compute.run_instance(self.context, instance_uuid)
- self.compute.suspend_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.terminate_instance(self.context, instance_uuid)
diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py
index 72942d352..5c0fcd006 100644
--- a/nova/tests/compute/test_rpcapi.py
+++ b/nova/tests/compute/test_rpcapi.py
@@ -49,7 +49,8 @@ class ComputeRpcAPITestCase(test.TestCase):
ctxt = context.RequestContext('fake_user', 'fake_project')
methods_with_instance = [
- 'pause_instance', 'reboot_instance', 'unpause_instance'
+ 'pause_instance', 'reboot_instance', 'suspend_instance',
+ 'unpause_instance'
]
if 'rpcapi_class' in kwargs:
@@ -310,7 +311,7 @@ class ComputeRpcAPITestCase(test.TestCase):
def test_suspend_instance(self):
self._test_compute_api('suspend_instance', 'cast',
- instance=self.fake_instance)
+ instance=self.fake_instance, version='1.6')
def test_terminate_instance(self):
self._test_compute_api('terminate_instance', 'cast',