summaryrefslogtreecommitdiffstats
path: root/nova/tests/scheduler
diff options
context:
space:
mode:
authorAndrew Laski <andrew.laski@rackspace.com>2013-01-15 17:24:49 -0500
committerAndrew Laski <andrew.laski@rackspace.com>2013-02-01 14:38:42 -0500
commit250230b32364b1e36ae6d62ec4bb8c3285c59401 (patch)
tree0a4c6a6c3b1dc15b48a0fd12d43be40df1d79cb6 /nova/tests/scheduler
parentc421d775ee3052d1af4c08b8ff81f6877ca8b1a8 (diff)
downloadnova-250230b32364b1e36ae6d62ec4bb8c3285c59401.tar.gz
nova-250230b32364b1e36ae6d62ec4bb8c3285c59401.tar.xz
nova-250230b32364b1e36ae6d62ec4bb8c3285c59401.zip
Record instance actions and events
Record when an action is initiated on an instance, and the underlying events related to completing that action. Actions will typically occur at the API level and should match what a user intended to do with an instance. Events will typically track what happens behind the scenes and may include things that would be unclear for a user if exposed, but should be beneficial to an admin/deployer. Adds a new wrapper to the compute manager. The wrapper will record when an event begins and finishes from the point of view of the compute manager. It will also record errors if they occur. Blueprint instance-actions Change-Id: I801f3e796d091e146413f84c2ccfab95ad2e1af4
Diffstat (limited to 'nova/tests/scheduler')
-rw-r--r--nova/tests/scheduler/test_scheduler.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py
index 142d8ea0e..14be14a1a 100644
--- a/nova/tests/scheduler/test_scheduler.py
+++ b/nova/tests/scheduler/test_scheduler.py
@@ -37,6 +37,7 @@ from nova.scheduler import driver
from nova.scheduler import manager
from nova import servicegroup
from nova import test
+from nova.tests import fake_instance_actions
from nova.tests import matchers
from nova.tests.scheduler import fakes
@@ -57,6 +58,7 @@ class SchedulerManagerTestCase(test.TestCase):
self.topic = 'fake_topic'
self.fake_args = (1, 2, 3)
self.fake_kwargs = {'cat': 'meow', 'dog': 'woof'}
+ fake_instance_actions.stub_out_action_events(self.stubs)
def test_1_correct_init(self):
# Correct scheduler driver
@@ -179,8 +181,8 @@ class SchedulerManagerTestCase(test.TestCase):
self.mox.StubOutWithMock(compute_utils, 'add_instance_fault_from_exc')
self.mox.StubOutWithMock(db, 'instance_update_and_get_original')
- request_spec = {'instance_properties':
- {'uuid': fake_instance_uuid}}
+ request_spec = {'instance_properties': inst,
+ 'instance_uuids': [fake_instance_uuid]}
self.manager.driver.schedule_run_instance(self.context,
request_spec, None, None, None, None, {}).AndRaise(
@@ -199,6 +201,7 @@ class SchedulerManagerTestCase(test.TestCase):
def test_prep_resize_no_valid_host_back_in_active_state(self):
fake_instance_uuid = 'fake-instance-id'
+ fake_instance = {'uuid': fake_instance_uuid}
inst = {"vm_state": "", "task_state": ""}
self._mox_schedule_method_helper('schedule_prep_resize')
@@ -214,7 +217,7 @@ class SchedulerManagerTestCase(test.TestCase):
'image': 'fake_image',
'request_spec': request_spec,
'filter_properties': 'fake_props',
- 'instance': 'fake_instance',
+ 'instance': fake_instance,
'instance_type': 'fake_type',
'reservations': list('fake_res'),
}
@@ -233,6 +236,7 @@ class SchedulerManagerTestCase(test.TestCase):
def test_prep_resize_exception_host_in_error_state_and_raise(self):
fake_instance_uuid = 'fake-instance-id'
+ fake_instance = {'uuid': fake_instance_uuid}
self._mox_schedule_method_helper('schedule_prep_resize')
@@ -246,7 +250,7 @@ class SchedulerManagerTestCase(test.TestCase):
'image': 'fake_image',
'request_spec': request_spec,
'filter_properties': 'fake_props',
- 'instance': 'fake_instance',
+ 'instance': fake_instance,
'instance_type': 'fake_type',
'reservations': list('fake_res'),
}