diff --git a/neutron_vpnaas/tests/contrib/gate_hook.sh b/neutron_vpnaas/tests/contrib/gate_hook.sh index e6096334d..530f72648 100755 --- a/neutron_vpnaas/tests/contrib/gate_hook.sh +++ b/neutron_vpnaas/tests/contrib/gate_hook.sh @@ -16,6 +16,7 @@ case $VENV in NEUTRON_VPN_PATH=$GATE_DEST/$PROJECT_NAME DEVSTACK_PATH=$GATE_DEST/devstack IS_GATE=True + USE_CONSTRAINT_ENV=True source $NEUTRON_VPN_PATH/tools/configure_for_vpn_func_testing.sh diff --git a/neutron_vpnaas/tests/contrib/post_test_hook.sh b/neutron_vpnaas/tests/contrib/post_test_hook.sh index b1709e0d1..875baf07a 100755 --- a/neutron_vpnaas/tests/contrib/post_test_hook.sh +++ b/neutron_vpnaas/tests/contrib/post_test_hook.sh @@ -37,7 +37,8 @@ esac cd $NEUTRON_VPNAAS_DIR sudo chown -R $owner:stack $NEUTRON_VPNAAS_DIR -# Run tests +# For gate, run all tests using constraints +VENV=$VENV-constraints echo "Running neutron $VENV test suite" set +e sudo -H -u $owner $sudo_env tox -e $VENV diff --git a/tools/configure_for_vpn_func_testing.sh b/tools/configure_for_vpn_func_testing.sh index 5439f9f9f..472952d28 100755 --- a/tools/configure_for_vpn_func_testing.sh +++ b/tools/configure_for_vpn_func_testing.sh @@ -27,14 +27,16 @@ source $NEUTRON_VPNAAS_DIR/devstack/plugin.sh function _install_vpn_package { - if [ "$VENV" == "dsvm-functional-sswan" ] - then - IPSEC_PACKAGE=strongswan - else - IPSEC_PACKAGE=openswan - fi + case $VENV in + dsvm-functional-sswan*) + IPSEC_PACKAGE=strongswan + ;; + *) + IPSEC_PACKAGE=openswan + ;; + esac - echo_summary "Installing $IPSEC_PACKAGE" + echo_summary "Installing $IPSEC_PACKAGE for $VENV" neutron_agent_vpnaas_install_agent_packages } diff --git a/tox.ini b/tox.ini index 25790878e..636907483 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py34,py27,pep8 +envlist = {py27,py34,pep8}-constraints minversion = 1.6 skipsdist = True @@ -24,37 +24,54 @@ install_command = {toxinidir}/tools/tox_install.sh constrained -c{env:UPPER_CONS deps = {[testenv]deps} -r{toxinidir}/neutron_vpnaas/tests/functional/requirements.txt - -[testenv:dsvm-functional] -setenv = OS_TEST_PATH=./neutron_vpnaas/tests/functional/openswan - OS_SUDO_TESTING=1 - OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf - OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf - OS_FAIL_ON_MISSING_DEPS=1 -deps = - {[testenv:functional]deps} -sitepackages=True +setenv = + OS_SUDO_TESTING=1 + OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf + OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf + OS_FAIL_ON_MISSING_DEPS=1 whitelist_externals = sh cp sudo + +[testenv:dsvm-functional] +setenv = + OS_TEST_PATH=./neutron_vpnaas/tests/functional/openswan + {[testenv:functional]setenv} +deps = {[testenv:functional]deps} +sitepackages=True +whitelist_externals = {[testenv:functional]whitelist_externals} +commands = + {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir} + sh tools/pretty_tox.sh '{posargs}' + +[testenv:dsvm-functional-constraints] +setenv = {[testenv:dsvm-functional]setenv} +deps = {[testenv:functional]deps} +sitepackages=True +install_command = {[testenv:common-constraints]install_command} +whitelist_externals = {[testenv:functional]whitelist_externals} commands = {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir} sh tools/pretty_tox.sh '{posargs}' [testenv:dsvm-functional-sswan] -setenv = OS_TEST_PATH=./neutron_vpnaas/tests/functional/strongswan - OS_SUDO_TESTING=1 - OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf - OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf - OS_FAIL_ON_MISSING_DEPS=1 -deps = - {[testenv:functional]deps} +setenv = + OS_TEST_PATH=./neutron_vpnaas/tests/functional/strongswan + {[testenv:functional]setenv} +deps = {[testenv:functional]deps} sitepackages=True -whitelist_externals = - sh - cp - sudo +whitelist_externals = {[testenv:functional]whitelist_externals} +commands = + {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir} + sh tools/pretty_tox.sh '{posargs}' + +[testenv:dsvm-functional-sswan-constraints] +setenv = {[testenv:dsvm-functional-sswan]setenv} +deps = {[testenv:functional]deps} +sitepackages=True +install_command = {[testenv:common-constraints]install_command} +whitelist_externals = {[testenv:functional]whitelist_externals} commands = {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir} sh tools/pretty_tox.sh '{posargs}' @@ -78,7 +95,8 @@ commands = 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:genconfig]commands} +whitelist_externals = sh [testenv:i18n] commands = python ./tools/check_i18n.py ./neutron-vpnaas ./tools/i18n_cfg.py @@ -92,16 +110,6 @@ 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] -setenv = {[testenv:dsvm-functional]setenv} -commands = - python setup.py test --coverage --coverage-package-name=neutron_vpnaas --testr-args='{posargs}' - -[testenv:dsvm-functional-sswan-cover] -setenv = {[testenv:dsvm-functional-sswan]setenv} -commands = - python setup.py test --coverage --coverage-package-name=neutron_vpnaas --testr-args='{posargs}' - [testenv:venv] commands = {posargs}