Merge "Stub out rpc notifications in ec2 cloud unit tests"

This commit is contained in:
Jenkins 2014-07-25 19:17:55 +00:00 committed by Gerrit Code Review
commit 4b67c57487
3 changed files with 24 additions and 0 deletions

View File

@ -34,6 +34,7 @@ from nova import objects
from nova import test
from nova.tests import cast_as_call
from nova.tests import fake_network
from nova.tests import fake_notifier
from nova.tests import fake_utils
from nova.tests.image import fake
from nova.tests import matchers
@ -126,6 +127,12 @@ class CinderCloudTestCase(test.TestCase):
# Short-circuit the conductor service
self.flags(use_local=True, group='conductor')
# Stub out the notification service so we use the no-op serializer
# and avoid lazy-load traces with the wrap_exception decorator in
# the compute service.
fake_notifier.stub_notifier(self.stubs)
self.addCleanup(fake_notifier.reset)
# set up services
self.conductor = self.start_service('conductor',
manager=CONF.conductor.manager)

View File

@ -60,6 +60,7 @@ from nova.tests.api.openstack.compute.contrib import (
from nova.tests import cast_as_call
from nova.tests import fake_block_device
from nova.tests import fake_network
from nova.tests import fake_notifier
from nova.tests import fake_utils
from nova.tests.image import fake
from nova.tests import matchers
@ -174,6 +175,12 @@ class CloudTestCase(test.TestCase):
# Short-circuit the conductor service
self.flags(use_local=True, group='conductor')
# Stub out the notification service so we use the no-op serializer
# and avoid lazy-load traces with the wrap_exception decorator in
# the compute service.
fake_notifier.stub_notifier(self.stubs)
self.addCleanup(fake_notifier.reset)
# set up services
self.conductor = self.start_service('conductor',
manager=CONF.conductor.manager)

View File

@ -28,6 +28,7 @@ from nova.openstack.common import timeutils
from nova import test
from nova.tests import cast_as_call
from nova.tests import fake_network
from nova.tests import fake_notifier
from nova.tests.image import fake
CONF = cfg.CONF
@ -48,6 +49,15 @@ class EC2ValidateTestCase(test.TestCase):
# set up our cloud
self.cloud = cloud.CloudController()
# Short-circuit the conductor service
self.flags(use_local=True, group='conductor')
# Stub out the notification service so we use the no-op serializer
# and avoid lazy-load traces with the wrap_exception decorator in
# the compute service.
fake_notifier.stub_notifier(self.stubs)
self.addCleanup(fake_notifier.reset)
# set up services
self.conductor = self.start_service('conductor',
manager=CONF.conductor.manager)