Commit a52d70a4 authored by Lianhao Lu's avatar Lianhao Lu

Fix test blocking issue and pin docutils version.

Mock out more methods of the nova conductor according to the latest nova
changes to fix the test blocking issue of the nova notifier.

Also pin docutils to 0.9.1 as a workaround to fix bug 1091333.

Change-Id: I1c4db4a5f5485dd563c2d48890be0334982e5a26
parent cd0f6c28
......@@ -164,12 +164,22 @@ class TestNovaNotifier(base.TestCase):
# the nova manager and the remote system since we can't
# expect the message bus to be available, or the remote
# controller to be there if the message bus is online.
self.stubs.Set(nova.conductor.api.API, 'instance_get_by_uuid',
self.fake_db_instance_get)
with mock.patch('nova.conductor.api.API.instance_update'):
@mock.patch.object(nova.conductor.api.API,
'block_device_mapping_get_all_by_instance',
lambda obj, context, instance: {})
@mock.patch.object(nova.conductor.api.API,
'instance_get_by_uuid',
self.fake_db_instance_get)
@mock.patch('nova.conductor.api.API.instance_info_cache_delete')
@mock.patch('nova.conductor.api.API.instance_destroy')
@mock.patch('nova.conductor.api.API.block_device_mapping_destroy')
@mock.patch('nova.conductor.api.API.instance_update')
def run_test(*omit_args):
self.compute.terminate_instance(self.context,
instance=self.instance)
run_test()
self.assertTrue(self.Pollster.counters)
self.assertTrue(self.Pollster.counters[0])
self.assertEqual(self.Pollster.counters[0][0],
......
......@@ -26,3 +26,7 @@ pecan
swift
# Swift dep that is not necessary if we depend on swift>1.7.5
netifaces
# Docs Requirements
sphinx
docutils==0.9.1 # for bug 1091333, remove after sphinx >1.1.3 is released.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment