3 envlist = buildcontroller,testsPCE,
4 sims121,build_karaf_tests121,tests121,
5 sims221,build_karaf_tests221,tests221,
6 sims71,build_karaf_tests71,tests71,
7 build_karaf_tests_hybrid,tests_hybrid,
18 passenv = USE_LIGHTY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
24 -r{toxinidir}/tests/requirements.txt
25 -r{toxinidir}/tests/test-requirements.txt
27 changedir = {toxinidir}/tests
28 parallel_show_output = true
30 [testenv:buildcontroller]
31 whitelist_externals = build_controller.sh
36 whitelist_externals = install_honeynode.sh
37 depends = buildcontroller
38 # sims profiles does not strictly depends on buildcontroller
39 # but this dependency avoids race condition in the gate
41 ./install_honeynode.sh 1.2.1
44 whitelist_externals = install_honeynode.sh
45 depends = buildcontroller
47 ./install_honeynode.sh 2.2.1
50 whitelist_externals = install_honeynode.sh
51 depends = buildcontroller
53 ./install_honeynode.sh 7.1
56 depends = buildcontroller
57 whitelist_externals = launch_tests.sh
58 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
62 ./launch_tests.sh pce {posargs:}
64 [testenv:build_karaf_tests121]
65 depends = buildcontroller
66 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
67 whitelist_externals = launch_tests.sh
68 passenv = LAUNCHER USE_LIGHTY
71 USE_ODL_ALT_KARAF_ENV=./karaf121.env
72 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
74 ./build_karaf_for_tests.sh
77 depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
78 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
79 whitelist_externals = launch_tests.sh
80 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
83 # USE_ODL_RESTCONF_VERSION=draft-bierman02
84 USE_ODL_ALT_KARAF_ENV=./karaf121.env
85 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
87 ./launch_tests.sh 1.2.1 {posargs:}
88 # By default, all tests in the folder transportpce_tests/1.2.1/ are run.
89 # Though, a restricted list of tests can be passed as argument to 'tox -e tests121'.
90 # For example, 'tox -e tests121 portmapping' will run only the portmapping test.
91 # and 'tox -e tests121 "portmapping pce"' will run the portmapping and pce tests.
92 # Additionnally, a different launcher command than 'nosetests --with-xunit' can be
93 # used by exporting the variable LAUNCHER. For example 'export LAUNCHER="python3"'
94 # which is more verbose than nose or 'export LAUNCHER="ls -l"' to only list script
97 [testenv:build_karaf_tests221]
98 depends = buildcontroller
99 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
100 whitelist_externals = launch_tests.sh
101 passenv = LAUNCHER USE_LIGHTY
104 USE_ODL_ALT_KARAF_ENV=./karaf221.env
105 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
107 ./build_karaf_for_tests.sh
110 depends = buildcontroller,build_karaf_tests221,sims221,tests71
111 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
112 whitelist_externals = launch_tests.sh
113 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
116 # USE_ODL_RESTCONF_VERSION=draft-bierman02
117 USE_ODL_ALT_KARAF_ENV=./karaf221.env
118 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
120 ./launch_tests.sh 2.2.1 {posargs:}
122 [testenv:build_karaf_tests71]
123 depends = buildcontroller
124 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
125 whitelist_externals = launch_tests.sh
126 passenv = LAUNCHER USE_LIGHTY
129 USE_ODL_ALT_KARAF_ENV=./karaf71.env
130 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
132 ./build_karaf_for_tests.sh
135 depends = buildcontroller,build_karaf_tests71,sims71
136 whitelist_externals = launch_tests.sh
137 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
140 # USE_ODL_RESTCONF_VERSION=draft-bierman02
141 USE_ODL_ALT_KARAF_ENV=./karaf71.env
142 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
144 ./launch_tests.sh 7.1 {posargs:}
146 [testenv:build_karaf_tests_hybrid]
147 depends = buildcontroller
148 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
149 whitelist_externals = launch_tests.sh
150 passenv = LAUNCHER USE_LIGHTY
153 USE_ODL_ALT_KARAF_ENV=./karaf121.env
154 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
156 ./build_karaf_for_tests.sh
158 [testenv:tests_hybrid]
159 depends = buildcontroller,sims121,sims221,sims71,tests121,tests221,tests71
160 #the last dependency is to avoid temporarily concurrent ressources problem in parallel mode
161 whitelist_externals = launch_tests.sh
162 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
165 USE_ODL_ALT_KARAF_ENV=./karaf121.env
166 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
168 # nosetests --with-xunit transportpce_tests/hybrid/test01_device_change_notifications.py
169 ./launch_tests.sh hybrid {posargs:}
172 depends = buildcontroller
173 whitelist_externals = launch_tests.sh
175 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
177 #sudo docker pull atriki/gnpyrest:v1.2
178 ./dockercmd.sh run -d -p 8008:5000 --name gnpy_tpce_rest1 atriki/gnpyrest:v1.2
179 ./launch_tests.sh with_docker gnpy
180 ./dockercmd.sh container rm -f gnpy_tpce_rest1
182 [testenv:nbinotifications]
183 depends = buildcontroller,sims221
184 whitelist_externals = launch_tests.sh
186 passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
188 ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0
189 ./launch_tests.sh with_docker nbinotifications
190 ./dockercmd.sh container rm -f tpce_kafka1
193 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
195 deps = -rdocs/requirements.txt
197 sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
199 [testenv:docs-linkcheck]
200 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
202 deps = -rdocs/requirements.txt
203 commands = sphinx-build -q -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck
205 [testenv:checkbashisms]
207 whitelist_externals = sh
212 sh -c 'command checkbashisms>/dev/null || sudo yum install devscripts-minimal || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)'
213 find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f \{\} +
218 -rdocs/requirements.txt
219 sphinxcontrib-spelling
221 commands = sphinx-build -b spelling -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/spelling
227 autopep8 --max-line-length 120 --in-place --recursive transportpce_tests/
229 [testenv:pylint_full]
232 whitelist_externals = find
234 find transportpce_tests/ -name *.py -exec pylint --fail-under=9.22 --max-line-length=120 --disable=missing-docstring --module-rgx="([a-z0-9_]+$)|([0-9.]{1,30}$)" --method-rgx="(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$" --variable-rgx="[a-zA-Z_][a-zA-Z0-9_]{1,30}$" --reports=y --score=y --output-format=colorized \{\} +
239 whitelist_externals = find
241 find transportpce_tests/ -name *.py -exec pylint --fail-under=10 --max-line-length=120 --disable=missing-docstring --disable=fixme --disable=duplicate-code --module-rgx="([a-z0-9_]+$)|([0-9.]{1,30}$)" --method-rgx="(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$" --variable-rgx="[a-zA-Z_][a-zA-Z0-9_]{1,30}$" \{\} +
246 whitelist_externals = find
249 find ../api/ -name target -prune -o -name *.yang -exec pyang --lint --canonical --max-line-length=120 -p../api/src/main/yang/:../ordmodels/common/src/main/yang/:../ordmodels/service/src/main/yang/:../tapimodels/src/main/yang/ \{\} +
250 #find ../api/ ../ordmodels/ ../tapimodels/ -name target -prune -o -name *.yang -exec pyang --lint --canonical --max-line-length=120 -p../api/src/main/yang/:../ordmodels/common/src/main/yang/:../ordmodels/service/src/main/yang/:../tapimodels/src/main/yang/ \{\} +
252 [testenv:pyangformat]
255 whitelist_externals = sh
258 sh -c 'find ../api/ -name target -prune -o -name *.yang -print | while read -r fname; do pyang -f yang --yang-canonical --yang-remove-unused-imports --max-line-length=120 --keep-comments -p../api/src/main/yang/:../ordmodels/common/src/main/yang/:../ordmodels/service/src/main/yang/:../tapimodels/src/main/yang/ "$fname" -o /tmp/tmpfile.$$ && mv /tmp/tmpfile.$$ "$fname";done'
260 [testenv:pre-commit-install]
265 pre-commit install --hook-type commit-msg
267 [testenv:pre-commit-uninstall]
272 pre-commit uninstall --hook-type commit-msg
274 [testenv:pre-commit-autoupdate]
278 pre-commit autoupdate
285 pre-commit run --all-files --show-diff-on-failure
286 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
287 # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
288 # Its default arguments --passed and --msg-filename are different from CI recommandations.
289 # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
290 # A dedicated gitlint profile for CI is proposed below. Also to behave fine locally, this profile must have access
291 # to the HOME variable so that Gitlint can retrieve Git user settings.