]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Move set_override('root_helper', ...) to base functional class
authorAssaf Muller <amuller@redhat.com>
Sun, 7 Dec 2014 12:14:29 +0000 (14:14 +0200)
committerAssaf Muller <amuller@redhat.com>
Sun, 7 Dec 2014 12:14:29 +0000 (14:14 +0200)
Change-Id: I0c2223ed2808573ee6b6fe5d56fd965a6e45541f

neutron/tests/functional/agent/linux/test_ip_lib.py
neutron/tests/functional/agent/linux/test_keepalived.py
neutron/tests/functional/base.py

index 5abc4c80cc982687688301844611dfc75478afe6..43ca327b6444022abf96ea0496ee487d25f9fbc6 100644 (file)
@@ -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',
index 9cd5e95c5e918a4955ce8c0918b7d0899c853b0a..fbccfe7cfc0ffbdd793c9a0bdc24dfc37e11ba36 100644 (file)
@@ -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()
index 7f14130be7540cff203e216cad623a9fc03e10e4..7d43b0715d1122a37a437f75f5c72a2677b3b2fb 100644 (file)
 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')