From: Alessio Ababilov Date: Wed, 6 Feb 2013 11:22:53 +0000 (+0200) Subject: Register root_helper in test_debug_commands and test_dhcp_agent X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b2dc9e6bf996a3e607bfbcaf133968798210a54d;p=openstack-build%2Fneutron-build.git Register root_helper in test_debug_commands and test_dhcp_agent root_helper variable currently must be introduced with a call to register_root_helper, not with a simple assignment. Change-Id: I3e72379925a994acfb6defb24820ab63eab43957 Fixes: bug #1117240 --- diff --git a/quantum/tests/unit/test_debug_commands.py b/quantum/tests/unit/test_debug_commands.py index 9e7f7f7ab..0f5a4d340 100644 --- a/quantum/tests/unit/test_debug_commands.py +++ b/quantum/tests/unit/test_debug_commands.py @@ -20,6 +20,7 @@ import socket import mock import unittest2 as unittest +from quantum.agent.common import config from quantum.agent.linux import interface from quantum.debug import commands from quantum.debug.debug_agent import DEVICE_OWNER_PROBE, QuantumDebugAgent @@ -37,7 +38,7 @@ class TestDebugCommands(unittest.TestCase): cfg.CONF.register_opts(QuantumDebugAgent.OPTS) cfg.CONF(args=[], project='quantum') cfg.CONF.set_override('use_namespaces', True) - cfg.CONF.root_helper = 'sudo' + config.register_root_helper(cfg.CONF) self.addCleanup(mock.patch.stopall) device_exists_p = mock.patch( diff --git a/quantum/tests/unit/test_dhcp_agent.py b/quantum/tests/unit/test_dhcp_agent.py index c763244f5..46cff19f3 100644 --- a/quantum/tests/unit/test_dhcp_agent.py +++ b/quantum/tests/unit/test_dhcp_agent.py @@ -23,6 +23,7 @@ import uuid import mock import unittest2 as unittest +from quantum.agent.common import config from quantum.agent import dhcp_agent from quantum.agent.linux import interface from quantum.common import exceptions @@ -254,7 +255,7 @@ class TestDhcpAgentEventHandler(unittest.TestCase): cfg.CONF.register_opts(dhcp_agent.DeviceManager.OPTS) cfg.CONF.set_override('interface_driver', 'quantum.agent.linux.interface.NullDriver') - cfg.CONF.root_helper = 'sudo' + config.register_root_helper(cfg.CONF) cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS) self.notification_p = mock.patch( 'quantum.agent.rpc.NotificationDispatcher') @@ -666,7 +667,7 @@ class TestDeviceManager(unittest.TestCase): cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS) cfg.CONF.set_override('interface_driver', 'quantum.agent.linux.interface.NullDriver') - cfg.CONF.root_helper = 'sudo' + config.register_root_helper(cfg.CONF) self.device_exists_p = mock.patch( 'quantum.agent.linux.ip_lib.device_exists')