3 envlist = buildcontroller
5 sims121,build_karaf_tests121,tests121,
6 sims221,build_karaf_tests221,tests_tapi,tests221,
7 sims71,build_karaf_tests71,tests71,
8 build_karaf_tests_hybrid,tests_hybrid,
19 passenv = USE_LIGHTY NO_ODL_STARTUP http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OLM_TIMER1 OLM_TIMER2
28 -r{toxinidir}/tests/requirements.txt
29 -r{toxinidir}/tests/test-requirements.txt
31 changedir = {toxinidir}/tests
32 parallel_show_output = true
34 [testenv:buildcontroller]
35 whitelist_externals = build_controller.sh
40 whitelist_externals = build.sh
41 depends = buildcontroller,tests_hybrid
42 changedir = {toxinidir}/lighty
47 whitelist_externals = install_honeynode.sh
48 depends = buildcontroller
49 # sims profiles does not strictly depends on buildcontroller
50 # but this dependency avoids race condition in the gate
52 ./install_honeynode.sh 1.2.1
55 whitelist_externals = install_honeynode.sh
56 depends = buildcontroller
58 ./install_honeynode.sh 2.2.1
61 whitelist_externals = install_honeynode.sh
62 depends = buildcontroller
64 ./install_honeynode.sh 7.1
67 depends = buildcontroller
68 #the following lines retrieve unofficial package of GNPy with REST support from Orange opensource Gitlab repo
70 PIP_EXTRA_INDEX_URL = https://gitlab.com/api/v4/projects/33090323/packages/pypi/simple
72 # USE_ODL_RESTCONF_VERSION=draft-bierman02
74 -r{toxinidir}/tests/requirements.txt
75 -r{toxinidir}/tests/test-requirements.txt
78 whitelist_externals = launch_tests.sh
79 passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
82 ./launch_tests.sh pce {posargs:}
84 [testenv:build_karaf_tests121]
85 depends = buildcontroller
86 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
87 whitelist_externals = launch_tests.sh
88 passenv = LAUNCHER USE_LIGHTY
91 USE_ODL_ALT_KARAF_ENV=./karaf121.env
92 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
94 ./build_karaf_for_tests.sh
97 depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
98 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
99 whitelist_externals = launch_tests.sh
100 passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
103 # USE_ODL_RESTCONF_VERSION=draft-bierman02
104 USE_ODL_ALT_KARAF_ENV=./karaf121.env
105 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
107 ./launch_tests.sh 1.2.1 {posargs:}
108 # By default, all tests in the folder transportpce_tests/1.2.1/ are run.
109 # Though, a restricted list of tests can be passed as argument to 'tox -e tests121'.
110 # For example, 'tox -e tests121 portmapping' will run only the portmapping test.
111 # and 'tox -e tests121 "portmapping pce"' will run the portmapping and pce tests.
112 # Additionnally, a different launcher command than 'nosetests --with-xunit' can be
113 # used by exporting the variable LAUNCHER. For example 'export LAUNCHER="python3"'
114 # which is more verbose than nose or 'export LAUNCHER="ls -l"' to only list script
117 [testenv:build_karaf_tests221]
118 depends = buildcontroller
119 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
120 whitelist_externals = launch_tests.sh
121 passenv = LAUNCHER USE_LIGHTY
124 USE_ODL_ALT_KARAF_ENV=./karaf221.env
125 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
127 ./build_karaf_for_tests.sh
130 depends = buildcontroller,build_karaf_tests221,sims221,tests71
131 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
132 whitelist_externals = launch_tests.sh
133 passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
136 # USE_ODL_RESTCONF_VERSION=draft-bierman02
137 USE_ODL_ALT_KARAF_ENV=./karaf221.env
138 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
140 ./launch_tests.sh 2.2.1 {posargs:}
142 [testenv:build_karaf_tests71]
143 depends = buildcontroller
144 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
145 whitelist_externals = launch_tests.sh
146 passenv = LAUNCHER USE_LIGHTY
149 USE_ODL_ALT_KARAF_ENV=./karaf71.env
150 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
152 ./build_karaf_for_tests.sh
155 depends = buildcontroller,build_karaf_tests71,sims71,tests_tapi
156 whitelist_externals = launch_tests.sh
157 passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
160 # USE_ODL_RESTCONF_VERSION=draft-bierman02
161 USE_ODL_ALT_KARAF_ENV=./karaf71.env
162 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
164 ./launch_tests.sh 7.1 {posargs:}
166 [testenv:build_karaf_tests_hybrid]
167 depends = buildcontroller
168 whitelist_externals = launch_tests.sh
169 passenv = LAUNCHER USE_LIGHTY
172 USE_ODL_ALT_KARAF_ENV=./karaf121.env
173 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
175 ./build_karaf_for_tests.sh
177 [testenv:tests_hybrid]
178 depends = buildcontroller,build_karaf_tests_hybrid,sims121,sims221,sims71,tests121,tests221,tests71
179 #the last dependency is to avoid temporarily concurrent ressources problem in parallel mode
180 whitelist_externals = launch_tests.sh
181 passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
184 # USE_ODL_RESTCONF_VERSION=draft-bierman02
185 USE_ODL_ALT_KARAF_ENV=./karaf121.env
186 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
188 # nosetests --with-xunit transportpce_tests/hybrid/test01_device_change_notifications.py
189 ./launch_tests.sh hybrid {posargs:}
192 depends = buildcontroller,build_karaf_tests221,sims221
193 whitelist_externals = launch_tests.sh add_tapi_feature_to_tests221.sh
194 passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP OLM_TIMER1 OLM_TIMER2 USE_ODL_RESTCONF_VERSION
197 # USE_ODL_RESTCONF_VERSION=draft-bierman02
198 USE_ODL_ALT_KARAF_ENV=./karaf221.env
199 USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
205 # ./add_tapi_feature_to_tests221.sh
206 ./launch_tests.sh tapi {posargs:}
208 [testenv:with_docker]
209 depends = buildcontroller,sims221
210 whitelist_externals = launch_tests.sh
212 passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION OLM_TIMER1 OLM_TIMER2
217 INSTALL_NBINOTIFICATIONS=True
218 # USE_ODL_RESTCONF_VERSION=draft-bierman02
221 ./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0
222 ./launch_tests.sh with_docker {posargs:}
223 ./dockercmd.sh container rm -f tpce_kafka1
226 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
228 deps = -rdocs/requirements.txt
230 sphinx-build -q -W --keep-going -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
232 [testenv:docs-linkcheck]
233 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
235 deps = -rdocs/requirements.txt
236 commands = sphinx-build -q -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck
238 [testenv:checkbashisms]
240 whitelist_externals = sh
245 sh -c 'command checkbashisms>/dev/null || sudo yum install -y devscripts-checkbashisms || sudo yum install -y devscripts-minimal || sudo yum install -y devscripts \
246 || 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 \
247 || (echo "checkbashisms command not found - please install it \
248 (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)'
249 find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f \{\} +
254 -rdocs/requirements.txt
255 sphinxcontrib-spelling
257 commands = sphinx-build -b spelling -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/spelling
263 autopep8 --max-line-length 120 --in-place --recursive transportpce_tests/
265 [testenv:pylint_full]
268 whitelist_externals = find
270 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 \{\} +
275 whitelist_externals = find
277 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}$" \{\} +
282 whitelist_externals = find
285 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/ \{\} +
286 #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/ \{\} +
288 [testenv:pyangformat]
291 whitelist_externals = sh
294 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'
296 [testenv:pre-commit-install]
301 pre-commit install --hook-type commit-msg
303 [testenv:pre-commit-uninstall]
308 pre-commit uninstall --hook-type commit-msg
310 [testenv:pre-commit-autoupdate]
314 pre-commit autoupdate
321 pre-commit run --all-files --show-diff-on-failure
322 pre-commit run gitlint-ci --hook-stage manual
328 gitlint --config ../.gitlint
331 [testenv:allure-report-init]
333 deps = allure-pytest>=2.10.0
334 # allure is under Apache License 2.0
335 whitelist_externals =
339 mkdir -p allure-report
340 sed -i_ '$a\allure-pytest # Apache License 2.0' ./test-requirements.txt
343 [testenv:allure-report-serve]
345 whitelist_externals =
348 allure serve "allure-report"