diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-06-01 16:47:19 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-06-01 16:47:19 +0000 |
| commit | aae9f614090c8eca9f596efcc5238d5b8200061b (patch) | |
| tree | 7c51ba783e576a8b67780558392a4eff01028f89 /nova/tests | |
| parent | 31108020fc237624e244f08658646e2f119506db (diff) | |
| parent | 5a1236e469faf0f415989249d8aaa1c510fa8b3d (diff) | |
Merge "Add compare_cpu to the compute rpcapi."
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/compute/test_rpcapi.py | 4 | ||||
| -rw-r--r-- | nova/tests/scheduler/test_scheduler.py | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py index 7a4fda426..23ac55fc3 100644 --- a/nova/tests/compute/test_rpcapi.py +++ b/nova/tests/compute/test_rpcapi.py @@ -105,6 +105,10 @@ class ComputeRpcAPITestCase(test.TestCase): self._test_compute_api('attach_volume', 'cast', instance=self.fake_instance, volume_id='id', mountpoint='mp') + def test_compare_cpu(self): + self._test_compute_api('compare_cpu', 'call', cpu_info='info', + host='host') + def test_confirm_resize_cast(self): self._test_compute_api('confirm_resize', 'cast', instance=self.fake_instance, migration_id='id', host='host') diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py index 302f22939..e7057b406 100644 --- a/nova/tests/scheduler/test_scheduler.py +++ b/nova/tests/scheduler/test_scheduler.py @@ -23,6 +23,7 @@ import json from nova.compute import api as compute_api from nova.compute import power_state +from nova.compute import rpcapi as compute_rpcapi from nova.compute import vm_states from nova import context from nova import db @@ -539,7 +540,9 @@ class SchedulerTestCase(test.TestCase): dest).AndReturn('dest_queue') rpc.call(self.context, 'dest_queue', {'method': 'compare_cpu', - 'args': {'cpu_info': 'fake_cpu_info'}}).AndReturn(True) + 'args': {'cpu_info': 'fake_cpu_info'}, + 'version': compute_rpcapi.ComputeAPI.RPC_API_VERSION}, None + ).AndReturn(True) db.instance_update_and_get_original(self.context, instance['id'], {"vm_state": vm_states.MIGRATING}).AndReturn( @@ -957,8 +960,9 @@ class SchedulerTestCase(test.TestCase): dest).AndReturn('dest_queue') rpc.call(self.context, 'dest_queue', {'method': 'compare_cpu', - 'args': {'cpu_info': 'fake_cpu_info'}}).AndRaise( - rpc_common.RemoteError()) + 'args': {'cpu_info': 'fake_cpu_info'}, + 'version': compute_rpcapi.ComputeAPI.RPC_API_VERSION}, None + ).AndRaise(rpc_common.RemoteError()) self.mox.ReplayAll() self.assertRaises(rpc_common.RemoteError, |
