summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-07-26 12:56:46 -0400
committerRussell Bryant <rbryant@redhat.com>2012-07-26 18:46:32 -0400
commiteba4be81a17ada6da228659db7bad2c346e02db8 (patch)
tree2f546fdf91f98cc00630c93bb563ca529edb5037 /nova/tests
parent151017385a03b6652f28965001c893fd4d57b6fb (diff)
Send a full instance via rpc for finish_revert_resize.
Change the finish_revert_resize 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: Ibe2f8b990cc8f2a3d05e8ba8216a1e74cbcfb67b
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/compute/test_compute.py5
-rw-r--r--nova/tests/compute/test_rpcapi.py6
2 files changed, 7 insertions, 4 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 90493b977..591b2ebd4 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -1376,8 +1376,9 @@ class ComputeTestCase(BaseTestCase):
# Finally, revert and confirm the old flavor has been applied
self.compute.revert_resize(context, inst_ref['uuid'],
migration_ref['id'])
- self.compute.finish_revert_resize(context, inst_ref['uuid'],
- migration_ref['id'])
+ self.compute.finish_revert_resize(context,
+ migration_id=migration_ref['id'],
+ instance=jsonutils.to_primitive(inst_ref))
instance = db.instance_get_by_uuid(context, instance['uuid'])
self.assertEqual(instance['vm_state'], vm_states.ACTIVE)
diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py
index 6bac3c99f..427acf949 100644
--- a/nova/tests/compute/test_rpcapi.py
+++ b/nova/tests/compute/test_rpcapi.py
@@ -52,7 +52,8 @@ class ComputeRpcAPITestCase(test.TestCase):
'add_fixed_ip_to_instance', 'attach_volume',
'check_can_live_migrate_destination',
'check_can_live_migrate_source', 'confirm_resize',
- 'detach_volume', 'finish_resize', 'get_console_output',
+ 'detach_volume', 'finish_resize', 'finish_revert_resize',
+ 'get_console_output',
'pause_instance', 'reboot_instance', 'suspend_instance',
'unpause_instance'
]
@@ -166,7 +167,8 @@ class ComputeRpcAPITestCase(test.TestCase):
def test_finish_revert_resize(self):
self._test_compute_api('finish_revert_resize', 'cast',
- instance=self.fake_instance, migration_id='id', host='host')
+ instance=self.fake_instance, migration_id='id', host='host',
+ version='1.15')
def test_get_console_output(self):
self._test_compute_api('get_console_output', 'call',