diff options
| author | Russell Bryant <rbryant@redhat.com> | 2012-07-30 11:43:48 -0400 |
|---|---|---|
| committer | Russell Bryant <rbryant@redhat.com> | 2012-07-30 20:18:38 -0400 |
| commit | 3359e31b204c9a3ac0f4d8bc400a3d7c4c3c081f (patch) | |
| tree | 7f4326f283ba8b83d5296f01e2da2051eca1d236 /nova/tests | |
| parent | 564def16ba2b684c0fbdaef1861b5fddd9ed4b5c (diff) | |
Send a full instance in revert_resize.
Change the 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: I55bdc63149c0385fbf151f4f86f40e6c7635cf63
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/compute/test_compute.py | 8 | ||||
| -rw-r--r-- | nova/tests/compute/test_rpcapi.py | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 4e1c57201..36d001966 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -1380,11 +1380,11 @@ class ComputeTestCase(BaseTestCase): self.assertEqual(instance_type_ref['flavorid'], '3') # Finally, revert and confirm the old flavor has been applied - self.compute.revert_resize(context, inst_ref['uuid'], - migration_ref['id']) + rpcinst = jsonutils.to_primitive(inst_ref) + self.compute.revert_resize(context, + migration_id=migration_ref['id'], instance=rpcinst) self.compute.finish_revert_resize(context, - migration_id=migration_ref['id'], - instance=jsonutils.to_primitive(inst_ref)) + migration_id=migration_ref['id'], instance=rpcinst) 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 f47d081be..7a1195fe0 100644 --- a/nova/tests/compute/test_rpcapi.py +++ b/nova/tests/compute/test_rpcapi.py @@ -59,8 +59,9 @@ 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', 'resume_instance', 'start_instance', - 'stop_instance', 'suspend_instance', 'unpause_instance' + 'resize_instance', 'resume_instance', 'revert_resize', + 'start_instance', 'stop_instance', 'suspend_instance', + 'unpause_instance' ] if 'rpcapi_class' in kwargs: @@ -285,7 +286,8 @@ class ComputeRpcAPITestCase(test.TestCase): def test_revert_resize(self): self._test_compute_api('revert_resize', 'cast', - instance=self.fake_instance, migration_id='id', host='host') + instance=self.fake_instance, migration_id='id', host='host', + version='1.31') def test_rollback_live_migration_at_destination(self): self._test_compute_api('rollback_live_migration_at_destination', |
