3 envlist = buildcontroller
15 build_karaf_tests_hybrid
47 -r{toxinidir}/tests/requirements.txt
48 -r{toxinidir}/tests/test-requirements.txt
50 changedir = {toxinidir}/tests
51 parallel_show_output = true
53 [testenv:buildcontroller]
54 allowlist_externals = build_controller.sh
59 allowlist_externals = build.sh
60 depends = buildcontroller,tests_hybrid
61 changedir = {toxinidir}/lighty
67 allowlist_externals = install_sims.sh
68 depends = buildcontroller
69 # sims profiles does not strictly depends on buildcontroller
70 # but this dependency avoids race condition in the gate
72 ./install_sims.sh 1.2.1
76 allowlist_externals = install_sims.sh
77 depends = buildcontroller
79 ./install_sims.sh 2.2.1
83 allowlist_externals = install_sims.sh
84 depends = buildcontroller
89 depends = buildcontroller
90 #the following lines retrieve unofficial package of GNPy with REST support from Orange opensource Gitlab repo
92 PIP_EXTRA_INDEX_URL = https://gitlab.com/api/v4/projects/33090323/packages/pypi/simple
94 # USE_ODL_RESTCONF_VERSION=draft-bierman02
96 -r{toxinidir}/tests/requirements.txt
97 -r{toxinidir}/tests/test-requirements.txt
100 allowlist_externals = launch_tests.sh
104 USE_ODL_RESTCONF_VERSION
107 ./launch_tests.sh pce {posargs:}
109 [testenv:build_karaf_tests121]
110 depends = buildcontroller
111 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
112 allowlist_externals = launch_tests.sh
116 USE_ODL_ALT_KARAF_ENV=./karaf121.env
117 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
119 ./build_karaf_for_tests.sh
122 depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
123 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
124 allowlist_externals = launch_tests.sh
128 USE_ODL_RESTCONF_VERSION
131 # USE_ODL_RESTCONF_VERSION=draft-bierman02
132 USE_ODL_ALT_KARAF_ENV=./karaf121.env
133 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
135 ./launch_tests.sh 1.2.1 {posargs:}
136 # By default, all tests in the folder transportpce_tests/1.2.1/ are run.
137 # Though, a restricted list of tests can be passed as argument to 'tox -e tests121'.
138 # For example, 'tox -e tests121 portmapping' will run only the portmapping test.
139 # and 'tox -e tests121 "portmapping pce"' will run the portmapping and pce tests.
140 # Additionnally, a different launcher command than 'nosetests --with-xunit' can be
141 # used by exporting the variable LAUNCHER. For example 'export LAUNCHER="python3"'
142 # which is more verbose than nose or 'export LAUNCHER="ls -l"' to only list script
145 [testenv:build_karaf_tests221]
146 depends = buildcontroller
147 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
148 allowlist_externals = launch_tests.sh
152 USE_ODL_ALT_KARAF_ENV=./karaf221.env
153 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
155 ./build_karaf_for_tests.sh
158 depends = buildcontroller,build_karaf_tests221,sims,tests71
159 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
160 allowlist_externals = launch.sh
164 USE_ODL_RESTCONF_VERSION
167 # USE_ODL_RESTCONF_VERSION=draft-bierman02
168 USE_ODL_ALT_KARAF_ENV=./karaf221.env
169 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
175 depends = buildcontroller,build_karaf_tests221,sims221,tests71
176 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
177 allowlist_externals = launch_tests.sh
182 USE_ODL_RESTCONF_VERSION
185 # USE_ODL_RESTCONF_VERSION=draft-bierman02
186 USE_ODL_ALT_KARAF_ENV=./karaf221.env
187 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
189 ./launch_tests.sh 2.2.1 {posargs:}
191 [testenv:build_karaf_tests71]
192 depends = buildcontroller
193 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
194 allowlist_externals = launch_tests.sh
198 USE_ODL_ALT_KARAF_ENV=./karaf71.env
199 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
201 ./build_karaf_for_tests.sh
204 depends = buildcontroller,build_karaf_tests71,sims71,tests_tapi
205 allowlist_externals = launch_tests.sh install_honeynode.sh
209 USE_ODL_RESTCONF_VERSION
212 # USE_ODL_RESTCONF_VERSION=draft-bierman02
214 USE_ODL_ALT_KARAF_ENV=./karaf71.env
215 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
217 ./install_honeynode.sh 7.1
218 ./launch_tests.sh 7.1 {posargs:}
220 [testenv:build_karaf_tests_hybrid]
221 depends = buildcontroller
222 allowlist_externals = launch_tests.sh
226 USE_ODL_ALT_KARAF_ENV=./karaf121.env
227 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
229 ./build_karaf_for_tests.sh
231 [testenv:tests_hybrid]
232 depends = buildcontroller,build_karaf_tests_hybrid,sims121,sims221,sims71,tests121,tests221,tests71
233 #the last dependency is to avoid temporarily concurrent ressources problem in parallel mode
234 allowlist_externals = launch_tests.sh install_honeynode.sh
239 USE_ODL_RESTCONF_VERSION
243 # USE_ODL_RESTCONF_VERSION=draft-bierman02
244 USE_ODL_ALT_KARAF_ENV=./karaf121.env
245 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
247 # nosetests --with-xunit transportpce_tests/hybrid/test01_device_change_notifications.py
248 ./install_honeynode.sh
249 ./launch_tests.sh hybrid {posargs:}
252 depends = buildcontroller,build_karaf_tests221,sims221
253 allowlist_externals = launch_tests.sh
254 # add_tapi_feature_to_tests221.sh
261 USE_ODL_RESTCONF_VERSION
264 # USE_ODL_RESTCONF_VERSION=draft-bierman02
265 USE_ODL_ALT_KARAF_ENV=./karaf221.env
266 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
272 # ./add_tapi_feature_to_tests221.sh
273 ./launch_tests.sh tapi {posargs:}
275 [testenv:with_docker]
276 depends = buildcontroller,sims221
277 allowlist_externals = launch_tests.sh dockercmd.sh install_honeynode.sh
281 USE_ODL_RESTCONF_VERSION
289 INSTALL_NBINOTIFICATIONS=True
290 # USE_ODL_RESTCONF_VERSION=draft-bierman02
293 ./install_honeynode.sh 2.2.1
294 ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0
295 ./launch_tests.sh with_docker {posargs:}
296 ./dockercmd.sh container rm -f tpce_kafka1
306 deps = -rdocs/requirements.txt
308 sphinx-build -q -W --keep-going -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
310 [testenv:docs-linkcheck]
318 deps = -rdocs/requirements.txt
319 commands = sphinx-build -q -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck
321 [testenv:checkbashisms]
323 allowlist_externals = sh
328 sh -c 'command checkbashisms>/dev/null || sudo yum install -y devscripts-checkbashisms || sudo yum install -y devscripts-minimal || sudo yum install -y devscripts \
329 || sudo yum install -y https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Everything/x86_64/os/Packages/d/devscripts-checkbashisms-2.19.6-2.fc31.x86_64.rpm \
330 || (echo "checkbashisms command not found - please install it \
331 (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)'
332 find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f \{\} +
337 -rdocs/requirements.txt
338 sphinxcontrib-spelling
340 commands = sphinx-build -b spelling -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/spelling
346 autopep8 --max-line-length 120 --in-place --recursive transportpce_tests/
348 [testenv:pylint_full]
351 allowlist_externals = find
353 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 \{\} +
358 allowlist_externals = find
360 find transportpce_tests/ -name *.py -exec pylint --fail-under=10 --max-line-length=120 --disable=missing-docstring,import-error --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}$" \{\} +
365 allowlist_externals = find
368 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/ \{\} +
369 #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/ \{\} +
371 [testenv:pyangformat]
374 allowlist_externals = sh
377 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'
379 [testenv:pre-commit-install]
384 pre-commit install --hook-type commit-msg
386 [testenv:pre-commit-uninstall]
391 pre-commit uninstall --hook-type commit-msg
393 [testenv:pre-commit-autoupdate]
397 pre-commit autoupdate
404 pre-commit run --all-files --show-diff-on-failure
405 pre-commit run gitlint-ci --hook-stage manual
411 gitlint --config ../.gitlint
413 [testenv:allure-report-init]
415 deps = allure-pytest>=2.10.0
416 # allure is under Apache License 2.0
417 allowlist_externals =
421 mkdir -p allure-report
422 sed -i_ '$a\allure-pytest # Apache License 2.0' ./test-requirements.txt
424 [testenv:allure-report-serve]
426 allowlist_externals =
429 allure serve "allure-report"