diff options
| author | Russell Bryant <rbryant@redhat.com> | 2012-05-29 18:28:09 -0400 |
|---|---|---|
| committer | Russell Bryant <rbryant@redhat.com> | 2012-05-31 15:19:31 -0400 |
| commit | 3a829e3543b8a346fce95f71cd51f68e7c4aae41 (patch) | |
| tree | a625abff77559825d5cf8e72b50dffb1e9425cc3 /nova/tests | |
| parent | 18108a0143df0847fe1a4b105b787ca9ca76f422 (diff) | |
Add rollback_live_migration_at_destination() to compute rpcapi.
Part of bug 1006467.
This patch adds rollback_live_migration_at_destination() to the compute
rpcapi. This method is used by the compute manager.
Change-Id: Iadbb50fc5cb0f7b5ad483d48666bc81e033ac5f4
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/compute/test_rpcapi.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py index cb50bc39a..95edb3622 100644 --- a/nova/tests/compute/test_rpcapi.py +++ b/nova/tests/compute/test_rpcapi.py @@ -31,7 +31,12 @@ FLAGS = flags.FLAGS class ComputeRpcAPITestCase(test.TestCase): def setUp(self): - self.fake_instance = {'uuid': 'fake_uuid', 'host': 'fake_host'} + self.fake_instance = { + 'uuid': 'fake_uuid', + 'host': 'fake_host', + 'name': 'fake_name', + 'id': 'fake_id', + } super(ComputeRpcAPITestCase, self).setUp() def tearDown(self): @@ -41,6 +46,7 @@ class ComputeRpcAPITestCase(test.TestCase): ctxt = context.RequestContext('fake_user', 'fake_project') rpcapi = compute_rpcapi.ComputeAPI() expected_retval = 'foo' if method == 'call' else None + expected_msg = rpcapi.make_msg(method, **kwargs) if 'host_param' in expected_msg['args']: host_param = expected_msg['args']['host_param'] @@ -51,8 +57,13 @@ class ComputeRpcAPITestCase(test.TestCase): if 'instance' in expected_msg['args']: instance = expected_msg['args']['instance'] del expected_msg['args']['instance'] - expected_msg['args']['instance_uuid'] = instance['uuid'] + if method in ['rollback_live_migration_at_destination']: + expected_msg['args']['instance_id'] = instance['id'] + else: + expected_msg['args']['instance_uuid'] = instance['uuid'] + expected_msg['version'] = rpcapi.RPC_API_VERSION + cast_and_call = ['confirm_resize', 'stop_instance'] if rpc_method == 'call' and method in cast_and_call: kwargs['cast'] = False @@ -207,6 +218,10 @@ class ComputeRpcAPITestCase(test.TestCase): self._test_compute_api('revert_resize', 'cast', instance=self.fake_instance, migration_id='id', host='host') + def test_rollback_live_migration_at_destination(self): + self._test_compute_api('rollback_live_migration_at_destination', + 'cast', instance=self.fake_instance, host='host') + def test_set_admin_password(self): self._test_compute_api('set_admin_password', 'cast', instance=self.fake_instance, new_pass='pw') |
