diff --git a/neutron/tests/fullstack/cmd/l3_agent.py b/neutron/tests/fullstack/cmd/l3_agent.py new file mode 100755 index 00000000000..fae5be2d507 --- /dev/null +++ b/neutron/tests/fullstack/cmd/l3_agent.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +# Copyright 2017 Eayun, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import sys + +from neutron.common import eventlet_utils +from neutron.tests.common.agents import l3_agent + +eventlet_utils.monkey_patch() + +if __name__ == "__main__": + sys.exit(l3_agent.main()) diff --git a/neutron/tests/fullstack/resources/config.py b/neutron/tests/fullstack/resources/config.py index 8329a41d0ef..d91db273b93 100644 --- a/neutron/tests/fullstack/resources/config.py +++ b/neutron/tests/fullstack/resources/config.py @@ -91,6 +91,13 @@ class NeutronConfigFixture(ConfigFixture): 'report_interval': env_desc.agent_down_time / 2.0 }, }) + # Set root_helper/root_helper_daemon only when env var is set + root_helper = os.environ.get('OS_ROOTWRAP_CMD') + if root_helper: + self.config['agent']['root_helper'] = root_helper + root_helper_daemon = os.environ.get('OS_ROOTWRAP_DAEMON_CMD') + if root_helper_daemon: + self.config['agent']['root_helper_daemon'] = root_helper_daemon def _setUp(self): self.config['DEFAULT'].update({ diff --git a/neutron/tests/fullstack/resources/process.py b/neutron/tests/fullstack/resources/process.py index 127c5d70d76..1508eae3257 100644 --- a/neutron/tests/fullstack/resources/process.py +++ b/neutron/tests/fullstack/resources/process.py @@ -267,7 +267,7 @@ class L3AgentFixture(ServiceFixture): process_name=self.NEUTRON_L3_AGENT, exec_name=spawn.find_executable( 'l3_agent.py', - path=os.path.join(base.ROOTDIR, 'common', 'agents')), + path=os.path.join(fullstack_base.ROOTDIR, 'cmd')), config_filenames=config_filenames, namespace=self.namespace ) diff --git a/tox.ini b/tox.ini index b18cfbbcaca..ef907623ed2 100644 --- a/tox.ini +++ b/tox.ini @@ -78,6 +78,7 @@ deps = {[testenv:functional]deps} commands = {toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir} + {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin {[testenv]commands} [testenv:releasenotes]