From: George Thessalonikefs Date: Wed, 29 Jun 2022 08:47:18 +0000 (+0200) Subject: - Add debug option to the mini_tdir.sh test code. X-Git-Tag: release-1.16.1rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ceb031b58517c74eeb4a325eb7619e82b8c0d7d;p=thirdparty%2Funbound.git - Add debug option to the mini_tdir.sh test code. --- diff --git a/doc/Changelog b/doc/Changelog index 4e0716e50..bad7ca432 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,9 @@ 29 June 2022: Wouter - iana portlist update. +29 June 2022: George + - Add debug option to the mini_tdir.sh test code. + 28 June 2022: George - Show the output of the exact .rpl run that failed with 'make test'. - Fix for cached 0 TTL records to not trigger prefetching when diff --git a/testcode/mini_tdir.sh b/testcode/mini_tdir.sh index 0457a95e7..6bbece8d9 100755 --- a/testcode/mini_tdir.sh +++ b/testcode/mini_tdir.sh @@ -5,6 +5,10 @@ if test "$1" = "-a"; then shift shift fi + +# This will keep the temporary directory around and return 1 when the test failed. +DEBUG=0 + quiet=0 if test "$1" = "-q"; then quiet=1 @@ -184,11 +188,18 @@ echo "DateRunEnd: "`date "+%s" 2>/dev/null` >> $result mv $result .. cd .. -rm -rf $dir -# compat for windows where deletion may not succeed initially (files locked -# by processes that still have to exit). -if test $? -eq 1; then - echo "minitdir waiting for processes to terminate" - sleep 2 # some time to exit, and try again +if test $DEBUG -eq 0; then rm -rf $dir + # compat for windows where deletion may not succeed initially (files locked + # by processes that still have to exit). + if test $? -eq 1; then + echo "minitdir waiting for processes to terminate" + sleep 2 # some time to exit, and try again + rm -rf $dir + fi +else + if test $success == "no"; then + exit 1 + fi + exit 0 fi