diff options
author | David Ripton <dripton@redhat.com> | 2012-10-15 13:42:32 -0400 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2012-10-31 22:20:10 +0000 |
commit | 4d58dccfd58a01724a64415ff567abf359b48e1a (patch) | |
tree | 8f8eec4f36f4b2a6b4e1a302c5b0a64d29fd8e59 /tests/unit/test_service.py | |
parent | ae6f54dba69449eb1c231de162c12711bd2ab528 (diff) | |
download | oslo-4d58dccfd58a01724a64415ff567abf359b48e1a.tar.gz oslo-4d58dccfd58a01724a64415ff567abf359b48e1a.tar.xz oslo-4d58dccfd58a01724a64415ff567abf359b48e1a.zip |
Log CONF from ProcessLauncher.wait, like ServiceLauncher
Fixes bug #1050380
In the unit tests, we need to call CONF so that the config-file option
referenced by log_opt_values() is registered. We also need unregister
the default_publisher_id option to workaround bug #107372.
Change-Id: Icc63237ddf97aaa730c0484974ec05a3080f8f04
Diffstat (limited to 'tests/unit/test_service.py')
-rw-r--r-- | tests/unit/test_service.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/unit/test_service.py b/tests/unit/test_service.py index fce6b45..59f3145 100644 --- a/tests/unit/test_service.py +++ b/tests/unit/test_service.py @@ -29,10 +29,11 @@ from eventlet import greenthread from openstack.common import cfg from openstack.common.gettextutils import _ from openstack.common import log as logging +from openstack.common.notifier import api as notifier_api from openstack.common import service from tests import utils - +CONF = cfg.CONF LOG = logging.getLogger(__name__) @@ -108,7 +109,16 @@ class ServiceLauncherTest(utils.BaseTestCase): self.assertEqual(len(workers), self.workers) return workers + def setUp(self): + super(ServiceLauncherTest, self).setUp() + # FIXME(markmc): Ugly hack to workaround bug #1073732 + CONF.unregister_opts(notifier_api.notifier_opts) + # NOTE(markmc): ConfigOpts.log_opt_values() uses CONF.config-file + CONF(args=[], default_config_files=[]) + def tearDown(self): + CONF.reset() + CONF.register_opts(notifier_api.notifier_opts) if self.pid: # Make sure all processes are stopped os.kill(self.pid, signal.SIGTERM) |