neutron-vpnaas/neutron_vpnaas/tests/contrib/post_test_hook.sh
Paul Michali 80f765d498 Add constraints targets support for neutron-vpnaas
Added support for running the constraints version of DSVM
functional targets, made constraints targets the default for
gate invocation, and tested each target variation.

Removed the functional test coverage related targets, because to
run them, requires that DSVM is configured (like the functional
tests).

This will need I3a2c3c81533ce6145cd16c2a08a4a2af0dfb0d07
upstreamed, so that the constraints jobs can all be tested
(as experimental).

Change-Id: Idb9902418ea2e6f35b00ffb78a8973e49b6e140d
Partial-Bug: 1522503
2016-01-08 13:07:19 +00:00

51 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -xe
NEUTRON_VPNAAS_DIR="$BASE/new/neutron-vpnaas"
TEMPEST_CONFIG_DIR="$BASE/new/tempest/etc"
SCRIPTS_DIR="/usr/os-testr-env/bin"
VENV=${1:-"dsvm-functional"}
function generate_testr_results {
# Give job user rights to access tox logs
sudo -H -u $owner chmod o+rw .
sudo -H -u $owner chmod o+rw -R .testrepository
if [ -f ".testrepository/0" ] ; then
.tox/$VENV/bin/subunit-1to2 < .testrepository/0 > ./testrepository.subunit
$SCRIPTS_DIR/subunit2html ./testrepository.subunit testr_results.html
gzip -9 ./testrepository.subunit
gzip -9 ./testr_results.html
sudo mv ./*.gz /opt/stack/logs/
fi
}
case $VENV in
dsvm-functional | dsvm-functional-sswan)
owner=stack
sudo_env=
;;
api)
owner=tempest
# Configure the api tests to use the tempest.conf set by devstack.
sudo_env="TEMPEST_CONFIG_DIR=$TEMPEST_DIR/etc"
;;
esac
# Set owner permissions according to job's requirements.
cd $NEUTRON_VPNAAS_DIR
sudo chown -R $owner:stack $NEUTRON_VPNAAS_DIR
# 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
testr_exit_code=$?
set -e
# Collect and parse results
generate_testr_results
exit $testr_exit_code