]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "Use debug level logging during unit tests"
authorJenkins <jenkins@review.openstack.org>
Thu, 13 Mar 2014 22:50:26 +0000 (22:50 +0000)
committerGerrit Code Review <review@openstack.org>
Thu, 13 Mar 2014 22:50:26 +0000 (22:50 +0000)
1  2 
cinder/test.py

diff --cc cinder/test.py
index 2c846c6e869b89ff7932d165a03205e0a6d83a4a,dbd45ec7df4ffd1d2fef9f1efa7bb2319e2e66f6..7ba8e4942f447f5b6123ea417650769ee5a7f410
@@@ -27,9 -28,9 +27,10 @@@ import tempfil
  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',
@@@ -129,19 -129,9 +130,20 @@@ class TestCase(testtools.TestCase)
              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=[])