diff options
| author | Dan Smith <danms@us.ibm.com> | 2013-03-29 09:19:57 -0700 |
|---|---|---|
| committer | Dan Smith <danms@us.ibm.com> | 2013-03-29 09:23:45 -0700 |
| commit | ec75cc2a6bc6e3f367b3377515cb9c4b99a6ab29 (patch) | |
| tree | 5dfa0516df24e257ba1a52960c544e174119397d /nova/tests | |
| parent | d4e1926d53b28a23427f7f541cf0fad443c90a53 (diff) | |
Fix automatic confirmation of resizes for no-db-compute
compute/api.py:confirm_resize() was still making a bunch of calls
against the database that were tripping over the no-db-compute
enforcement checks. Instead of trying to unwind all of the instance
action, quota, etc code and divert to conductor, just farm out the
entire confirm_resize() call to conductor.
Fixes bug 1161402
Change-Id: I121040a3b575f5866d45cc8ef6862d67f5558715
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/compute/test_compute.py | 2 | ||||
| -rw-r--r-- | nova/tests/conductor/test_conductor.py | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 3a1526522..b27c079a2 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -3654,7 +3654,7 @@ class ComputeTestCase(BaseTestCase): fake_migration_get_unconfirmed_by_dest_compute) self.stubs.Set(self.compute.conductor_api, 'migration_update', fake_migration_update) - self.stubs.Set(self.compute.compute_api, 'confirm_resize', + self.stubs.Set(self.compute.conductor_api, 'compute_confirm_resize', fake_confirm_resize) def fetch_instance_migration_status(instance_uuid): diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py index df0f5e73b..1c675ec61 100644 --- a/nova/tests/conductor/test_conductor.py +++ b/nova/tests/conductor/test_conductor.py @@ -599,6 +599,16 @@ class _BaseTestCase(object): self.mox.ReplayAll() self.conductor.compute_stop(self.context, 'instance') + def test_compute_confirm_resize(self): + self.mox.StubOutWithMock(self.conductor_manager.compute_api, + 'confirm_resize') + self.conductor_manager.compute_api.confirm_resize(self.context, + 'instance', + 'migration') + self.mox.ReplayAll() + self.conductor.compute_confirm_resize(self.context, 'instance', + 'migration') + class ConductorTestCase(_BaseTestCase, test.TestCase): """Conductor Manager Tests.""" |
