2012-01-10 17:44:27 -08:00
|
|
|
|
[tox]
|
2015-02-27 13:51:17 +11:00
|
|
|
|
envlist = py27,pep8
|
2015-02-17 15:57:10 -05:00
|
|
|
|
minversion = 1.8
|
2013-12-09 14:02:49 +00:00
|
|
|
|
skipsdist = True
|
2012-01-10 17:44:27 -08:00
|
|
|
|
|
|
|
|
|
[testenv]
|
2014-07-25 13:30:00 -07:00
|
|
|
|
# Note the hash seed is set to 0 until neutron can be tested with a
|
|
|
|
|
# random hash seed successfully.
|
2012-02-29 09:39:03 -08:00
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2014-07-25 13:30:00 -07:00
|
|
|
|
PYTHONHASHSEED=0
|
2013-12-09 14:02:49 +00:00
|
|
|
|
usedevelop = True
|
|
|
|
|
install_command = pip install -U {opts} {packages}
|
2013-05-30 13:36:22 +08:00
|
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2014-12-02 13:18:48 +09:00
|
|
|
|
whitelist_externals = sh
|
2013-03-07 12:41:30 -05:00
|
|
|
|
commands =
|
2015-01-09 15:02:59 +00:00
|
|
|
|
dsvm-functional: {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envbindir}
|
2014-12-02 13:18:48 +09:00
|
|
|
|
sh tools/pretty_tox.sh '{posargs}'
|
2014-11-20 21:01:14 +00:00
|
|
|
|
# there is also secret magic in pretty_tox.sh which lets you run in a fail only
|
|
|
|
|
# mode. To do this define the TRACE_FAILONLY environmental variable.
|
2012-06-08 19:46:37 -04:00
|
|
|
|
|
2014-08-04 08:47:08 -04:00
|
|
|
|
[testenv:hashtest]
|
|
|
|
|
# This is the same as default environment, but with a random PYTHONHASHSEED.
|
|
|
|
|
# You can also specify a specific hashseed (for test repeatability) as follows:
|
|
|
|
|
# tox --hashseed 1235130571 -e hashtest
|
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
|
|
2014-03-25 01:04:50 -07:00
|
|
|
|
[testenv:api]
|
|
|
|
|
setenv = OS_TEST_PATH=./neutron/tests/api
|
2015-03-13 18:17:29 +00:00
|
|
|
|
TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
|
2014-03-25 01:04:50 -07:00
|
|
|
|
|
2014-01-14 18:43:22 +00:00
|
|
|
|
[testenv:functional]
|
|
|
|
|
setenv = OS_TEST_PATH=./neutron/tests/functional
|
2014-12-12 18:39:56 +01:00
|
|
|
|
OS_TEST_TIMEOUT=90
|
2014-10-05 01:23:50 -04:00
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
|
|
|
|
-r{toxinidir}/neutron/tests/functional/requirements.txt
|
2014-01-14 18:43:22 +00:00
|
|
|
|
|
2014-07-02 00:35:12 +00:00
|
|
|
|
[testenv:dsvm-functional]
|
|
|
|
|
setenv = OS_TEST_PATH=./neutron/tests/functional
|
|
|
|
|
OS_SUDO_TESTING=1
|
2015-01-09 15:02:59 +00:00
|
|
|
|
OS_ROOTWRAP_CMD=sudo {envbindir}/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
|
Add rootwrap daemon mode support
This patch introduces support for rootwrap daemon mode. It adds
a new config option, AGENT.root_helper_daemon with no default. To
enable, set to something like:
root_helper_daemon = sudo neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
The patch currently assumes that the root_helper_daemon value, and specifically
the rootwrap config, will not change once calls to execute() happen. While it
would not be hard to generate a rootwrap daemon client for each new config, I
couldn't think of a legitimate reason to support it and left it out as YAGNI.
This patch does change the behavior of the addl_env argument to create_process
and execute. Previously, an environment dict would be passed to Popen. If
a root helper was used, this environemnt would actually be passed to 'sudo'
which would filter it before passing it to the underlying command. In the case
of daemon mode, this would cause a problem as the enviornment is filtered by
sudo only once, at daemon startup. Any environment variables added at execute
time would then just be passed directly to the underyling command unfiltered.
oslo.rootwrap 1.6.0 fixes this issue by denying the passing of environment
variables to the daemon altogether. Instead, anything using rootwrap and needing
to pass additional environment variables should define an EnvFilter and run the
command with env var=val cmd. utils.execute/create_process have been modified to
run code in this way (which netns.execute already did).
No code in neutron currently uses both run_as_root=True and addl_env, so this
change does not require any change in code or filters.
DocImpact
Implements: blueprint rootwrap-daemon-mode
Change-Id: I567334bb611253c7b9d830d50c5be308a5153baf
2015-02-23 14:56:44 -06:00
|
|
|
|
OS_ROOTWRAP_DAEMON_CMD=sudo {envbindir}/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
|
2014-07-02 00:35:12 +00:00
|
|
|
|
OS_FAIL_ON_MISSING_DEPS=1
|
2014-12-12 18:39:56 +01:00
|
|
|
|
OS_TEST_TIMEOUT=90
|
2014-09-17 19:48:41 +00:00
|
|
|
|
sitepackages=True
|
2014-10-05 01:23:50 -04:00
|
|
|
|
deps =
|
|
|
|
|
{[testenv:functional]deps}
|
2014-07-02 00:35:12 +00:00
|
|
|
|
|
2012-06-08 19:46:37 -04:00
|
|
|
|
[tox:jenkins]
|
|
|
|
|
sitepackages = True
|
|
|
|
|
downloadcache = ~/cache/pip
|
2012-01-10 17:44:27 -08:00
|
|
|
|
|
|
|
|
|
[testenv:pep8]
|
2015-02-25 09:07:18 -08:00
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
|
|
|
|
pylint
|
|
|
|
|
commands=
|
2014-12-22 13:02:14 -08:00
|
|
|
|
# If it is easier to add a check via a shell script, consider adding it in this file
|
|
|
|
|
sh ./tools/misc-sanity-checks.sh
|
2015-02-25 21:53:27 -08:00
|
|
|
|
# Checks for coding and style guidelines
|
2013-05-17 02:18:56 +00:00
|
|
|
|
flake8
|
2015-02-25 21:53:27 -08:00
|
|
|
|
sh ./tools/coding-checks.sh --pylint '{posargs}'
|
2014-03-07 15:07:43 -05:00
|
|
|
|
neutron-db-manage check_migration
|
2014-10-17 12:30:38 +09:00
|
|
|
|
whitelist_externals = sh
|
2012-01-25 01:23:12 -08:00
|
|
|
|
|
|
|
|
|
[testenv:cover]
|
2013-03-10 15:23:46 -07:00
|
|
|
|
commands =
|
2014-12-05 18:17:15 +01:00
|
|
|
|
python setup.py testr --coverage --testr-args='{posargs}'
|
2012-01-10 17:44:27 -08:00
|
|
|
|
|
2012-06-08 19:46:37 -04:00
|
|
|
|
[testenv:venv]
|
2012-02-29 09:39:03 -08:00
|
|
|
|
commands = {posargs}
|
2013-05-17 02:18:56 +00:00
|
|
|
|
|
2014-08-21 21:24:51 +02:00
|
|
|
|
[testenv:docs]
|
2015-02-20 15:05:07 +01:00
|
|
|
|
commands = sphinx-build -W -b html doc/source doc/build
|
2014-08-21 21:24:51 +02:00
|
|
|
|
|
2013-05-17 02:18:56 +00:00
|
|
|
|
[flake8]
|
|
|
|
|
# E125 continuation line does not distinguish itself from next logical line
|
2014-06-10 14:35:46 +00:00
|
|
|
|
# E126 continuation line over-indented for hanging indent
|
|
|
|
|
# E128 continuation line under-indented for visual indent
|
|
|
|
|
# E129 visually indented line with same indent as next logical line
|
|
|
|
|
# E265 block comment should start with ‘# ‘
|
|
|
|
|
# H305 imports not grouped correctly
|
2014-12-09 13:04:38 -07:00
|
|
|
|
# H404 multi line docstring should start with a summary
|
2014-06-10 14:35:46 +00:00
|
|
|
|
# H405 multi line docstring summary not separated with an empty line
|
2015-01-12 17:27:14 +01:00
|
|
|
|
ignore = E125,E126,E128,E129,E265,H305,H404,H405
|
2013-05-17 02:18:56 +00:00
|
|
|
|
show-source = true
|
|
|
|
|
builtins = _
|
2015-02-21 00:15:12 +00:00
|
|
|
|
# neutron/tests/tempest needs to be excluded so long as it continues
|
|
|
|
|
# to be copied directly from tempest, since tempest and neutron do not
|
|
|
|
|
# share a flake8 configuration.
|
|
|
|
|
exclude = ./.*,build,dist,neutron/openstack/common/*,neutron/tests/tempest
|
2014-05-01 06:10:57 -07:00
|
|
|
|
|
|
|
|
|
[hacking]
|
2014-11-21 22:01:08 +01:00
|
|
|
|
import_exceptions = neutron.i18n
|
2014-05-01 06:10:57 -07:00
|
|
|
|
local-check-factory = neutron.hacking.checks.factory
|