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
66 allowlist_externals = install_honeynode.sh
67 depends = buildcontroller
68 # sims profiles does not strictly depends on buildcontroller
69 # but this dependency avoids race condition in the gate
71 ./install_honeynode.sh 1.2.1
74 allowlist_externals = install_honeynode.sh
75 depends = buildcontroller
77 ./install_honeynode.sh 2.2.1
80 allowlist_externals = install_honeynode.sh
81 depends = buildcontroller
83 ./install_honeynode.sh 7.1
86 depends = buildcontroller
87 #the following lines retrieve unofficial package of GNPy with REST support from Orange opensource Gitlab repo
89 PIP_EXTRA_INDEX_URL = https://gitlab.com/api/v4/projects/33090323/packages/pypi/simple
91 # USE_ODL_RESTCONF_VERSION=draft-bierman02
93 -r{toxinidir}/tests/requirements.txt
94 -r{toxinidir}/tests/test-requirements.txt
97 allowlist_externals = launch_tests.sh
101 USE_ODL_RESTCONF_VERSION
104 ./launch_tests.sh pce {posargs:}
106 [testenv:build_karaf_tests121]
107 depends = buildcontroller
108 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
109 allowlist_externals = launch_tests.sh
113 USE_ODL_ALT_KARAF_ENV=./karaf121.env
114 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
116 ./build_karaf_for_tests.sh
119 depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
120 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
121 allowlist_externals = launch_tests.sh
125 USE_ODL_RESTCONF_VERSION
128 # USE_ODL_RESTCONF_VERSION=draft-bierman02
129 USE_ODL_ALT_KARAF_ENV=./karaf121.env
130 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
132 ./launch_tests.sh 1.2.1 {posargs:}
133 # By default, all tests in the folder transportpce_tests/1.2.1/ are run.
134 # Though, a restricted list of tests can be passed as argument to 'tox -e tests121'.
135 # For example, 'tox -e tests121 portmapping' will run only the portmapping test.
136 # and 'tox -e tests121 "portmapping pce"' will run the portmapping and pce tests.
137 # Additionnally, a different launcher command than 'nosetests --with-xunit' can be
138 # used by exporting the variable LAUNCHER. For example 'export LAUNCHER="python3"'
139 # which is more verbose than nose or 'export LAUNCHER="ls -l"' to only list script
142 [testenv:build_karaf_tests221]
143 depends = buildcontroller
144 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
145 allowlist_externals = launch_tests.sh
149 USE_ODL_ALT_KARAF_ENV=./karaf221.env
150 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
152 ./build_karaf_for_tests.sh
155 depends = buildcontroller,build_karaf_tests221,sims,tests71
156 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
157 allowlist_externals = launch.sh
161 USE_ODL_RESTCONF_VERSION
164 # USE_ODL_RESTCONF_VERSION=draft-bierman02
165 USE_ODL_ALT_KARAF_ENV=./karaf221.env
166 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
172 depends = buildcontroller,build_karaf_tests221,sims221,tests71
173 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
174 allowlist_externals = launch_tests.sh
179 USE_ODL_RESTCONF_VERSION
182 # USE_ODL_RESTCONF_VERSION=draft-bierman02
183 USE_ODL_ALT_KARAF_ENV=./karaf221.env
184 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
186 ./launch_tests.sh 2.2.1 {posargs:}
188 [testenv:build_karaf_tests71]
189 depends = buildcontroller
190 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
191 allowlist_externals = launch_tests.sh
195 USE_ODL_ALT_KARAF_ENV=./karaf71.env
196 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
198 ./build_karaf_for_tests.sh
201 depends = buildcontroller,build_karaf_tests71,sims71,tests_tapi
202 allowlist_externals = launch_tests.sh
207 USE_ODL_RESTCONF_VERSION
210 # USE_ODL_RESTCONF_VERSION=draft-bierman02
211 USE_ODL_ALT_KARAF_ENV=./karaf71.env
212 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
214 ./launch_tests.sh 7.1 {posargs:}
216 [testenv:build_karaf_tests_hybrid]
217 depends = buildcontroller
218 allowlist_externals = launch_tests.sh
222 USE_ODL_ALT_KARAF_ENV=./karaf121.env
223 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
225 ./build_karaf_for_tests.sh
227 [testenv:tests_hybrid]
228 depends = buildcontroller,build_karaf_tests_hybrid,sims121,sims221,sims71,tests121,tests221,tests71
229 #the last dependency is to avoid temporarily concurrent ressources problem in parallel mode
230 allowlist_externals = launch_tests.sh
235 USE_ODL_RESTCONF_VERSION
238 # USE_ODL_RESTCONF_VERSION=draft-bierman02
239 USE_ODL_ALT_KARAF_ENV=./karaf121.env
240 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
242 # nosetests --with-xunit transportpce_tests/hybrid/test01_device_change_notifications.py
243 ./launch_tests.sh hybrid {posargs:}
246 depends = buildcontroller,build_karaf_tests221,sims221
247 allowlist_externals = launch_tests.sh add_tapi_feature_to_tests221.sh
254 USE_ODL_RESTCONF_VERSION
257 # USE_ODL_RESTCONF_VERSION=draft-bierman02
258 USE_ODL_ALT_KARAF_ENV=./karaf221.env
259 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
265 # ./add_tapi_feature_to_tests221.sh
266 - ./launch_tests.sh tapi {posargs:}
268 [testenv:with_docker]
269 depends = buildcontroller,sims221
270 allowlist_externals = launch_tests.sh
276 USE_ODL_RESTCONF_VERSION
283 INSTALL_NBINOTIFICATIONS=True
284 # USE_ODL_RESTCONF_VERSION=draft-bierman02
287 ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0
288 ./launch_tests.sh with_docker {posargs:}
289 ./dockercmd.sh container rm -f tpce_kafka1
299 deps = -rdocs/requirements.txt
301 sphinx-build -q -W --keep-going -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
303 [testenv:docs-linkcheck]
311 deps = -rdocs/requirements.txt
312 commands = sphinx-build -q -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck
314 [testenv:checkbashisms]
316 allowlist_externals = sh
321 sh -c 'command checkbashisms>/dev/null || sudo yum install -y devscripts-checkbashisms || sudo yum install -y devscripts-minimal || sudo yum install -y devscripts \
322 || 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 \
323 || (echo "checkbashisms command not found - please install it \
324 (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)'
325 find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f \{\} +
330 -rdocs/requirements.txt
331 sphinxcontrib-spelling
333 commands = sphinx-build -b spelling -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/spelling
339 autopep8 --max-line-length 120 --in-place --recursive transportpce_tests/
341 [testenv:pylint_full]
344 allowlist_externals = find
346 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 \{\} +
351 allowlist_externals = find
353 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}$" \{\} +
358 allowlist_externals = find
361 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/ \{\} +
362 #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/ \{\} +
364 [testenv:pyangformat]
367 allowlist_externals = sh
370 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'
372 [testenv:pre-commit-install]
377 pre-commit install --hook-type commit-msg
379 [testenv:pre-commit-uninstall]
384 pre-commit uninstall --hook-type commit-msg
386 [testenv:pre-commit-autoupdate]
390 pre-commit autoupdate
397 pre-commit run --all-files --show-diff-on-failure
398 pre-commit run gitlint-ci --hook-stage manual
404 gitlint --config ../.gitlint
406 [testenv:allure-report-init]
408 deps = allure-pytest>=2.10.0
409 # allure is under Apache License 2.0
410 allowlist_externals =
414 mkdir -p allure-report
415 sed -i_ '$a\allure-pytest # Apache License 2.0' ./test-requirements.txt
417 [testenv:allure-report-serve]
419 allowlist_externals =
422 allure serve "allure-report"