import uuid
import fixtures
+ import logging
import mox
from oslo.config import cfg
+from oslo.messaging import conffixture as messaging_conffixture
import stubout
import testtools
from testtools import matchers
from cinder.common import config # noqa Need to register global_opts
from cinder.db import migration
from cinder.openstack.common.db.sqlalchemy import session
- from cinder.openstack.common import log as logging
+ from cinder.openstack.common import log as oslo_logging
from cinder.openstack.common import timeutils
+from cinder import rpc
from cinder import service
from cinder.tests import conf_fixture
-
+from cinder.tests import fake_notifier
test_opts = [
cfg.StrOpt('sqlite_clean_db',
stderr = self.useFixture(fixtures.StringStream('stderr')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
- self.log_fixture = self.useFixture(fixtures.FakeLogger())
+ self.log_fixture = self.useFixture(fixtures.FakeLogger(
+ level=logging.DEBUG))
+ rpc.add_extra_exmods("cinder.tests")
+ self.addCleanup(rpc.clear_extra_exmods)
+ self.addCleanup(rpc.cleanup)
+
+ fs = '%(levelname)s [%(name)s] %(message)s'
+ self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
+ self.messaging_conf.transport_driver = 'fake'
+ self.messaging_conf.response_timeout = 15
+ self.useFixture(self.messaging_conf)
+ rpc.init(CONF)
+
conf_fixture.set_defaults(CONF)
CONF([], default_config_files=[])