Improve github test driver script.

- use a trap to always output any failed regress logs (since the script
   sets -e, the existing log output is never invoked).
 - pass LTESTS and SKIP_LTESTS when re-running with sshd options (eg.
   UsePAM).
This commit is contained in:
Darren Tucker 2021-08-16 14:13:02 +10:00
parent b467cf1370
commit 6a24567a29
1 changed files with 17 additions and 16 deletions

33
.github/run_test.sh vendored
View File

@ -6,28 +6,29 @@
set -ex set -ex
output_failed_logs() {
for i in regress/failed*; do
if [ -f "$i" ]; then
echo -------------------------------------------------------------------------
echo LOGFILE $i
cat $i
echo -------------------------------------------------------------------------
fi
done
}
trap output_failed_logs 0
if [ -z "${LTESTS}" ]; then if [ -z "${LTESTS}" ]; then
make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}"
result=$?
else else
make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}" make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}"
result=$?
fi fi
if [ ! -z "${SSHD_CONFOPTS}" ]; then if [ ! -z "${SSHD_CONFOPTS}" ]; then
echo "rerunning tests with TEST_SSH_SSHD_CONFOPTS='${SSHD_CONFOPTS}'" echo "rerunning t-exec with TEST_SSH_SSHD_CONFOPTS='${SSHD_CONFOPTS}'"
make t-exec TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}" if [ -z "${LTESTS}" ]; then
result2=$? make t-exec SKIP_LTESTS="${SKIP_LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
if [ "${result2}" -ne 0 ]; then else
result="${result2}" make t-exec SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
fi fi
fi fi
if [ "$result" -ne "0" ]; then
for i in regress/failed*; do
echo -------------------------------------------------------------------------
echo LOGFILE $i
cat $i
echo -------------------------------------------------------------------------
done
fi