diff options
author | Dan Smith <danms@us.ibm.com> | 2013-02-08 21:32:20 -0500 |
---|---|---|
committer | Dan Smith <danms@us.ibm.com> | 2013-02-11 17:44:04 -0500 |
commit | 4a68c5e4ab92daa31d8af47a91a2d8e45c185817 (patch) | |
tree | 1a42920731e11b4337974ae374f4903d25703af4 /nova/tests/conductor | |
parent | 3814c3b86e5c06a97575b6b0d0c90700d8339c15 (diff) | |
download | nova-4a68c5e4ab92daa31d8af47a91a2d8e45c185817.tar.gz nova-4a68c5e4ab92daa31d8af47a91a2d8e45c185817.tar.xz nova-4a68c5e4ab92daa31d8af47a91a2d8e45c185817.zip |
More conductor support for resizes
This patch adds more support for resizes to conductor, which apparently
are not getting tested in the "full" tempest gate.
This adds network_migrate_instance_{start,finish}() calls to conductor,
which offloads the network_api calls of similar name over RPC for
components that can't take the DB hit of calling network_api directly.
Also, in quota, the commit and rollback calls hit the database, so
export those from conductor as well.
This is likely the source of the failures in bug 1119817
Change-Id: I56bb65b0e168e36e138cf6bf125d6e83bf71f50b
Diffstat (limited to 'nova/tests/conductor')
-rw-r--r-- | nova/tests/conductor/test_conductor.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py index bd73328e8..5c9ce9e5f 100644 --- a/nova/tests/conductor/test_conductor.py +++ b/nova/tests/conductor/test_conductor.py @@ -31,6 +31,7 @@ from nova import notifications from nova.openstack.common import jsonutils from nova.openstack.common.rpc import common as rpc_common from nova.openstack.common import timeutils +from nova import quota from nova import test @@ -503,6 +504,39 @@ class _BaseTestCase(object): self.conductor.security_groups_trigger_members_refresh(self.context, [1, 2, 3]) + def test_network_migrate_instance_start(self): + self.mox.StubOutWithMock(self.conductor_manager.network_api, + 'migrate_instance_start') + self.conductor_manager.network_api.migrate_instance_start(self.context, + 'instance', + 'migration') + self.mox.ReplayAll() + self.conductor.network_migrate_instance_start(self.context, + 'instance', + 'migration') + + def test_network_migrate_instance_finish(self): + self.mox.StubOutWithMock(self.conductor_manager.network_api, + 'migrate_instance_finish') + self.conductor_manager.network_api.migrate_instance_finish( + self.context, 'instance', 'migration') + self.mox.ReplayAll() + self.conductor.network_migrate_instance_finish(self.context, + 'instance', + 'migration') + + def test_quota_commit(self): + self.mox.StubOutWithMock(quota.QUOTAS, 'commit') + quota.QUOTAS.commit(self.context, 'reservations') + self.mox.ReplayAll() + self.conductor.quota_commit(self.context, 'reservations') + + def test_quota_commit(self): + self.mox.StubOutWithMock(quota.QUOTAS, 'rollback') + quota.QUOTAS.rollback(self.context, 'reservations') + self.mox.ReplayAll() + self.conductor.quota_rollback(self.context, 'reservations') + class ConductorTestCase(_BaseTestCase, test.TestCase): """Conductor Manager Tests.""" |