diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-01 18:31:18 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-01 18:31:18 +0000 |
| commit | 423289d50d92cf4b780a11c2c3da4e1dbbd865f2 (patch) | |
| tree | 3ff9e6b8558a289b0d98aa63df57a67954ef4f96 /nova/tests | |
| parent | 08968d255df65a0a290dabcc5c8d63d5b7d2bca4 (diff) | |
| parent | 9eb3dc7ed44d99652a17238724842e3067d46120 (diff) | |
Merge "Reset migrating task state for MigrationError exceptions"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/scheduler/test_scheduler.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py index 92b5f4ca4..461b81b4b 100644 --- a/nova/tests/scheduler/test_scheduler.py +++ b/nova/tests/scheduler/test_scheduler.py @@ -36,6 +36,7 @@ from nova.image import glance from nova.openstack.common import jsonutils from nova.openstack.common.notifier import api as notifier from nova.openstack.common import rpc +from nova.openstack.common.rpc import common as rpc_common from nova.scheduler import driver from nova.scheduler import manager from nova import servicegroup @@ -65,6 +66,12 @@ class SchedulerManagerTestCase(test.TestCase): self.fake_kwargs = {'cat': 'meow', 'dog': 'woof'} fake_instance_actions.stub_out_action_events(self.stubs) + def stub_out_client_exceptions(self): + def passthru(exceptions, func, *args, **kwargs): + return func(*args, **kwargs) + + self.stubs.Set(rpc_common, 'catch_client_exception', passthru) + def test_1_correct_init(self): # Correct scheduler driver manager = self.manager @@ -231,6 +238,7 @@ class SchedulerManagerTestCase(test.TestCase): mox.IgnoreArg()) self.mox.ReplayAll() + self.stub_out_client_exceptions() self.assertRaises(exception.NoValidHost, self.manager.live_migration, self.context, inst, dest, block_migration, @@ -263,6 +271,7 @@ class SchedulerManagerTestCase(test.TestCase): mox.IgnoreArg()) self.mox.ReplayAll() + self.stub_out_client_exceptions() self.assertRaises(exception.ComputeServiceUnavailable, self.manager.live_migration, self.context, inst, dest, block_migration, |
