3 envlist = buildcontroller
15 build_karaf_tests_hybrid
46 -r{toxinidir}/tests/requirements.txt
47 -r{toxinidir}/tests/test-requirements.txt
49 changedir = {toxinidir}/tests
50 parallel_show_output = true
52 [testenv:buildcontroller]
53 allowlist_externals = build_controller.sh
58 allowlist_externals = build.sh
59 depends = buildcontroller,tests_hybrid
60 changedir = {toxinidir}/lighty
65 allowlist_externals = install_honeynode.sh
66 depends = buildcontroller
67 # sims profiles does not strictly depends on buildcontroller
68 # but this dependency avoids race condition in the gate
70 ./install_honeynode.sh 1.2.1
73 allowlist_externals = install_honeynode.sh
74 depends = buildcontroller
76 ./install_honeynode.sh 2.2.1
79 allowlist_externals = install_honeynode.sh
80 depends = buildcontroller
82 ./install_honeynode.sh 7.1
85 depends = buildcontroller
86 #the following lines retrieve unofficial package of GNPy with REST support from Orange opensource Gitlab repo
88 PIP_EXTRA_INDEX_URL = https://gitlab.com/api/v4/projects/33090323/packages/pypi/simple
90 # USE_ODL_RESTCONF_VERSION=draft-bierman02
92 -r{toxinidir}/tests/requirements.txt
93 -r{toxinidir}/tests/test-requirements.txt
96 allowlist_externals = launch_tests.sh
100 USE_ODL_RESTCONF_VERSION
103 ./launch_tests.sh pce {posargs:}
105 [testenv:build_karaf_tests121]
106 depends = buildcontroller
107 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
108 allowlist_externals = launch_tests.sh
112 USE_ODL_ALT_KARAF_ENV=./karaf121.env
113 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
115 ./build_karaf_for_tests.sh
118 depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
119 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
120 allowlist_externals = launch_tests.sh
124 USE_ODL_RESTCONF_VERSION
127 # USE_ODL_RESTCONF_VERSION=draft-bierman02
128 USE_ODL_ALT_KARAF_ENV=./karaf121.env
129 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
131 ./launch_tests.sh 1.2.1 {posargs:}
132 # By default, all tests in the folder transportpce_tests/1.2.1/ are run.
133 # Though, a restricted list of tests can be passed as argument to 'tox -e tests121'.
134 # For example, 'tox -e tests121 portmapping' will run only the portmapping test.
135 # and 'tox -e tests121 "portmapping pce"' will run the portmapping and pce tests.
136 # Additionnally, a different launcher command than 'nosetests --with-xunit' can be
137 # used by exporting the variable LAUNCHER. For example 'export LAUNCHER="python3"'
138 # which is more verbose than nose or 'export LAUNCHER="ls -l"' to only list script
141 [testenv:build_karaf_tests221]
142 depends = buildcontroller
143 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
144 allowlist_externals = launch_tests.sh
148 USE_ODL_ALT_KARAF_ENV=./karaf221.env
149 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
151 ./build_karaf_for_tests.sh
154 depends = buildcontroller,build_karaf_tests221,sims,tests71
155 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
156 allowlist_externals = launch.sh
160 USE_ODL_RESTCONF_VERSION
163 # USE_ODL_RESTCONF_VERSION=draft-bierman02
164 USE_ODL_ALT_KARAF_ENV=./karaf221.env
165 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
171 depends = buildcontroller,build_karaf_tests221,sims221,tests71
172 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
173 allowlist_externals = launch_tests.sh
177 USE_ODL_RESTCONF_VERSION
180 # USE_ODL_RESTCONF_VERSION=draft-bierman02
181 USE_ODL_ALT_KARAF_ENV=./karaf221.env
182 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
184 ./launch_tests.sh 2.2.1 {posargs:}
186 [testenv:build_karaf_tests71]
187 depends = buildcontroller
188 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
189 allowlist_externals = launch_tests.sh
193 USE_ODL_ALT_KARAF_ENV=./karaf71.env
194 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
196 ./build_karaf_for_tests.sh
199 depends = buildcontroller,build_karaf_tests71,sims71,tests_tapi
200 allowlist_externals = launch_tests.sh
204 USE_ODL_RESTCONF_VERSION
207 # USE_ODL_RESTCONF_VERSION=draft-bierman02
208 USE_ODL_ALT_KARAF_ENV=./karaf71.env
209 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
211 ./launch_tests.sh 7.1 {posargs:}
213 [testenv:build_karaf_tests_hybrid]
214 depends = buildcontroller
215 allowlist_externals = launch_tests.sh
219 USE_ODL_ALT_KARAF_ENV=./karaf121.env
220 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
222 ./build_karaf_for_tests.sh
224 [testenv:tests_hybrid]
225 depends = buildcontroller,build_karaf_tests_hybrid,sims121,sims221,sims71,tests121,tests221,tests71
226 #the last dependency is to avoid temporarily concurrent ressources problem in parallel mode
227 allowlist_externals = launch_tests.sh
231 USE_ODL_RESTCONF_VERSION
234 # USE_ODL_RESTCONF_VERSION=draft-bierman02
235 USE_ODL_ALT_KARAF_ENV=./karaf121.env
236 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
238 # nosetests --with-xunit transportpce_tests/hybrid/test01_device_change_notifications.py
239 ./launch_tests.sh hybrid {posargs:}
242 depends = buildcontroller,build_karaf_tests221,sims221
243 allowlist_externals = launch_tests.sh add_tapi_feature_to_tests221.sh
249 USE_ODL_RESTCONF_VERSION
252 # USE_ODL_RESTCONF_VERSION=draft-bierman02
253 USE_ODL_ALT_KARAF_ENV=./karaf221.env
254 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
260 # ./add_tapi_feature_to_tests221.sh
261 - ./launch_tests.sh tapi {posargs:}
263 [testenv:with_docker]
264 depends = buildcontroller,sims221
265 allowlist_externals = launch_tests.sh
270 USE_ODL_RESTCONF_VERSION
277 INSTALL_NBINOTIFICATIONS=True
278 # USE_ODL_RESTCONF_VERSION=draft-bierman02
281 ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0
282 ./launch_tests.sh with_docker {posargs:}
283 ./dockercmd.sh container rm -f tpce_kafka1
293 deps = -rdocs/requirements.txt
295 sphinx-build -q -W --keep-going -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
297 [testenv:docs-linkcheck]
305 deps = -rdocs/requirements.txt
306 commands = sphinx-build -q -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck
308 [testenv:checkbashisms]
310 allowlist_externals = sh
315 sh -c 'command checkbashisms>/dev/null || sudo yum install -y devscripts-checkbashisms || sudo yum install -y devscripts-minimal || sudo yum install -y devscripts \
316 || 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 \
317 || (echo "checkbashisms command not found - please install it \
318 (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)'
319 find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f \{\} +
324 -rdocs/requirements.txt
325 sphinxcontrib-spelling
327 commands = sphinx-build -b spelling -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/spelling
333 autopep8 --max-line-length 120 --in-place --recursive transportpce_tests/
335 [testenv:pylint_full]
338 allowlist_externals = find
340 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 \{\} +
345 allowlist_externals = find
347 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}$" \{\} +
352 allowlist_externals = find
355 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/ \{\} +
356 #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/ \{\} +
358 [testenv:pyangformat]
361 allowlist_externals = sh
364 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'
366 [testenv:pre-commit-install]
371 pre-commit install --hook-type commit-msg
373 [testenv:pre-commit-uninstall]
378 pre-commit uninstall --hook-type commit-msg
380 [testenv:pre-commit-autoupdate]
384 pre-commit autoupdate
391 pre-commit run --all-files --show-diff-on-failure
392 pre-commit run gitlint-ci --hook-stage manual
398 gitlint --config ../.gitlint
400 [testenv:allure-report-init]
402 deps = allure-pytest>=2.10.0
403 # allure is under Apache License 2.0
404 allowlist_externals =
408 mkdir -p allure-report
409 sed -i_ '$a\allure-pytest # Apache License 2.0' ./test-requirements.txt
411 [testenv:allure-report-serve]
413 allowlist_externals =
416 allure serve "allure-report"