Newer
Older
#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################
[tox]
envlist = black, flake8, pylint, safety
[tox:jenkins]
toxworkdir = /tmp/.tox
[testenv]
usedevelop = True
basepython = python3
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
deps = -r{toxinidir}/requirements.txt
parallel_show_output = true
#######################################################################################
[testenv:release_notes]
deps = reno
skip_install = true
commands =
reno new {posargs:new_feature}
#######################################################################################
[testenv:black]
deps = black
skip_install = true
commands =
black --check --diff NG-RO
black --check --diff RO-plugin
black --check --diff RO-SDN-arista_cloudvision
black --check --diff RO-SDN-dpb
black --check --diff RO-SDN-dynpac
black --check --diff RO-SDN-floodlight_openflow
black --check --diff RO-SDN-ietfl2vpn
black --check --diff RO-SDN-juniper_contrail
black --check --diff RO-SDN-odl_openflow
black --check --diff RO-SDN-onos_openflow
black --check --diff RO-SDN-onos_vpls
black --check --diff RO-VIM-aws
black --check --diff RO-VIM-azure
black --check --diff RO-VIM-fos
black --check --diff RO-VIM-opennebula
black --check --diff RO-VIM-openstack
black --check --diff RO-VIM-openvim
black --check --diff RO-VIM-vmware
black --check --diff RO-VIM-gcp
black --check --diff integration-tests
#######################################################################################
[testenv:cover]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dev.txt
-r{toxinidir}/requirements-test.txt
skip_install = true
commands =
sh -c 'rm -f nosetests.xml'
coverage erase
# NG-RO
nose2 -C --coverage NG-RO/osm_ng_ro -s NG-RO/osm_ng_ro
sh -c 'mv .coverage .coverage_ng_ro'
# RO-plugin
nose2 -C --coverage RO-plugin/osm_ro_plugin -s RO-plugin/osm_ro_plugin
sh -c 'mv .coverage .coverage_ro_plugin'
# RO-SDN-arista_cloudvision
nose2 -C --coverage RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision -s RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision
sh -c 'mv .coverage .coverage_rosdn_arista_cloudvision'
# RO-SDN-dpb
nose2 -C --coverage RO-SDN-dpb/osm_rosdn_dpb -s RO-SDN-dpb/osm_rosdn_dpb
sh -c 'mv .coverage .coverage_rosdn_dpb'
# RO-SDN-dynpac
nose2 -C --coverage RO-SDN-dynpac/osm_rosdn_dynpac -s RO-SDN-dynpac/osm_rosdn_dynpac
sh -c 'mv .coverage .coverage_rosdn_dynpac'
# RO-SDN-floodlight_openflow
nose2 -C --coverage RO-SDN-floodlight_openflow/osm_rosdn_floodlightof -s RO-SDN-floodlight_openflow/osm_rosdn_floodlightof
sh -c 'mv .coverage .coverage_rosdn_floodlightof'
# RO-SDN-ietfl2vpn
nose2 -C --coverage RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn -s RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn
sh -c 'mv .coverage .coverage_rosdn_ietfl2vpn'
# RO-SDN-juniper_contrail
nose2 -C --coverage RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail -s RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail
sh -c 'mv .coverage .coverage_rosdn_juniper_contrail'
# RO-SDN-odl_openflow
nose2 -C --coverage RO-SDN-odl_openflow/osm_rosdn_odlof -s RO-SDN-odl_openflow/osm_rosdn_odlof
sh -c 'mv .coverage .coverage_rosdn_odlof'
# RO-SDN-onos_openflow
nose2 -C --coverage RO-SDN-onos_openflow/osm_rosdn_onosof -s RO-SDN-onos_openflow/osm_rosdn_onosof
sh -c 'mv .coverage .coverage_rosdn_onosof'
# RO-SDN-onos_vpls
nose2 -C --coverage RO-SDN-onos_vpls/osm_rosdn_onos_vpls -s RO-SDN-onos_vpls/osm_rosdn_onos_vpls
sh -c 'mv .coverage .coverage_rosdn_onos_vpls'
# RO-VIM-aws
nose2 -C --coverage RO-VIM-aws/osm_rovim_aws -s RO-VIM-aws/osm_rovim_aws
sh -c 'mv .coverage .coverage_rovim_aws'
# RO-VIM-azure
nose2 -C --coverage RO-VIM-azure/osm_rovim_azure -s RO-VIM-azure/osm_rovim_azure
sh -c 'mv .coverage .coverage_rovim_azure'
# RO-VIM-fos
nose2 -C --coverage RO-VIM-fos/osm_rovim_fos -s RO-VIM-fos/osm_rovim_fos
sh -c 'mv .coverage .coverage_rovim_fos'
# RO-VIM-opennebula
nose2 -C --coverage RO-VIM-opennebula/osm_rovim_opennebula -s RO-VIM-opennebula/osm_rovim_opennebula
sh -c 'mv .coverage .coverage_rovim_opennebula'
# RO-VIM-openstack
# nose2 -C --coverage RO-VIM-openstack/osm_rovim_openstack -s RO-VIM-openstack/osm_rovim_openstack
# sh -c 'mv .coverage .coverage_rovim_openstack'
nose2 -C --coverage RO-VIM-openvim/osm_rovim_openvim -s RO-VIM-openvim/osm_rovim_openvim
sh -c 'mv .coverage .coverage_rovim_openvim'
# RO-VIM-vmware
# nose2 -C --coverage RO-VIM-vmware/osm_rovim_vmware -s RO-VIM-vmware/osm_rovim_vmware
# sh -c 'mv .coverage .coverage_rovim_vmware'
nose2 -C --coverage RO-VIM-gcp/osm_rovim_gcp -s RO-VIM-gcp/osm_rovim_gcp
# Combine results and generate reports
coverage combine .coverage_ng_ro .coverage_ro_plugin .coverage_rosdn_arista_cloudvision .coverage_rosdn_dpb .coverage_rosdn_dynpac .coverage_rosdn_floodlightof .coverage_rosdn_ietfl2vpn .coverage_rosdn_juniper_contrail .coverage_rosdn_odlof .coverage_rosdn_onos_vpls .coverage_rosdn_onosof .coverage_rovim_aws .coverage_rovim_azure .coverage_rovim_fos .coverage_rovim_opennebula .coverage_rovim_openvim .coverage_rovim_gcp # .coverage_rovim_openstack .coverage_rovim_vmware
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
coverage report --omit='*tests*'
coverage html -d ./cover --omit='*tests*'
coverage xml -o coverage.xml --omit='*tests*'
#######################################################################################
[testenv:flake8]
deps = flake8
skip_install = true
commands =
- flake8 NG-RO/osm_ng_ro/ NG-RO/setup.py
- flake8 RO-plugin/osm_ro_plugin/ RO-plugin/setup.py
- flake8 RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision/ RO-SDN-arista_cloudvision/setup.py
- flake8 RO-SDN-dpb/osm_rosdn_dpb/ RO-SDN-dpb/setup.py
- flake8 RO-SDN-dynpac/osm_rosdn_dynpac/ RO-SDN-dynpac/setup.py
- flake8 RO-SDN-floodlight_openflow/osm_rosdn_floodlightof/ RO-SDN-floodlight_openflow/setup.py
- flake8 RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/ RO-SDN-ietfl2vpn/setup.py
- flake8 RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/ RO-SDN-juniper_contrail/setup.py
- flake8 RO-SDN-odl_openflow/osm_rosdn_odlof/ RO-SDN-odl_openflow/setup.py
- flake8 RO-SDN-onos_openflow/osm_rosdn_onosof/ RO-SDN-onos_openflow/setup.py
- flake8 RO-SDN-onos_vpls/osm_rosdn_onos_vpls/ RO-SDN-onos_vpls/setup.py
- flake8 RO-VIM-aws/osm_rovim_aws/ RO-VIM-aws/setup.py
- flake8 RO-VIM-azure/osm_rovim_azure/ RO-VIM-azure/setup.py
- flake8 RO-VIM-fos/osm_rovim_fos/ RO-VIM-fos/setup.py
- flake8 RO-VIM-opennebula/osm_rovim_opennebula/ RO-VIM-opennebula/setup.py
- flake8 RO-VIM-openstack/osm_rovim_openstack/ RO-VIM-openstack/setup.py
- flake8 RO-VIM-openvim/osm_rovim_openvim/ RO-VIM-openvim/setup.py
- flake8 RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py RO-VIM-vmware/osm_rovim_vmware/tests/test_vimconn_vmware.py RO-VIM-vmware/setup.py
- flake8 RO-VIM-gcp/osm_rovim_gcp/ RO-VIM-gcp/setup.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#######################################################################################
[testenv:pylint]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dev.txt
-r{toxinidir}/requirements-test.txt
pylint
skip_install = true
commands =
- pylint -E NG-RO/osm_ng_ro
- pylint -E RO-plugin/osm_ro_plugin
- pylint -E RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision
- pylint -E RO-SDN-dpb/osm_rosdn_dpb
- pylint -E RO-SDN-dynpac/osm_rosdn_dynpac
- pylint -E RO-SDN-floodlight_openflow/osm_rosdn_floodlightof
- pylint -E RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn
- pylint -E RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail
- pylint -E RO-SDN-odl_openflow/osm_rosdn_odlof
- pylint -E RO-SDN-onos_openflow/osm_rosdn_onosof
- pylint -E RO-SDN-onos_vpls/osm_rosdn_onos_vpls
- pylint -E RO-VIM-aws/osm_rovim_aws
- pylint -E RO-VIM-azure/osm_rovim_azure
- pylint -E RO-VIM-fos/osm_rovim_fos
- pylint -E RO-VIM-opennebula/osm_rovim_opennebula
- pylint -E RO-VIM-openstack/osm_rovim_openstack
- pylint -E RO-VIM-openvim/osm_rovim_openvim
- pylint -E RO-VIM-vmware/osm_rovim_vmware
#######################################################################################
[testenv:safety]
setenv =
LC_ALL=C.UTF-8
LANG=C.UTF-8
deps = {[testenv]deps}
safety
skip_install = true
commands =
- safety check --full-report
#######################################################################################
[testenv:pip-compile]
deps = pip-tools==5.5.0
skip_install = true
- sh -c "for file in requirements*.in ; do pip-compile -rU --no-header $file ;\
out=`echo $file | sed 's/.in/.txt/'` ; \
sed -i -e '1 e head -16 tox.ini' $out ;\
done"
#######################################################################################
[testenv:dist_ng_ro]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/NG-RO
commands =
sh -c 'rm -rf osm_ng_ro/requirements.txt deb_dist dist osm_ng_ro.egg-info osm_ng_ro*.tar.gz'
sh -c 'cp ../requirements.txt osm_ng_ro/requirements.txt'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-ng-ro*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_plugin]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-plugin
commands =
sh -c 'rm -rf deb_dist dist osm_ro_plugin.egg-info osm_ro_plugin*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-ro-plugin*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_arista_cloudvision]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-arista_cloudvision
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_arista_cloudvision.egg-info osm_rosdn_arista_cloudvision*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-arista-cloudvision*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_dpb]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-dpb
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_dpb.egg-info osm_rosdn_dpb*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-dpb*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_dynpac]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-dynpac
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_dynpac.egg-info osm_rosdn_dynpac*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-dynpac*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_floodlight_of]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-floodlight_openflow
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_floodlightof.egg-info osm_rosdn_floodlightof*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-floodlightof*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_ietfl2vpn]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-ietfl2vpn
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_ietfl2vpn.egg-info osm_rosdn_ietfl2vpn*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-ietfl2vpn*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_juniper_contrail]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-juniper_contrail
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_juniper_contrail.egg-info osm_rosdn_juniper_contrail*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-juniper-contrail*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_odl_of]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-odl_openflow
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_odlof.egg-info osm_rosdn_odlof*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-odlof*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_onos_of]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-onos_openflow
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_onosof.egg-info osm_rosdn_onosof*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-onosof*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_sdn_onos_vpls]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-onos_vpls
commands =
sh -c 'rm -rf deb_dist dist osm_rosdn_onos_vpls.egg-info osm_rosdn_onos_vpls*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rosdn-onos-vpls*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_aws]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-aws
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_aws.egg-info osm_rovim_aws*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-aws*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_azure]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-azure
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_azure.egg-info osm_rovim_azure*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-azure*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_fos]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-fos
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_fos.egg-info osm_rovim_fos*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-fos*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_opennebula]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-opennebula
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_opennebula.egg-info osm_rovim_opennebula*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-opennebula*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_openstack]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-openstack
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_openstack.egg-info osm_rovim_openstack*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-openstack*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_openvim]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-openvim
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_openvim.egg-info osm_rovim_openvim*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-openvim*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_vmware]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-vmware
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_vmware.egg-info osm_rovim_vmware*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-vmware*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[testenv:dist_ro_vim_gcp]
deps = {[testenv]deps}
-r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-gcp
commands =
sh -c 'rm -rf deb_dist dist osm_rovim_gcp.egg-info osm_rovim_gcp*.tar.gz'
python3 setup.py --command-packages=stdeb.command sdist_dsc
sh -c 'cd deb_dist/osm-rovim-gcp*/ && dpkg-buildpackage -rfakeroot -uc -us'
#######################################################################################
[flake8]
ignore =
W291,
W293,
W503,
W605,
E123,
E125,
E203,
E226,
E241
exclude =
.git,
__pycache__,
.tox,
max-line-length = 120
show-source = True
builtins = _