3 envlist = buildcontroller,testsPCE,sims121,tests121,sims221,tests221,sims71,tests71,tests_hybrid
13 passenv = USE_LIGHTY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
19 -r{toxinidir}/tests/requirements.txt
20 -r{toxinidir}/tests/test-requirements.txt
22 changedir = {toxinidir}/tests
23 parallel_show_output = true
25 [testenv:buildcontroller]
26 whitelist_externals = sh
29 #install maven and JDK11 on the Gate since they are not there by default
30 sh -c "which mvn >/dev/null || ./installMavenCentOS.sh"
31 #install honeynode 1.2.1 simulators
32 #patch OLM constant to speed up tests, unnecessary for PCE tests
33 sh -c "sed -i'_' 's@=.*//#FUNCTESTVAL=@=@g' ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java"
34 #build controller, source JDK_JAVA_OPTIONS to remove illegal reflective acces warnings introduced by Java11
35 sh -c ". $PWD/reflectwarn.sh && cd .. && mvn clean install -B -q -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true -Dodlparent.spotbugs.skip -Dodlparent.checkstyle.skip"
36 sh -c "mv ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java_ ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java"
37 #patch Karaf exec for the same reason at runtime
38 sh -c "sed -i'_' 's@!/bin/sh@!/bin/sh\'$'\n. $(dirname $0)/../../../../tests/reflectwarn.sh@' ../karaf/target/assembly/bin/karaf"
39 # the following command would be the straight and right way to support both BSD and GNU sed versions
40 # sh -c "sed -i'_' '1 a\'$'\n. \$(dirname \$0)/\.\./\.\./\.\./\.\./tests/reflectwarn.sh\n' ../karaf/target/assembly/bin/karaf"
41 # but tox reinterprets the quotes as
42 # sh -c 'sed -i'"'"'_'"'"' '"'"'1 a\'"'"'$'"'"'\n. \$(dirname \$0)/\.\./\.\./\.\./\.\./tests/reflectwarn.sh\n'"'"' ../karaf/target/assembly/bin/karaf'
43 # ,what results in an unexpected different formating (with a $ on the second line and the dot on the third)
44 #build Lighty if needed
45 sh -c 'if [ "$USE_LIGHTY" = "True" ]; then (cd ../lighty && ./build.sh); fi'
48 whitelist_externals = sh
49 depends = buildcontroller
50 # sims profiles does not strictly depends on buildcontroller
51 # but this dependency avoids race condition in the gate
53 - sh -c "./install_honeynode.sh 1.2.1"
56 whitelist_externals = sh
57 depends = buildcontroller
59 - sh -c "./install_honeynode.sh 2.2.1"
62 whitelist_externals = sh
63 depends = buildcontroller
65 - sh -c "./install_honeynode.sh 7.1"
68 depends = buildcontroller
70 nosetests --with-xunit transportpce_tests/pce/test_pce.py
71 nosetests --with-xunit transportpce_tests/pce/test_pce_400G.py
74 depends = buildcontroller,sims121,testsPCE
75 #the last dependency is to avoid temporarily concurrent ressources problem to fix in parallel mode
77 nosetests --with-xunit transportpce_tests/1.2.1/test_portmapping.py
78 nosetests --with-xunit transportpce_tests/1.2.1/test_topo_portmapping.py
79 nosetests --with-xunit transportpce_tests/1.2.1/test_topology.py
80 nosetests --with-xunit transportpce_tests/1.2.1/test_renderer_service_path_nominal.py
81 nosetests --with-xunit transportpce_tests/1.2.1/test_olm.py
82 nosetests --with-xunit transportpce_tests/1.2.1/test_end2end.py
85 depends = buildcontroller,sims221,tests121
86 #the last dependency is to avoid temporarily concurrent ressources problem to fix in parallel mode
88 nosetests --with-xunit transportpce_tests/2.2.1/test_portmapping.py
89 nosetests --with-xunit transportpce_tests/2.2.1/test_topology.py
90 nosetests --with-xunit transportpce_tests/2.2.1/test_otn_topology.py
91 nosetests --with-xunit transportpce_tests/2.2.1/test_flex_grid.py
92 nosetests --with-xunit transportpce_tests/2.2.1/test_renderer_service_path_nominal.py
93 nosetests --with-xunit transportpce_tests/2.2.1/test_otn_renderer.py
94 nosetests --with-xunit transportpce_tests/2.2.1/test_otn_sh_renderer.py
95 nosetests --with-xunit transportpce_tests/2.2.1/test_olm.py
96 nosetests --with-xunit transportpce_tests/2.2.1/test_tapi.py
97 nosetests --with-xunit transportpce_tests/2.2.1/test_otn_end2end.py
98 nosetests --with-xunit transportpce_tests/2.2.1/test_end2end.py
101 depends = buildcontroller,sims71,tests221
102 #the last dependency is to avoid temporarily concurrent ressources problem to fix in parallel mode
104 nosetests --with-xunit transportpce_tests/7.1/test_portmapping.py
106 [testenv:tests_hybrid]
107 depends = buildcontroller,sims121,sims221,sims71,tests71
108 #the last dependency is to avoid temporarily concurrent ressources problem to fix in parallel mode
110 nosetests --with-xunit transportpce_tests/hybrid/test_device_change_notifications.py
113 depends = buildcontroller
114 whitelist_externals = sh
117 #sudo docker pull atriki/gnpyrest:v1.2
118 sudo docker run -d -p 8008:5000 --name gnpy_tpce_rest1 atriki/gnpyrest:v1.2
119 nosetests --with-xunit transportpce_tests/with_docker/test_gnpy.py
120 sudo docker container rm -f gnpy_tpce_rest1
122 [testenv:nbinotifications]
123 depends = buildcontroller,sims221
124 whitelist_externals = sh
127 sudo docker-compose -f ./nbinotifications/docker-compose.yml up -d
128 nosetests --with-xunit transportpce_tests/with_docker/test_nbinotifications.py
129 sudo docker-compose -f ./nbinotifications/docker-compose.yml down --rmi all
132 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
134 deps = -rdocs/requirements.txt
136 sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/html
138 [testenv:docs-linkcheck]
139 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
141 deps = -rdocs/requirements.txt
142 commands = sphinx-build -q -b linkcheck -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/linkcheck
144 [testenv:checkbashisms]
146 whitelist_externals = sh
151 sh -c 'command checkbashisms>/dev/null || sudo yum install devscripts-minimal || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | yum install devscripts-minimal )" >&2 && exit 1)'
152 find . -not -path '*/\.*' -name *.sh -exec checkbashisms -f \{\} +
157 -rdocs/requirements.txt
158 sphinxcontrib-spelling
160 commands = sphinx-build -b spelling -d {envtmpdir}/doctrees ../docs/ {toxinidir}/docs/_build/spelling
166 autopep8 --max-line-length 120 --in-place --recursive transportpce_tests/
171 whitelist_externals = find
173 find transportpce_tests/ -name *.py -exec pylint --max-line-length=120 --disable=missing-docstring --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 \{\} +
178 whitelist_externals = find
181 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/ \{\} +
182 #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/ \{\} +
184 [testenv:pyangformat]
187 whitelist_externals = sh
190 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'
192 [testenv:pre-commit-install]
197 pre-commit install --hook-type commit-msg
199 [testenv:pre-commit-uninstall]
204 pre-commit uninstall --hook-type commit-msg
211 pre-commit run --all-files --show-diff-on-failure
212 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
213 # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
214 # Its default arguments --passed and --msg-filename are different from CI recommandations.
215 # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
216 # A dedicated gitlint profile for CI is proposed below. Also to behave fine locally, this profile must have access
217 # to the HOME variable so that Gitlint can retrieve Git user settings.