2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 16:15:27 +00:00

Merge branch '2224-fixup-core-back-traces' into 'main'

Resolve "Fixup core back traces."

Closes #2224

See merge request isc-projects/bind9!4279
This commit is contained in:
Michal Nowak
2020-11-26 17:03:43 +00:00

View File

@@ -21,8 +21,8 @@ srcdir=@abs_srcdir@
. ${builddir}/conf.sh . ${builddir}/conf.sh
if [ "$(id -u)" -eq "0" ] && [ "@DEVELOPER_MODE@" != "yes" ]; then if [ "$(id -u)" -eq "0" ] && [ "@DEVELOPER_MODE@" != "yes" ]; then
echofail "Refusing to run test as root. Build with --enable-developer to override." >&2 echofail "Refusing to run test as root. Build with --enable-developer to override." >&2
exit 1 exit 1
fi fi
export builddir export builddir
@@ -37,46 +37,46 @@ stopservers=true
baseport=0 baseport=0
if [ "${SYSTEMTEST_NO_CLEAN:-0}" -eq 1 ]; then if [ "${SYSTEMTEST_NO_CLEAN:-0}" -eq 1 ]; then
clean=false clean=false
else else
clean=true clean=true
fi fi
do_run=false do_run=false
log_flags="-r" log_flags="-r"
while getopts "sknp:r-:" OPT; do while getopts "sknp:r-:" OPT; do
log_flags="$log_flags -$OPT$OPTARG" log_flags="$log_flags -$OPT$OPTARG"
if [ "$OPT" = "-" ] && [ -n "$OPTARG" ]; then if [ "$OPT" = "-" ] && [ -n "$OPTARG" ]; then
OPT="${OPTARG%%=*}" OPT="${OPTARG%%=*}"
OPTARG="${OPTARG#$OPT}" OPTARG="${OPTARG#$OPT}"
OPTARG="${OPTARG#=}" OPTARG="${OPTARG#=}"
fi fi
# shellcheck disable=SC2214 # shellcheck disable=SC2214
case "$OPT" in case "$OPT" in
k | keep) stopservers=false ;; k | keep) stopservers=false ;;
n | noclean) clean=false ;; n | noclean) clean=false ;;
p | port) baseport=$OPTARG ;; p | port) baseport=$OPTARG ;;
r | run) do_run=true ;; r | run) do_run=true ;;
s | skip) exit 77 ;; s | skip) exit 77 ;;
-) break ;; -) break ;;
*) echo "invalid option" >&2; exit 1 ;; *) echo "invalid option" >&2; exit 1 ;;
esac esac
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
if ! $do_run; then if ! $do_run; then
if [ "$baseport" -eq 0 ]; then if [ "$baseport" -eq 0 ]; then
log_flags="$log_flags -p 5300" log_flags="$log_flags -p 5300"
fi fi
env - SLOT="$SLOT" SOFTHSM2_CONF="$SOFTHSM2_CONF" PATH="$PATH" ${LD_LIBRARY_PATH:+"LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"} TESTS="$*" TEST_SUITE_LOG=run.log LOG_DRIVER_FLAGS="--verbose yes --color-tests yes" LOG_FLAGS="$log_flags" make -e check env - SLOT="$SLOT" SOFTHSM2_CONF="$SOFTHSM2_CONF" PATH="$PATH" ${LD_LIBRARY_PATH:+"LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"} TESTS="$*" TEST_SUITE_LOG=run.log LOG_DRIVER_FLAGS="--verbose yes --color-tests yes" LOG_FLAGS="$log_flags" make -e check
exit $? exit $?
fi fi
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echofail "Usage: $0 [-k] [-n] [-p <PORT>] test-directory [test-options]" >&2; echofail "Usage: $0 [-k] [-n] [-p <PORT>] test-directory [test-options]" >&2;
exit 1 exit 1
fi fi
systest=$(basename "${1%%/}") systest=$(basename "${1%%/}")
@@ -89,7 +89,7 @@ fi
if [ "${srcdir}" != "${builddir}" ]; then if [ "${srcdir}" != "${builddir}" ]; then
if [ ! -d common ] || [ ! -r common/.prepared ]; then if [ ! -d common ] || [ ! -r common/.prepared ]; then
cp -a "${srcdir}/common" "${builddir}" cp -a "${srcdir}/common" "${builddir}"
fi fi
# Some tests require additional files to work for out-of-tree test runs. # Some tests require additional files to work for out-of-tree test runs.
for file in ckdnsrps.sh digcomp.pl ditch.pl packet.pl start.pl stop.pl; do for file in ckdnsrps.sh digcomp.pl ditch.pl packet.pl start.pl stop.pl; do
@@ -98,9 +98,9 @@ if [ "${srcdir}" != "${builddir}" ]; then
fi fi
done done
if [ ! -d "$systest" ] || [ ! -r "$systest/.prepared" ]; then if [ ! -d "$systest" ] || [ ! -r "$systest/.prepared" ]; then
mkdir -p "${builddir}/$systest" mkdir -p "${builddir}/$systest"
cp -a "${srcdir}/$systest" "${builddir}/" cp -a "${srcdir}/$systest" "${builddir}/"
touch "$systest/.prepared" touch "$systest/.prepared"
fi fi
fi fi
@@ -167,9 +167,9 @@ if [ $result -eq 0 ]; then
else else
echowarn "I:$systest:Prerequisites missing, skipping test." echowarn "I:$systest:Prerequisites missing, skipping test."
if [ $result -eq 255 ]; then if [ $result -eq 255 ]; then
echowarn "R:$systest:SKIPPED"; echowarn "R:$systest:SKIPPED";
else else
echowarn "R:$systest:UNTESTED" echowarn "R:$systest:UNTESTED"
fi fi
echoend "E:$systest:$(date_with_args)" echoend "E:$systest:$(date_with_args)"
exit 0 exit 0
@@ -191,22 +191,21 @@ fi
if test -f "$systest/clean.sh" if test -f "$systest/clean.sh"
then then
if ! ( cd "${systest}" && $SHELL clean.sh "$@" ); then if ! ( cd "${systest}" && $SHELL clean.sh "$@" ); then
echowarn "I:$systest:clean.sh script failed" echowarn "I:$systest:clean.sh script failed"
echofail "R:$systest:FAIL" echofail "R:$systest:FAIL"
echoend "E:$systest:$(date_with_args)" echoend "E:$systest:$(date_with_args)"
exit 1 exit 1
fi fi
fi fi
# Set up any dynamically generated test data # Set up any dynamically generated test data
if test -f "$systest/setup.sh" if test -f "$systest/setup.sh"
then then
if ! ( cd "${systest}" && $SHELL setup.sh "$@" ); then if ! ( cd "${systest}" && $SHELL setup.sh "$@" ); then
echowarn "I:$systest:setup.sh script failed" echowarn "I:$systest:setup.sh script failed"
echofail "R:$systest:FAIL" echofail "R:$systest:FAIL"
echoend "E:$systest:$(date_with_args)" echoend "E:$systest:$(date_with_args)"
exit 1 exit 1
fi fi
fi fi
@@ -224,16 +223,16 @@ fi
if [ -n "$PYTEST" ]; then if [ -n "$PYTEST" ]; then
run=$((run+1)) run=$((run+1))
for test in $(cd "${systest}" && find . -name "tests*.py"); do for test in $(cd "${systest}" && find . -name "tests*.py"); do
start_servers start_servers
rm -f "$systest/$test.status" rm -f "$systest/$test.status"
test_status=0 test_status=0
(cd "$systest" && "$PYTEST" -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d (cd "$systest" && "$PYTEST" -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
if [ -f "$systest/$test.status" ]; then if [ -f "$systest/$test.status" ]; then
echo_i "FAILED" echo_i "FAILED"
test_status=$(cat "$systest/$test.status") test_status=$(cat "$systest/$test.status")
fi fi
status=$((status+test_status)) status=$((status+test_status))
stop_servers || status=1 stop_servers || status=1
done done
else else
echoinfo "I:$systest:pytest not installed, skipping python tests" echoinfo "I:$systest:pytest not installed, skipping python tests"
@@ -276,7 +275,7 @@ if [ -n "$core_dumps" ]; then
-- \ -- \
"$binary" 2>/dev/null | sed -n '/^Core was generated by/,$p' | cat_d "$binary" 2>/dev/null | sed -n '/^Core was generated by/,$p' | cat_d
echoinfo "D:$systest:--------------------------------------------------------------------------------" echoinfo "D:$systest:--------------------------------------------------------------------------------"
coredump_backtrace=$(basename "${coredump}")-backtrace.txt coredump_backtrace="${coredump}-backtrace.txt"
echoinfo "D:$systest:full backtrace from $coredump saved in $coredump_backtrace" echoinfo "D:$systest:full backtrace from $coredump saved in $coredump_backtrace"
"${top_builddir}/libtool" --mode=execute gdb \ "${top_builddir}/libtool" --mode=execute gdb \
-batch \ -batch \