From 4cea10231d8c6d8e062ecf7174793f838ed1c866 Mon Sep 17 00:00:00 2001 From: Assaf Muller Date: Sun, 7 Dec 2014 14:14:29 +0200 Subject: [PATCH] Move set_override('root_helper', ...) to base functional class Change-Id: I0c2223ed2808573ee6b6fe5d56fd965a6e45541f --- neutron/tests/functional/agent/linux/test_ip_lib.py | 2 -- neutron/tests/functional/agent/linux/test_keepalived.py | 2 -- neutron/tests/functional/base.py | 9 +++++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/neutron/tests/functional/agent/linux/test_ip_lib.py b/neutron/tests/functional/agent/linux/test_ip_lib.py index 5abc4c80c..43ca327b6 100644 --- a/neutron/tests/functional/agent/linux/test_ip_lib.py +++ b/neutron/tests/functional/agent/linux/test_ip_lib.py @@ -37,8 +37,6 @@ class IpLibTestFramework(base.BaseLinuxTestCase): def _configure(self): config.setup_logging() - config.register_root_helper(cfg.CONF) - cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT') config.register_interface_driver_opts_helper(cfg.CONF) cfg.CONF.set_override( 'interface_driver', diff --git a/neutron/tests/functional/agent/linux/test_keepalived.py b/neutron/tests/functional/agent/linux/test_keepalived.py index 9cd5e95c5..fbccfe7cf 100644 --- a/neutron/tests/functional/agent/linux/test_keepalived.py +++ b/neutron/tests/functional/agent/linux/test_keepalived.py @@ -35,8 +35,6 @@ class KeepalivedManagerTestCase(functional_base.BaseSudoTestCase, def _configure(self): cfg.CONF.set_override('debug', False) config.setup_logging() - config.register_root_helper(cfg.CONF) - cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT') def test_keepalived_spawn(self): expected_config = self._get_config() diff --git a/neutron/tests/functional/base.py b/neutron/tests/functional/base.py index 7f14130be..7d43b0715 100644 --- a/neutron/tests/functional/base.py +++ b/neutron/tests/functional/base.py @@ -16,8 +16,10 @@ import os import time -from neutron.tests import base +from oslo.config import cfg +from neutron.agent.common import config +from neutron.tests import base SUDO_CMD = 'sudo -n' TIMEOUT = 60 @@ -50,10 +52,13 @@ class BaseSudoTestCase(base.BaseTestCase): def setUp(self): super(BaseSudoTestCase, self).setUp() self.sudo_enabled = base.bool_from_env('OS_SUDO_TESTING') - self.root_helper = os.environ.get('OS_ROOTWRAP_CMD', SUDO_CMD) self.fail_on_missing_deps = ( base.bool_from_env('OS_FAIL_ON_MISSING_DEPS')) + self.root_helper = os.environ.get('OS_ROOTWRAP_CMD', SUDO_CMD) + config.register_root_helper(cfg.CONF) + cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT') + def check_sudo_enabled(self): if not self.sudo_enabled: self.skipTest('testing with sudo is not enabled') -- 2.45.2