summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-07-27 15:13:39 -0400
committerRussell Bryant <rbryant@redhat.com>2012-07-30 20:18:38 -0400
commit697f2bddf0e21368c69f13d0ec4e43df17d7f330 (patch)
tree5c07846e8750cd92ca4ab0b4f4294d81c58635ec /nova/tests
parent73af6fa9722b720923002f62e115d84b74c9fe33 (diff)
Send a full instance in rescue_instance.
Change the rescue_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: I559bd45a8dda4537f6f4a3b8d744095291c7f058
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/compute/test_compute.py4
-rw-r--r--nova/tests/compute/test_rpcapi.py7
2 files changed, 6 insertions, 5 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 27f0eb565..de02a9d85 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -441,10 +441,10 @@ class ComputeTestCase(BaseTestCase):
self.stubs.Set(nova.virt.fake.FakeDriver, 'unrescue',
fake_unrescue)
- 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.rescue_instance(self.context, instance_uuid)
+ self.compute.rescue_instance(self.context, instance=instance)
self.assertTrue(called['rescued'])
self.compute.unrescue_instance(self.context, instance_uuid)
self.assertTrue(called['unrescued'])
diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py
index edfbc309b..27d379eed 100644
--- a/nova/tests/compute/test_rpcapi.py
+++ b/nova/tests/compute/test_rpcapi.py
@@ -58,8 +58,8 @@ class ComputeRpcAPITestCase(test.TestCase):
'post_live_migration_at_destination', 'power_off_instance',
'power_on_instance', 'pre_live_migration', 'reboot_instance',
'rebuild_instance', 'remove_fixed_ip_from_instance',
- 'remove_volume_connection', 'start_instance', 'stop_instance',
- 'suspend_instance', 'unpause_instance'
+ 'remove_volume_connection', 'rescue_instance', 'start_instance',
+ 'stop_instance', 'suspend_instance', 'unpause_instance'
]
if 'rpcapi_class' in kwargs:
@@ -266,7 +266,8 @@ class ComputeRpcAPITestCase(test.TestCase):
def test_rescue_instance(self):
self._test_compute_api('rescue_instance', 'cast',
- instance=self.fake_instance, rescue_password='pw')
+ instance=self.fake_instance, rescue_password='pw',
+ version='1.27')
def test_reset_network(self):
self._test_compute_api('reset_network', 'cast',