Catch packstack execution failures so we can still recover logs
This also prevents an error to occur if installation failed before tempest was installed Change-Id: I525cbc2022a455113c900b10f301a6fac52d59f3
This commit is contained in:
parent
413dac6d63
commit
b9fb64af7c
14
run_tests.sh
14
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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user