summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-01-22 15:29:13 +0000
committerGerrit Code Review <review@openstack.org>2012-01-22 15:29:13 +0000
commit4fa5866df4b79d3e38da8dd3ee76483c1ee7d1a5 (patch)
tree4195bf6a9e49266a6529c98e07b012122efe1d8d /nova/tests
parente788bb259d527f6b40785922a3e002e8e102ad22 (diff)
parent26b7c43ca1fe94f937d6a6d89b3114ce9931c74d (diff)
Merge "Make start_instance cast directly to compute host"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/scheduler/test_multi_scheduler.py7
-rw-r--r--nova/tests/scheduler/test_scheduler.py28
2 files changed, 5 insertions, 30 deletions
diff --git a/nova/tests/scheduler/test_multi_scheduler.py b/nova/tests/scheduler/test_multi_scheduler.py
index cefc31b7e..7468a2447 100644
--- a/nova/tests/scheduler/test_multi_scheduler.py
+++ b/nova/tests/scheduler/test_multi_scheduler.py
@@ -31,7 +31,10 @@ class FakeComputeScheduler(driver.Scheduler):
def schedule_run_instance(self, *args, **kwargs):
pass
- def schedule_start_instance(self, *args, **kwargs):
+ def schedule_live_migration(self, *args, **kwargs):
+ pass
+
+ def schedule_prep_resize(self, *args, **kwargs):
pass
def schedule(self, *args, **kwargs):
@@ -76,7 +79,7 @@ class MultiDriverTestCase(test_scheduler.SchedulerTestCase):
compute_driver = mgr.drivers['compute']
volume_driver = mgr.drivers['volume']
- test_methods = {compute_driver: ['run_instance', 'start_instance'],
+ test_methods = {compute_driver: ['run_instance', 'prep_resize'],
volume_driver: ['create_volume', 'create_volumes']}
for driver, methods in test_methods.iteritems():
diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py
index 19591c080..73b538768 100644
--- a/nova/tests/scheduler/test_scheduler.py
+++ b/nova/tests/scheduler/test_scheduler.py
@@ -231,34 +231,6 @@ class SchedulerManagerTestCase(test.TestCase):
self.manager.run_instance(self.context, self.topic,
*self.fake_args, **self.fake_kwargs)
- def test_start_instance_exception_puts_instance_in_error_state(self):
- """Test that an NoValidHost exception for start_instance puts
- the instance in ERROR state and eats the exception.
- """
-
- fake_instance_id = 'fake-instance-id'
- self.fake_kwargs['instance_id'] = fake_instance_id
-
- # Make sure the method exists that we're going to test call
- def stub_method(*args, **kwargs):
- pass
-
- setattr(self.manager.driver, 'schedule_start_instance', stub_method)
-
- self.mox.StubOutWithMock(self.manager.driver,
- 'schedule_start_instance')
- self.mox.StubOutWithMock(db, 'instance_update')
-
- self.manager.driver.schedule_start_instance(self.context,
- *self.fake_args, **self.fake_kwargs).AndRaise(
- exception.NoValidHost(reason=""))
- db.instance_update(self.context, fake_instance_id,
- {'vm_state': vm_states.ERROR})
-
- self.mox.ReplayAll()
- self.manager.start_instance(self.context, self.topic,
- *self.fake_args, **self.fake_kwargs)
-
class SchedulerTestCase(test.TestCase):
"""Test case for base scheduler driver class"""