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:
14
run_tests.sh
14
run_tests.sh
@@ -60,17 +60,23 @@ $SUDO python setup.py install
|
|||||||
$SUDO python setup.py install_puppet_modules
|
$SUDO python setup.py install_puppet_modules
|
||||||
|
|
||||||
# Generate configuration from selected scenario and run it
|
# Generate configuration from selected scenario and run it
|
||||||
./tests/${SCENARIO}.sh
|
source ./tests/${SCENARIO}.sh
|
||||||
result=$?
|
result=$?
|
||||||
|
|
||||||
# Generate subunit
|
# Generate subunit
|
||||||
pushd /var/lib/tempest
|
if [ -d /var/lib/tempest ]; then
|
||||||
/var/lib/tempest/.venv/bin/testr last --subunit > /var/tmp/packstack/latest/testrepository.subunit
|
pushd /var/lib/tempest
|
||||||
popd
|
/var/lib/tempest/.venv/bin/testr last --subunit > /var/tmp/packstack/latest/testrepository.subunit || true
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${COPY_LOGS}" = true ]; then
|
if [ "${COPY_LOGS}" = true ]; then
|
||||||
source ./tools/copy-logs.sh
|
source ./tools/copy-logs.sh
|
||||||
recover_default_logs
|
recover_default_logs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${FAILURE}" = true ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
exit $result
|
exit $result
|
||||||
|
|||||||
@@ -33,4 +33,4 @@ packstack --allinone \
|
|||||||
--gen-answer-file=${PACKSTACK_CONFIG_FILE}
|
--gen-answer-file=${PACKSTACK_CONFIG_FILE}
|
||||||
sed -i -re "s,(.*_PASSWORD|.*_PW)=.*,\1=packstack," ${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}
|
--gen-answer-file=${PACKSTACK_CONFIG_FILE}
|
||||||
sed -i -re "s,(.*_PASSWORD|.*_PW)=.*,\1=packstack," ${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"
|
||||||
|
|||||||
Reference in New Issue
Block a user