diff --git a/run_tests.sh b/run_tests.sh index befa8c0ae..9bc262dbf 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -60,17 +60,23 @@ $SUDO python setup.py install $SUDO python setup.py install_puppet_modules # Generate configuration from selected scenario and run it -./tests/${SCENARIO}.sh +source ./tests/${SCENARIO}.sh result=$? # Generate subunit -pushd /var/lib/tempest -/var/lib/tempest/.venv/bin/testr last --subunit > /var/tmp/packstack/latest/testrepository.subunit -popd +if [ -d /var/lib/tempest ]; then + pushd /var/lib/tempest + /var/lib/tempest/.venv/bin/testr last --subunit > /var/tmp/packstack/latest/testrepository.subunit || true + popd +fi if [ "${COPY_LOGS}" = true ]; then source ./tools/copy-logs.sh recover_default_logs fi +if [ "${FAILURE}" = true ]; then + exit 1 +fi + exit $result diff --git a/tests/scenario001.sh b/tests/scenario001.sh index fba32c3d1..e34a94fed 100755 --- a/tests/scenario001.sh +++ b/tests/scenario001.sh @@ -33,4 +33,4 @@ packstack --allinone \ --gen-answer-file=${PACKSTACK_CONFIG_FILE} sed -i -re "s,(.*_PASSWORD|.*_PW)=.*,\1=packstack," ${PACKSTACK_CONFIG_FILE} -$SUDO packstack --answer-file=${PACKSTACK_CONFIG_FILE} +$SUDO packstack --answer-file=${PACKSTACK_CONFIG_FILE} || export FAILURE="true" diff --git a/tests/scenario002.sh b/tests/scenario002.sh index b07f53834..0aabdf02c 100755 --- a/tests/scenario002.sh +++ b/tests/scenario002.sh @@ -36,4 +36,4 @@ packstack --allinone \ --gen-answer-file=${PACKSTACK_CONFIG_FILE} sed -i -re "s,(.*_PASSWORD|.*_PW)=.*,\1=packstack," ${PACKSTACK_CONFIG_FILE} -$SUDO packstack --answer-file=${PACKSTACK_CONFIG_FILE} +$SUDO packstack --answer-file=${PACKSTACK_CONFIG_FILE} || export FAILURE="true"