Merge "Added constraints tox targets"

This commit is contained in:
Jenkins 2015-12-10 16:16:09 +00:00 committed by Gerrit Code Review
commit f7ed0ebd89
3 changed files with 110 additions and 72 deletions

View File

@ -44,40 +44,42 @@ Client CLI API
-------------- --------------
The originally implemented client CLI APIs (which are still available The originally implemented client CLI APIs (which are still available
for backward compatibility) for an IPsec connection are: for backward compatibility) for an IPsec connection are::
| neutron vpn-service-create ROUTER SUBNET
| neutron ipsec-site-connection-create neutron vpn-service-create ROUTER SUBNET
| --vpnservice-id VPNSERVICE neutron ipsec-site-connection-create
| --ikepolicy-id IKEPOLICY --vpnservice-id VPNSERVICE
| --ipsecpolicy-id IPSECPOLICY --ikepolicy-id IKEPOLICY
| --peer-address PEER_ADDRESS --ipsecpolicy-id IPSECPOLICY
| --peer-id PEER_ID --peer-address PEER_ADDRESS
| --peer-cidr PEER_CIDRS --peer-id PEER_ID
| --dpd action=ACTION,interval=INTERVAL,timeout=TIMEOUT --peer-cidr PEER_CIDRS
| --initiator {bi-directional | response-only} --dpd action=ACTION,interval=INTERVAL,timeout=TIMEOUT
| --mtu MTU --initiator {bi-directional | response-only}
| --psk PSK --mtu MTU
--psk PSK
Changes to the API, to support multiple local subnets, are shown in Changes to the API, to support multiple local subnets, are shown in
**bold** text: **bold** text::
| neutron vpn-service-create ROUTER
| **neutron vpn-endpoint-groups-create** neutron vpn-service-create ROUTER
| **--name OPTIONAL-NAME** **neutron vpn-endpoint-groups-create**
| **--description OPTIONAL-DESCRIPTION** **--name OPTIONAL-NAME**
| **--ep-type={subnet,cidr,network,vlan,router}** **--description OPTIONAL-DESCRIPTION**
| **--ep-value=[list-of-endpoints-of-type]** **--ep-type={subnet,cidr,network,vlan,router}**
| neutron ipsec-site-connection-create **--ep-value=[list-of-endpoints-of-type]**
| --vpnservice-id VPNSERVICE neutron ipsec-site-connection-create
| --ikepolicy-id IKEPOLICY --vpnservice-id VPNSERVICE
| --ipsecpolicy-id IPSECPOLICY --ikepolicy-id IKEPOLICY
| --peer-address PEER_ADDRESS --ipsecpolicy-id IPSECPOLICY
| --peer-id PEER_ID --peer-address PEER_ADDRESS
| --dpd action=ACTION,interval=INTERVAL,timeout=TIMEOUT --peer-id PEER_ID
| --initiator {bi-directional | response-only} --dpd action=ACTION,interval=INTERVAL,timeout=TIMEOUT
| --mtu MTU --initiator {bi-directional | response-only}
| --psk PSK --mtu MTU
| **--local-endpoints ENDPOINT-GROUPS-UUID** --psk PSK
| **--peer-endpoints ENDPOINT-GROUPS-UUID** **--local-endpoints ENDPOINT-GROUPS-UUID**
**--peer-endpoints ENDPOINT-GROUPS-UUID**
The SUBNET in the original service API is optional, and will be used as an The SUBNET in the original service API is optional, and will be used as an
indicator of whether or not the multiple local subnets feature is active. indicator of whether or not the multiple local subnets feature is active.
@ -110,46 +112,48 @@ Examples
-------- --------
The original APIs to create one side of an IPSec connection with The original APIs to create one side of an IPSec connection with
only one local and peer subnet: only one local and peer subnet::
| neutron vpn-ikepolicy-create ikepolicy
| neutron vpn-ipsecpolicy-create ipsecpolicy neutron vpn-ikepolicy-create ikepolicy
| neutron vpn-service-create --name myvpn router1 privateA neutron vpn-ipsecpolicy-create ipsecpolicy
| neutron ipsec-site-connection-create neutron vpn-service-create --name myvpn router1 privateA
| --name vpnconnection1 neutron ipsec-site-connection-create
| --vpnservice-id myvpn --name vpnconnection1
| --ikepolicy-id ikepolicy --vpnservice-id myvpn
| --ipsecpolicy-id ipsecpolicy --ikepolicy-id ikepolicy
| --peer-address 172.24.4.13 --ipsecpolicy-id ipsecpolicy
| --peer-id 172.24.4.13 --peer-address 172.24.4.13
| --peer-cidr 10.3.0.0/24 --peer-id 172.24.4.13
| --psk secret --peer-cidr 10.3.0.0/24
--psk secret
The local CIDR is obtained from the subnet, privateA. In this example, The local CIDR is obtained from the subnet, privateA. In this example,
that would be 10.1.0.0/24 (because that's how privateA was created). that would be 10.1.0.0/24 (because that's how privateA was created).
Using the multiple local subnet feature, the APIs (with changes shown Using the multiple local subnet feature, the APIs (with changes shown
in **bold** below: in **bold** below::
| neutron vpn-ikepolicy-create ikepolicy
| neutron vpn-ipsecpolicy-create ipsecpolicy neutron vpn-ikepolicy-create ikepolicy
| neutron vpn-service-create --name myvpn router1 neutron vpn-ipsecpolicy-create ipsecpolicy
| **neutron vpn-endpoint-group-create** neutron vpn-service-create --name myvpn router1
| **--name local-eps** **neutron vpn-endpoint-group-create**
| **--ep-type=subnet** **--name local-eps**
| **--ep-value=privateA** **--ep-type=subnet**
| **--ep-value=privateB** **--ep-value=privateA**
| **neutron vpn-endpoint-group-create** **--ep-value=privateB**
| **--name peer-eps** **neutron vpn-endpoint-group-create**
| **--ep-type=cidr** **--name peer-eps**
| **--ep-vallue=10.3.0.0/24** **--ep-type=cidr**
| neutron ipsec-site-connection-create **--ep-vallue=10.3.0.0/24**
| --name vpnconnection1 neutron ipsec-site-connection-create
| --vpnservice-id myvpn --name vpnconnection1
| --ikepolicy-id ikepolicy --vpnservice-id myvpn
| --ipsecpolicy-id ipsecpolicy --ikepolicy-id ikepolicy
| --peer-address 172.24.4.13 --ipsecpolicy-id ipsecpolicy
| --psk secret --peer-address 172.24.4.13
| **--local-endpoints local-eps** --psk secret
| **--peer-endpoints peer-eps** **--local-endpoints local-eps**
**--peer-endpoints peer-eps**
The subnets privateA and privateB are used for local endpoints and the The subnets privateA and privateB are used for local endpoints and the
10.3.0.0/24 CIDR is used for the peer endpoint. 10.3.0.0/24 CIDR is used for the peer endpoint.

View File

@ -23,9 +23,16 @@ NEUTRON_DIR=$HOME/neutron
set -e set -e
install_cmd="pip install"
if [ "$1" = "constrained" ]; then
install_cmd="$install_cmd $2"
shift
fi
shift
if [ -d "$NEUTRON_DIR" ]; then if [ -d "$NEUTRON_DIR" ]; then
echo "FOUND Neutron code at $NEUTRON_DIR - using" echo "FOUND Neutron code at $NEUTRON_DIR - using"
pip install -U -e $NEUTRON_DIR $install_cmd -U -e $NEUTRON_DIR
elif [ $neutron_installed -eq 0 ]; then elif [ $neutron_installed -eq 0 ]; then
location=$(python -c "import neutron; print(neutron.__file__)") location=$(python -c "import neutron; print(neutron.__file__)")
echo "ALREADY INSTALLED at $location" echo "ALREADY INSTALLED at $location"
@ -39,12 +46,12 @@ elif [ -x "$ZUUL_CLONER" ]; then
git://git.openstack.org \ git://git.openstack.org \
openstack/neutron openstack/neutron
cd openstack/neutron cd openstack/neutron
pip install -e . $install_cmd -e .
cd "$cwd" cd "$cwd"
else else
echo "LOCAL - Obtaining Neutron code from git.openstack.org" echo "LOCAL - Obtaining Neutron code from git.openstack.org"
pip install -U -egit+https://git.openstack.org/openstack/neutron#egg=neutron $install_cmd -U -egit+https://git.openstack.org/openstack/neutron#egg=neutron
fi fi
pip install -U $* $install_cmd -U $*
exit $? exit $?

29
tox.ini
View File

@ -6,7 +6,9 @@ skipsdist = True
[testenv] [testenv]
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
usedevelop = True usedevelop = True
install_command = {toxinidir}/tools/tox_install.sh {opts} {packages} install_command =
constraints: {[testenv:common-constraints]install_command}
{toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
whitelist_externals = sh whitelist_externals = sh
@ -15,6 +17,9 @@ commands =
# there is also secret magic in pretty_tox.sh which lets you run in a fail only # there is also secret magic in pretty_tox.sh which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable. # mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:common-constraints]
install_command = {toxinidir}/tools/tox_install.sh constrained -c{env:UPPER_CONTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
[testenv:functional] [testenv:functional]
deps = deps =
{[testenv]deps} {[testenv]deps}
@ -69,6 +74,15 @@ commands =
neutron-db-manage --subproject neutron-vpnaas --database-connection sqlite:// check_migration neutron-db-manage --subproject neutron-vpnaas --database-connection sqlite:// check_migration
whitelist_externals = sh whitelist_externals = sh
[testenv:pep8-constraints]
install_command = {[testenv:common-constraints]install_command}
commands =
flake8
pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron_vpnaas}
{toxinidir}/tools/check_unit_test_structure.sh
neutron-db-manage --subproject neutron-vpnaas --database-connection sqlite:// check_migration
whitelist_externals = {[testenv:pep8]whitelist_externals}
[testenv:i18n] [testenv:i18n]
commands = python ./tools/check_i18n.py ./neutron-vpnaas ./tools/i18n_cfg.py commands = python ./tools/check_i18n.py ./neutron-vpnaas ./tools/i18n_cfg.py
@ -76,6 +90,11 @@ commands = python ./tools/check_i18n.py ./neutron-vpnaas ./tools/i18n_cfg.py
commands = commands =
python setup.py test --coverage --coverage-package-name=neutron_vpnaas --testr-args='{posargs}' python setup.py test --coverage --coverage-package-name=neutron_vpnaas --testr-args='{posargs}'
[testenv:cover-constraints]
install_command = {[testenv:common-constraints]install_command}
commands =
python setup.py test --coverage --coverage-package-name=neutron_vpnaas --testr-args='{posargs}'
[testenv:dsvm-functional-cover] [testenv:dsvm-functional-cover]
setenv = {[testenv:dsvm-functional]setenv} setenv = {[testenv:dsvm-functional]setenv}
commands = commands =
@ -89,9 +108,17 @@ commands =
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
[testenv:venv-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {posargs}
[testenv:docs] [testenv:docs]
commands = sphinx-build -W -b html doc/source doc/build commands = sphinx-build -W -b html doc/source doc/build
[testenv:docs-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {[testenv:docs]commands}
[flake8] [flake8]
# E125 continuation line does not distinguish itself from next logical line # E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent # E126 continuation line over-indented for hanging indent