Neutron drivers for OpenDaylight.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

236 lines
8.5 KiB

[tox]
envlist = docs,py37,pep8
minversion = 3.1.1
skipsdist = True
[testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:1}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1}
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:60}
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
OS_FAIL_ON_MISSING_DEPS OS_POST_MORTEM_DEBUGGER TRACE_FAILONLY
OS_TEST_DBAPI_ADMIN_CONNECTION OS_DEBUG
usedevelop = True
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = bash
commands = stestr run {posargs}
[testenv:dsvm]
# Fake job to define environment variables shared between dsvm jobs
setenv = OS_SUDO_TESTING=1
OS_FAIL_ON_MISSING_DEPS=1
OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
commands = false
[testenv:functional]
setenv = {[testenv]setenv}
OS_TEST_PATH=./networking_odl/tests/functional
OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
-r{toxinidir}/requirements.txt
-r{toxinidir}/networking_odl/tests/functional/requirements.txt
[testenv:dsvm-functional]
setenv = {[testenv:functional]setenv}
{[testenv:dsvm]setenv}
deps =
{[testenv:functional]deps}
[testenv:pep8]
deps = {[testenv]deps}
-r{toxinidir}/doc/requirements.txt
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
commands =
flake8
{toxinidir}/tools/coding-checks.sh --pylint '{posargs}'
doc8 doc/source devstack releasenotes/source rally-jobs
neutron-db-manage --subproject networking-odl check_migration
{[testenv:genconfig]commands}
{[testenv:bashate]commands}
{[testenv:capitald]commands}
{[testenv:bandit]commands}
whitelist_externals =
bash
mkdir
[testenv:i18n]
commands = python ./tools/check_i18n.py ./networking_odl ./tools/i18n_cfg.py
[testenv:venv]
deps = {[testenv]deps}
-r{toxinidir}/doc/requirements.txt
commands = {posargs}
[testenv:cover]
setenv =
PYTHON=coverage run --source networking_odl --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage report --fail-under=80 --skip-covered
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
whitelist_externals = rm
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:debug]
# Uses default base python
setenv = {[testenv]setenv}
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:0}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:0}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:0}
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:0}
commands = oslo_debug_helper -t networking_odl/tests {posargs}
[hacking]
import_exceptions = networking_odl._i18n
[testenv:bandit]
# B101: Use of assert detected
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r networking_odl -x tests -n5 -s B101
[doc8]
# File extensions to check
extensions = .rst
# TODO(yamahata): doc8 work around. remove this when doc8 is fixed.
# doc8(actually docutils) handles relative path inclusion differently from sphinx.
# doc8 wrongly alerts invalid inclusion path with recursive relative inclusion
# https://sourceforge.net/p/docutils/bugs/211/
ignore-path-errors=doc/source/devref/index.rst;D000
[flake8]
# TODO(dougwig) -- uncomment this to test for remaining linkages
# N530 direct neutron imports not allowed
# W504 line break after binary operator
show-source = True
# TODO(mkolesni): Fix I202 if you really care about import checks
ignore = N530,I202,W504
# H106: Dont put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality
# H205: Use assert(Greater|Less)(Equal) for comparison
# H904: Delay string interpolations at logging calls
enable-extensions=H106,H203,H204,H205,H904
exclude=./.*,dist,doc,releasenotes,*lib/python*,*egg,build,tools
import-order-style = pep8
[flake8:local-plugins]
extension =
# Checks from neutron-lib
N521 = neutron_lib.hacking.checks:use_jsonutils
N524 = neutron_lib.hacking.checks:check_no_contextlib_nested
N529 = neutron_lib.hacking.checks:no_mutable_default_args
N530 = neutron_lib.hacking.checks:check_neutron_namespace_imports
N532 = neutron_lib.hacking.translation_checks:check_log_warn_deprecated
N534 = neutron_lib.hacking.translation_checks:check_raised_localized_exceptions
N536 = neutron_lib.hacking.checks:assert_equal_none
N537 = neutron_lib.hacking.translation_checks:no_translate_logs
[testenv:bashate]
commands = bash -c "find {toxinidir} \
-not \( -type d -name .\?\* -prune \) \
-type f \
\( \
-name \*.sh \
-or \
-path \*/devstack/\*settings\* \
-or \
-path \*/devstack/devstackgaterc \
-or \
-path \*/devstack/entry_points \
-or \
-path \*/devstack/functions \
-or \
-path \*/devstack/odl-releases/common \
-or \
-path \*/devstack/override-defaults \
\) \
# E005 file does not begin with #! or have a .sh prefix
# E006 check for lines longer than 79 columns
# E042 local declaration hides errors
# E043 Arithmetic compound has inconsistent return semantics
-print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"
whitelist_externals = bash
[testenv:capitald]
usedevelop = False
skip_install = True
deps =
# Check if "Opendaylight" word is in any file
# Only "OpenDaylight" (with uppercase 'D') should be used
commands = bash -c "! grep \
--exclude-dir='.*' \
--exclude-dir='cover' \
--exclude-dir='__pycache__' \
--exclude='tox.ini' \
--exclude='ChangeLog' \
--exclude='*.py' \
--exclude='*.pyc' \
--exclude='*~' \
--recursive \
--line-number \
Opendaylight \
{toxinidir}"
whitelist_externals = bash
[testenv:genconfig]
deps = -r{toxinidir}/requirements.txt
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
commands =
mkdir -p etc/neutron/plugins/ml2
oslo-config-generator --namespace ml2_odl --output-file etc/neutron/plugins/ml2/ml2_conf_odl.ini.sample
whitelist_externals = mkdir
[testenv:releasenotes]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/wallaby}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:dev]
# run locally (not in the gate) using editable mode
# https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
# note that order is important to ensure dependencies don't override
commands =
pip install -q -e "git+https://opendev.org/x/networking-l2gw#egg=networking_l2gw"
pip install -q -e "git+https://opendev.org/openstack/networking-bgpvpn#egg=networking_bgpvpn"
pip install -q -e "git+https://opendev.org/openstack/networking-sfc#egg=networking_sfc"
pip install -q -e "git+https://opendev.org/openstack/ceilometer#egg=ceilometer"
pip install -q -e "git+https://opendev.org/openstack/neutron#egg=neutron"
{[testenv]commands}
[testenv:pep8-dev]
deps = {[testenv]deps}
-r{toxinidir}/doc/requirements.txt
commands =
{[testenv:dev]commands}
{[testenv:pep8]commands}