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_lightynode.sh
68 depends = buildcontroller
70 ./install_lightynode.sh {posargs:}
74 allowlist_externals = install_sims.sh
75 depends = buildcontroller
76 # sims profiles does not strictly depends on buildcontroller
77 # but this dependency avoids race condition in the gate
79 ./install_sims.sh 1.2.1
83 allowlist_externals = install_sims.sh
84 depends = buildcontroller
86 ./install_sims.sh 2.2.1
90 allowlist_externals = install_sims.sh
91 depends = buildcontroller
96 depends = buildcontroller
97 #the following lines retrieve unofficial package of GNPy with REST support from Orange opensource Gitlab repo
99 PIP_EXTRA_INDEX_URL = https://gitlab.com/api/v4/projects/33090323/packages/pypi/simple
101 # USE_ODL_RESTCONF_VERSION=draft-bierman02
103 -r{toxinidir}/tests/requirements.txt
104 -r{toxinidir}/tests/test-requirements.txt
107 allowlist_externals = launch_tests.sh
111 USE_ODL_RESTCONF_VERSION
114 ./launch_tests.sh pce {posargs:}
116 [testenv:build_karaf_tests121]
117 depends = buildcontroller
118 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
119 allowlist_externals = launch_tests.sh
123 USE_ODL_ALT_KARAF_ENV=./karaf121.env
124 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
126 ./build_karaf_for_tests.sh
129 depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
130 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
131 allowlist_externals = launch_tests.sh
135 USE_ODL_RESTCONF_VERSION
138 # USE_ODL_RESTCONF_VERSION=draft-bierman02
139 USE_ODL_ALT_KARAF_ENV=./karaf121.env
140 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
142 ./launch_tests.sh 1.2.1 {posargs:}
143 # By default, all tests in the folder transportpce_tests/1.2.1/ are run.
144 # Though, a restricted list of tests can be passed as argument to 'tox -e tests121'.
145 # For example, 'tox -e tests121 portmapping' will run only the portmapping test.
146 # and 'tox -e tests121 "portmapping pce"' will run the portmapping and pce tests.
147 # Additionnally, a different launcher command than 'nosetests --with-xunit' can be
148 # used by exporting the variable LAUNCHER. For example 'export LAUNCHER="python3"'
149 # which is more verbose than nose or 'export LAUNCHER="ls -l"' to only list script
152 [testenv:build_karaf_tests221]
153 depends = buildcontroller
154 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
155 allowlist_externals = launch_tests.sh
159 USE_ODL_ALT_KARAF_ENV=./karaf221.env
160 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
162 ./build_karaf_for_tests.sh
165 depends = buildcontroller,build_karaf_tests221,sims,tests71
166 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
167 allowlist_externals = launch.sh
171 USE_ODL_RESTCONF_VERSION
174 # USE_ODL_RESTCONF_VERSION=draft-bierman02
175 USE_ODL_ALT_KARAF_ENV=./karaf221.env
176 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
182 depends = buildcontroller,build_karaf_tests221,sims221,tests71
183 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
184 allowlist_externals = launch_tests.sh
189 USE_ODL_RESTCONF_VERSION
192 # USE_ODL_RESTCONF_VERSION=draft-bierman02
193 USE_ODL_ALT_KARAF_ENV=./karaf221.env
194 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
196 ./launch_tests.sh 2.2.1 {posargs:}
198 [testenv:build_karaf_tests71]
199 depends = buildcontroller
200 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
201 allowlist_externals = launch_tests.sh
205 USE_ODL_ALT_KARAF_ENV=./karaf71.env
206 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
208 ./build_karaf_for_tests.sh
211 depends = buildcontroller,build_karaf_tests71,sims71,tests_tapi
212 allowlist_externals = launch_tests.sh
217 USE_ODL_RESTCONF_VERSION
220 # USE_ODL_RESTCONF_VERSION=draft-bierman02
221 USE_ODL_ALT_KARAF_ENV=./karaf71.env
222 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
224 ./launch_tests.sh 7.1 {posargs:}
226 [testenv:build_karaf_tests_hybrid]
227 depends = buildcontroller
228 allowlist_externals = launch_tests.sh
232 USE_ODL_ALT_KARAF_ENV=./karaf121.env
233 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
235 ./build_karaf_for_tests.sh
237 [testenv:tests_hybrid]
238 depends = buildcontroller,build_karaf_tests_hybrid,sims121,sims221,sims71,tests121,tests221,tests71
239 #the last dependency is to avoid temporarily concurrent ressources problem in parallel mode
240 allowlist_externals = launch_tests.sh
245 USE_ODL_RESTCONF_VERSION
248 # USE_ODL_RESTCONF_VERSION=draft-bierman02
249 USE_ODL_ALT_KARAF_ENV=./karaf121.env
250 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
252 # nosetests --with-xunit transportpce_tests/hybrid/test01_device_change_notifications.py
253 ./launch_tests.sh hybrid {posargs:}
256 depends = buildcontroller,build_karaf_tests221,sims221
257 allowlist_externals = launch_tests.sh
258 # add_tapi_feature_to_tests221.sh
265 USE_ODL_RESTCONF_VERSION
268 # USE_ODL_RESTCONF_VERSION=draft-bierman02
269 USE_ODL_ALT_KARAF_ENV=./karaf221.env
270 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
276 # ./add_tapi_feature_to_tests221.sh
277 ./launch_tests.sh tapi {posargs:}
279 [testenv:with_docker]
280 depends = buildcontroller,sims221
281 allowlist_externals = launch_tests.sh dockercmd.sh
286 USE_ODL_RESTCONF_VERSION
293 INSTALL_NBINOTIFICATIONS=True
294 # USE_ODL_RESTCONF_VERSION=draft-bierman02
297 ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0
298 ./launch_tests.sh with_docker {posargs:}
299 ./dockercmd.sh container rm -f tpce_kafka1
309 deps = -rdocs/requirements.txt
311 sphinx-build -q -W --keep-going -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
313 [testenv:docs-linkcheck]
321 deps = -rdocs/requirements.txt
322 commands = sphinx-build -q -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck
324 [testenv:checkbashisms]
326 allowlist_externals = sh
331 sh -c 'command checkbashisms>/dev/null || sudo yum install -y devscripts-checkbashisms || sudo yum install -y devscripts-minimal || sudo yum install -y devscripts \
332 || 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 \
333 || (echo "checkbashisms command not found - please install it \
334 (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)'
335 find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f \{\} +
340 -rdocs/requirements.txt
341 sphinxcontrib-spelling
343 commands = sphinx-build -b spelling -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/spelling
349 autopep8 --max-line-length 120 --in-place --recursive transportpce_tests/
351 [testenv:pylint_full]
354 allowlist_externals = find
356 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 \{\} +
361 allowlist_externals = find
363 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}$" \{\} +
368 allowlist_externals = find
371 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/ \{\} +
372 #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/ \{\} +
374 [testenv:pyangformat]
377 allowlist_externals = sh
380 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'
382 [testenv:pre-commit-install]
387 pre-commit install --hook-type commit-msg
389 [testenv:pre-commit-uninstall]
394 pre-commit uninstall --hook-type commit-msg
396 [testenv:pre-commit-autoupdate]
400 pre-commit autoupdate
406 allowlist_externals = sh
411 sh -c 'which cpan || sudo yum install -y perl-CPAN \
412 || (echo "cpan command not found - please install it \
413 (e.g. sudo apt-get install perl-modules | yum install perl-CPAN )" >&2 && exit 1)'
414 pre-commit run --all-files --show-diff-on-failure
415 pre-commit run gitlint-ci --hook-stage manual
421 gitlint --config ../.gitlint
423 [testenv:allure-report-init]
425 deps = allure-pytest>=2.10.0
426 # allure is under Apache License 2.0
427 allowlist_externals =
431 mkdir -p allure-report
432 sed -i_ '$a\allure-pytest # Apache License 2.0' ./test-requirements.txt
434 [testenv:allure-report-serve]
436 allowlist_externals =
439 allure serve "allure-report"