From: George Thessalonikefs Date: Tue, 20 Sep 2022 12:45:20 +0000 (+0200) Subject: - Convert tdir tests to use the new skip_test functionality. X-Git-Tag: release-1.17.0rc1~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b1647ebae4e3ca0227f5231f008c6c5104e127e;p=thirdparty%2Funbound.git - Convert tdir tests to use the new skip_test functionality. --- diff --git a/doc/Changelog b/doc/Changelog index a68d8d625..7f330d8dd 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +20 September 2022: George + - Convert tdir tests to use the new skip_test functionality. + 16 September 2022: George - Merge #753: ACL per interface. (New interface-* configuration options). diff --git a/testcode/mini_tdir.sh b/testcode/mini_tdir.sh index 46a930f41..55c24c107 100755 --- a/testcode/mini_tdir.sh +++ b/testcode/mini_tdir.sh @@ -55,14 +55,14 @@ if test "$1" = "-f" && test "$2" = "report"; then pass=`expr $pass + 1` fi elif test -f ".skip-$name"; then - echo ">> SKIPPED<< $timelen $name: $desc" + echo ".. SKIPPED.. $timelen $name: $desc" skip=`expr $pass + 1` else if test -f "result.$name"; then echo "!! FAILED !! $timelen $name: $desc" fail=`expr $fail + 1` else - echo ">> SKIPPED<< $timelen $name: $desc" + echo ".. SKIPPED.. $timelen $name: $desc" skip=`expr $skip + 1` fi fi @@ -86,13 +86,13 @@ if test "$1" = "report" || test "$2" = "report"; then fi elif test -f ".skip-$name"; then if test $quiet = 0; then - echo ">> SKIPPED<< : $name" + echo ".. SKIPPED.. : $name" fi else if test -f "result.$name"; then echo "!! FAILED !! : $name" else - echo ">> SKIPPED<< : $name" + echo ".. SKIPPED.. : $name" fi fi done diff --git a/testdata/07-confroot.tdir/07-confroot.dsc b/testdata/07-confroot.tdir/07-confroot.dsc index f1cbe6e7d..a25301709 100644 --- a/testdata/07-confroot.tdir/07-confroot.dsc +++ b/testdata/07-confroot.tdir/07-confroot.dsc @@ -8,7 +8,7 @@ Component: CmdDepends: Depends: Help: -Pre: +Pre: 07-confroot.pre Post: Test: 07-confroot.test AuxFiles: diff --git a/testdata/07-confroot.tdir/07-confroot.pre b/testdata/07-confroot.tdir/07-confroot.pre new file mode 100644 index 000000000..4f966bddd --- /dev/null +++ b/testdata/07-confroot.tdir/07-confroot.pre @@ -0,0 +1,13 @@ +# #-- 07-confroot.pre --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test + +PRE="../.." + +if uname | grep "MINGW" >/dev/null; then + # no chroot, no need to test. + # (test fails on / and \ comparisons, by the way). + skip_test "no chroot on windows, end test" +fi diff --git a/testdata/07-confroot.tdir/07-confroot.test b/testdata/07-confroot.tdir/07-confroot.test index d940aa873..9572330f7 100644 --- a/testdata/07-confroot.tdir/07-confroot.test +++ b/testdata/07-confroot.tdir/07-confroot.test @@ -6,13 +6,6 @@ PRE="../.." -if uname | grep "MINGW" >/dev/null; then - # no chroot, no need to test. - # (test fails on / en \ comparisons, by the way). - echo "no chroot on windows, end test" - exit 0 -fi - # create config file cwd=`pwd -P` subdir=$cwd/subdir diff --git a/testdata/08-host-lib.tdir/08-host-lib.pre b/testdata/08-host-lib.tdir/08-host-lib.pre index 84817891f..481b0ef2c 100644 --- a/testdata/08-host-lib.tdir/08-host-lib.pre +++ b/testdata/08-host-lib.tdir/08-host-lib.pre @@ -4,7 +4,16 @@ # use .tpkg.var.test for in test variable passing [ -f .tpkg.var.test ] && source .tpkg.var.test +PRE="../.." . ../common.sh + +if grep FORK $PRE/config.h | grep "define" >/dev/null 2>&1; then + # nothing + : +else + skip_test "forking is not available; test skipped." +fi + get_random_port 2 FWD_PORT=$(($RND_PORT + 1)) echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test diff --git a/testdata/08-host-lib.tdir/08-host-lib.test b/testdata/08-host-lib.tdir/08-host-lib.test index 8de897776..18603294e 100644 --- a/testdata/08-host-lib.tdir/08-host-lib.test +++ b/testdata/08-host-lib.tdir/08-host-lib.test @@ -7,14 +7,6 @@ PRE="../.." . ../common.sh -if grep FORK $PRE/config.h | grep "define" >/dev/null 2>&1; then - # nothing - : -else - echo "forking is not available; test skipped." - exit 0 -fi - # test if fwder is up echo "> dig @127.0.0.1 -p $FWD_PORT www.example.com | tee outfile" dig @127.0.0.1 -p $FWD_PORT www.example.com | tee outfile diff --git a/testdata/clang-analysis.tdir/clang-analysis.dsc b/testdata/clang-analysis.tdir/clang-analysis.dsc index 20a62a3e3..b3a0609e3 100644 --- a/testdata/clang-analysis.tdir/clang-analysis.dsc +++ b/testdata/clang-analysis.tdir/clang-analysis.dsc @@ -7,7 +7,7 @@ Category: Component: Depends: Help: -Pre: +Pre: clang-analysis.pre Post: Test: clang-analysis.test AuxFiles: diff --git a/testdata/clang-analysis.tdir/clang-analysis.pre b/testdata/clang-analysis.tdir/clang-analysis.pre new file mode 100644 index 000000000..e9b9a26fa --- /dev/null +++ b/testdata/clang-analysis.tdir/clang-analysis.pre @@ -0,0 +1,21 @@ +# #-- clang-analysis.pre --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test +# common functions +. ../common.sh + +PRE="../.." +if test ! -x "`which clang 2>&1`"; then + skip_test "No clang in path" +fi +#echo "have clang" +# test if assertions are enabled +if grep "^#define UNBOUND_DEBUG" $PRE/config.h >/dev/null; then + : +else + skip_test "UNBOUND_DEBUG is not enabled, skip test" + # no unbound debug means no assertions, and clang analyzer uses + # the assertions to make inferences. +fi diff --git a/testdata/clang-analysis.tdir/clang-analysis.test b/testdata/clang-analysis.tdir/clang-analysis.test index 09c935860..388556a44 100644 --- a/testdata/clang-analysis.tdir/clang-analysis.test +++ b/testdata/clang-analysis.tdir/clang-analysis.test @@ -7,20 +7,6 @@ . ../common.sh PRE="../.." -if test ! -x "`which clang 2>&1`"; then - echo "No clang in path" - exit 0 -fi -#echo "have clang" -# test if assertions are enabled -if grep "^#define UNBOUND_DEBUG" $PRE/config.h >/dev/null; then - : -else - echo "UNBOUND_DEBUG is not enabled, skip test" - # no unbound debug means no assertions, and clang analyzer uses - # the assertions to make inferences. - exit 0 -fi # read value from Makefile # $1: result variable name diff --git a/testdata/dnscrypt_cert.tdir/dnscrypt_cert.post b/testdata/dnscrypt_cert.tdir/dnscrypt_cert.post index 0346d3f84..fcb6c9d0e 100644 --- a/testdata/dnscrypt_cert.tdir/dnscrypt_cert.post +++ b/testdata/dnscrypt_cert.tdir/dnscrypt_cert.post @@ -8,9 +8,6 @@ PRE="../.." . ../common.sh -# Check if we can run the test. -. ./precheck.sh - kill_pid $FWD_PID kill_pid $UNBOUND_PID diff --git a/testdata/dnscrypt_cert.tdir/dnscrypt_cert.pre b/testdata/dnscrypt_cert.tdir/dnscrypt_cert.pre index bee9e8ac6..6cf52299c 100644 --- a/testdata/dnscrypt_cert.tdir/dnscrypt_cert.pre +++ b/testdata/dnscrypt_cert.tdir/dnscrypt_cert.pre @@ -8,7 +8,11 @@ PRE="../.." . ../common.sh # Check if we can run the test. -. ./precheck.sh +if grep "define USE_DNSCRYPT 1" $PRE/config.h; then + echo "have dnscrypt" +else + skip_test "no dnscrypt" +fi get_random_port 3 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnscrypt_cert.tdir/dnscrypt_cert.test b/testdata/dnscrypt_cert.tdir/dnscrypt_cert.test index f09753792..fdb88e8f9 100644 --- a/testdata/dnscrypt_cert.tdir/dnscrypt_cert.test +++ b/testdata/dnscrypt_cert.tdir/dnscrypt_cert.test @@ -7,9 +7,6 @@ PRE="../.." . ../common.sh -# Check if we can run the test. -. ./precheck.sh - # do the test # Query plain request over DNSCrypt channel get closed diff --git a/testdata/dnscrypt_cert.tdir/precheck.sh b/testdata/dnscrypt_cert.tdir/precheck.sh deleted file mode 100644 index 00fa4bc76..000000000 --- a/testdata/dnscrypt_cert.tdir/precheck.sh +++ /dev/null @@ -1,16 +0,0 @@ -# dnscrypt precheck.sh - -# if no dnscrypt; exit -if grep "define USE_DNSCRYPT 1" $PRE/config.h; then - echo "have dnscrypt" -else - echo "no dnscrypt" - exit 0 -fi - -# if no xchacha20 support in unbound; exit -if grep "define USE_DNSCRYPT_XCHACHA20 1" $PRE/config.h; then - xchacha20=1 -else - xchacha20=0 -fi diff --git a/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.post b/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.post index 54337df67..9537d9e82 100644 --- a/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.post +++ b/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.post @@ -8,10 +8,5 @@ PRE="../.." . ../common.sh -# Check if we can run the test. -. ./precheck.sh - kill_pid $FWD_PID -if [ $xchacha20 -ne 0 ]; then - kill_pid $UNBOUND_PID -fi +kill_pid $UNBOUND_PID diff --git a/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.pre b/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.pre index c77290a8a..4534fdf47 100644 --- a/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.pre +++ b/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.pre @@ -7,8 +7,17 @@ PRE="../.." . ../common.sh -# Check if we can run the test. -. ./precheck.sh +# if no dnscrypt; exit +if grep "define USE_DNSCRYPT 1" $PRE/config.h; then + echo "have dnscrypt" +else + skip_test "no dnscrypt" +fi +if grep "define USE_DNSCRYPT_XCHACHA20 1" $PRE/config.h; then + echo "have XChacha20 support" +else + skip_test "no XChacha20 support" +fi get_random_port 3 UNBOUND_PORT=$RND_PORT @@ -34,10 +43,5 @@ echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test cat .tpkg.var.test wait_ldns_testns_up fwd.log -if [ $xchacha20 -eq 0 ]; then - # no xchacha20 support, we expect unbound to exit with an error message. - wait_server_up unbound.log "Certificate for XChacha20 but libsodium does not support it" -else - wait_unbound_up unbound.log -fi +wait_unbound_up unbound.log diff --git a/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.test b/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.test index 4ef6942be..2db073ad6 100644 --- a/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.test +++ b/testdata/dnscrypt_cert_chacha.tdir/dnscrypt_cert_chacha.test @@ -6,17 +6,9 @@ PRE="../.." . ../common.sh -# Check if we can run the test. -. ./precheck.sh # do the test -if [ $xchacha20 -eq 0 ]; then - # Unbound would exit before we can attempt any tests. - echo "OK" - exit 0 -fi - # Query plain request over DNSCrypt channel get closed # We use TCP to avoid hanging on waiting for UDP. # We expect `outfile` to contain no DNS payload @@ -104,7 +96,7 @@ do echo "> check answer" grep -F 'DNSC\000\002\000\000\1716\226\255*\244\002L\177g\025_\127tR\151\246R\203\178\153\248\006\137\"\138\173|G/,\160\152\015\010\172\184\220`\175\217\255,\162\018\178-d\007\246k0\003I[\205w\026)\204B\002\161\010\245\243W\191\189Z\216\210x\025\204\247\173\227t\138\018\162~\152\253\211\031z\\\002m5\008\254\2244\246\243W\191\189Z\216\210Y\160\2158Y\160\2158u\210\219\184' outfile cert_found=$? - if [ \( $cert_found -eq 0 -a $xchacha20 -eq 1 \) -o \( $cert_found -ne 0 -a $xchacha20 -eq 0 \) ]; then + if [ \( $cert_found -eq 0 \) ]; then echo "OK" else echo "Not OK" diff --git a/testdata/dnscrypt_cert_chacha.tdir/precheck.sh b/testdata/dnscrypt_cert_chacha.tdir/precheck.sh deleted file mode 100644 index 00fa4bc76..000000000 --- a/testdata/dnscrypt_cert_chacha.tdir/precheck.sh +++ /dev/null @@ -1,16 +0,0 @@ -# dnscrypt precheck.sh - -# if no dnscrypt; exit -if grep "define USE_DNSCRYPT 1" $PRE/config.h; then - echo "have dnscrypt" -else - echo "no dnscrypt" - exit 0 -fi - -# if no xchacha20 support in unbound; exit -if grep "define USE_DNSCRYPT_XCHACHA20 1" $PRE/config.h; then - xchacha20=1 -else - xchacha20=0 -fi diff --git a/testdata/dnstap.tdir/dnstap.post b/testdata/dnstap.tdir/dnstap.post index 6744b4b61..6d5e9d50d 100644 --- a/testdata/dnstap.tdir/dnstap.post +++ b/testdata/dnstap.tdir/dnstap.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap.tdir/dnstap.pre b/testdata/dnstap.tdir/dnstap.pre index 6561d77e9..0f2e0231d 100644 --- a/testdata/dnstap.tdir/dnstap.pre +++ b/testdata/dnstap.tdir/dnstap.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 3 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap.tdir/dnstap.test b/testdata/dnstap.tdir/dnstap.test index fbf8565ff..3a2dcc5e1 100644 --- a/testdata/dnstap.tdir/dnstap.test +++ b/testdata/dnstap.tdir/dnstap.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/dnstap_reconnect.tdir/dnstap_reconnect.post b/testdata/dnstap_reconnect.tdir/dnstap_reconnect.post index 0056a20d9..44b8e6b97 100644 --- a/testdata/dnstap_reconnect.tdir/dnstap_reconnect.post +++ b/testdata/dnstap_reconnect.tdir/dnstap_reconnect.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap_reconnect.tdir/dnstap_reconnect.pre b/testdata/dnstap_reconnect.tdir/dnstap_reconnect.pre index a1aba4f35..df031ac01 100644 --- a/testdata/dnstap_reconnect.tdir/dnstap_reconnect.pre +++ b/testdata/dnstap_reconnect.tdir/dnstap_reconnect.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 3 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap_reconnect.tdir/dnstap_reconnect.test b/testdata/dnstap_reconnect.tdir/dnstap_reconnect.test index 94679bc66..8f28bc109 100644 --- a/testdata/dnstap_reconnect.tdir/dnstap_reconnect.test +++ b/testdata/dnstap_reconnect.tdir/dnstap_reconnect.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/dnstap_tcp.tdir/dnstap_tcp.post b/testdata/dnstap_tcp.tdir/dnstap_tcp.post index 8aad21e19..f9a52edf6 100644 --- a/testdata/dnstap_tcp.tdir/dnstap_tcp.post +++ b/testdata/dnstap_tcp.tdir/dnstap_tcp.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap_tcp.tdir/dnstap_tcp.pre b/testdata/dnstap_tcp.tdir/dnstap_tcp.pre index 3006603c5..aea781de9 100644 --- a/testdata/dnstap_tcp.tdir/dnstap_tcp.pre +++ b/testdata/dnstap_tcp.tdir/dnstap_tcp.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 4 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap_tcp.tdir/dnstap_tcp.test b/testdata/dnstap_tcp.tdir/dnstap_tcp.test index d57eecfdb..c9aef3e78 100644 --- a/testdata/dnstap_tcp.tdir/dnstap_tcp.test +++ b/testdata/dnstap_tcp.tdir/dnstap_tcp.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/dnstap_tls.tdir/dnstap_tls.post b/testdata/dnstap_tls.tdir/dnstap_tls.post index fe1824a06..8adfb1a02 100644 --- a/testdata/dnstap_tls.tdir/dnstap_tls.post +++ b/testdata/dnstap_tls.tdir/dnstap_tls.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap_tls.tdir/dnstap_tls.pre b/testdata/dnstap_tls.tdir/dnstap_tls.pre index 1df914873..7a20ec2dd 100644 --- a/testdata/dnstap_tls.tdir/dnstap_tls.pre +++ b/testdata/dnstap_tls.tdir/dnstap_tls.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 4 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap_tls.tdir/dnstap_tls.test b/testdata/dnstap_tls.tdir/dnstap_tls.test index f9a2bf00d..3a0bf10f0 100644 --- a/testdata/dnstap_tls.tdir/dnstap_tls.test +++ b/testdata/dnstap_tls.tdir/dnstap_tls.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.post b/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.post index d71eb28ae..aa0dfbfa4 100644 --- a/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.post +++ b/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.pre b/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.pre index eff7074d0..f077965e0 100644 --- a/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.pre +++ b/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 4 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.test b/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.test index 0b85f64ac..b4d944a0f 100644 --- a/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.test +++ b/testdata/dnstap_tls_badcert.tdir/dnstap_tls_badcert.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.post b/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.post index 59f05b81d..553aa2f87 100644 --- a/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.post +++ b/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.pre b/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.pre index 0ffee6081..6a4a480b6 100644 --- a/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.pre +++ b/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 4 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.test b/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.test index 248d8f222..907392f6d 100644 --- a/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.test +++ b/testdata/dnstap_tls_badname.tdir/dnstap_tls_badname.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.post b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.post index 83df2a72e..2ef2ac36f 100644 --- a/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.post +++ b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.pre b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.pre index a035181ce..80a5cd61b 100644 --- a/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.pre +++ b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 4 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test index 5b9cce0a4..842c8190e 100644 --- a/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test +++ b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.post b/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.post index 3ca63ada4..733a36ea9 100644 --- a/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.post +++ b/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill $UNBOUND_PID diff --git a/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.pre b/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.pre index 25b838d8b..50f9853d4 100644 --- a/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.pre +++ b/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 4 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.test b/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.test index 03bcbadfd..b5a6adfc3 100644 --- a/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.test +++ b/testdata/dnstap_tls_peername.tdir/dnstap_tls_peername.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # test if the server is up. echo "> dig www.example.com." diff --git a/testdata/doh_downstream.tdir/doh_downstream.post b/testdata/doh_downstream.tdir/doh_downstream.post index 0e3c00b05..67972a7f0 100644 --- a/testdata/doh_downstream.tdir/doh_downstream.post +++ b/testdata/doh_downstream.tdir/doh_downstream.post @@ -6,7 +6,6 @@ # # do your teardown here PRE="../.." -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi . ../common.sh kill_pid $FWD_PID kill_pid $UNBOUND_PID diff --git a/testdata/doh_downstream.tdir/doh_downstream.pre b/testdata/doh_downstream.tdir/doh_downstream.pre index 29bb805a1..220725440 100644 --- a/testdata/doh_downstream.tdir/doh_downstream.pre +++ b/testdata/doh_downstream.tdir/doh_downstream.pre @@ -6,7 +6,7 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 2 UNBOUND_PORT=$RND_PORT diff --git a/testdata/doh_downstream.tdir/doh_downstream.test b/testdata/doh_downstream.tdir/doh_downstream.test index d66168fba..78e2e84eb 100644 --- a/testdata/doh_downstream.tdir/doh_downstream.test +++ b/testdata/doh_downstream.tdir/doh_downstream.test @@ -6,7 +6,6 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi get_make (cd $PRE; $MAKE dohclient) diff --git a/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.post b/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.post index 881970a77..f15ebe555 100644 --- a/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.post +++ b/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.post @@ -6,7 +6,6 @@ # # do your teardown here PRE="../.." -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi . ../common.sh kill_pid $UNBOUND_PID cat unbound.log diff --git a/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.pre b/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.pre index a58780ab3..ff68a4677 100644 --- a/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.pre +++ b/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.pre @@ -6,7 +6,7 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 1 UNBOUND_PORT=$RND_PORT diff --git a/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.test b/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.test index 78c46081d..bbeb9eb2b 100644 --- a/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.test +++ b/testdata/doh_downstream_buffer_size.tdir/doh_downstream_buffer_size.test @@ -6,7 +6,6 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi get_make (cd $PRE; $MAKE dohclient) diff --git a/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.post b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.post index dcdf8627e..f15ebe555 100644 --- a/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.post +++ b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.post @@ -7,6 +7,5 @@ # do your teardown here PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $UNBOUND_PID cat unbound.log diff --git a/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.pre b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.pre index cd0d11fd4..dd7acc290 100644 --- a/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.pre +++ b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.pre @@ -6,7 +6,7 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 1 UNBOUND_PORT=$RND_PORT echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test diff --git a/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test index 2a6954cab..d788e3667 100644 --- a/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test +++ b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test @@ -6,7 +6,6 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi get_make (cd $PRE; $MAKE dohclient) diff --git a/testdata/doh_downstream_notls.tdir/doh_downstream_notls.post b/testdata/doh_downstream_notls.tdir/doh_downstream_notls.post index 3ceaeade8..9fb51b6d3 100644 --- a/testdata/doh_downstream_notls.tdir/doh_downstream_notls.post +++ b/testdata/doh_downstream_notls.tdir/doh_downstream_notls.post @@ -6,7 +6,6 @@ # # do your teardown here PRE="../.." -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi . ../common.sh kill_pid $FWD_PID kill_pid $UNBOUND_PID diff --git a/testdata/doh_downstream_notls.tdir/doh_downstream_notls.pre b/testdata/doh_downstream_notls.tdir/doh_downstream_notls.pre index e1f30a575..9c7233d64 100644 --- a/testdata/doh_downstream_notls.tdir/doh_downstream_notls.pre +++ b/testdata/doh_downstream_notls.tdir/doh_downstream_notls.pre @@ -6,7 +6,7 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 2 UNBOUND_PORT=$RND_PORT diff --git a/testdata/doh_downstream_notls.tdir/doh_downstream_notls.test b/testdata/doh_downstream_notls.tdir/doh_downstream_notls.test index 87ff560d3..040285e8f 100644 --- a/testdata/doh_downstream_notls.tdir/doh_downstream_notls.test +++ b/testdata/doh_downstream_notls.tdir/doh_downstream_notls.test @@ -6,7 +6,6 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi get_make (cd $PRE; $MAKE dohclient) diff --git a/testdata/doh_downstream_post.tdir/doh_downstream_post.post b/testdata/doh_downstream_post.tdir/doh_downstream_post.post index 98034a32c..2f8f5a8e0 100644 --- a/testdata/doh_downstream_post.tdir/doh_downstream_post.post +++ b/testdata/doh_downstream_post.tdir/doh_downstream_post.post @@ -7,7 +7,6 @@ # do your teardown here PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $FWD_PID kill_pid $UNBOUND_PID cat unbound.log diff --git a/testdata/doh_downstream_post.tdir/doh_downstream_post.pre b/testdata/doh_downstream_post.tdir/doh_downstream_post.pre index 34df83d4b..a8ecd344b 100644 --- a/testdata/doh_downstream_post.tdir/doh_downstream_post.pre +++ b/testdata/doh_downstream_post.tdir/doh_downstream_post.pre @@ -6,7 +6,7 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 2 UNBOUND_PORT=$RND_PORT FWD_PORT=$(($RND_PORT + 1)) diff --git a/testdata/doh_downstream_post.tdir/doh_downstream_post.test b/testdata/doh_downstream_post.tdir/doh_downstream_post.test index 6442d1e12..d6a512ae3 100644 --- a/testdata/doh_downstream_post.tdir/doh_downstream_post.test +++ b/testdata/doh_downstream_post.tdir/doh_downstream_post.test @@ -6,7 +6,6 @@ PRE="../.." . ../common.sh -if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi get_make (cd $PRE; $MAKE dohclient) diff --git a/testdata/dynlibmod.tdir/dynlibmod.post b/testdata/dynlibmod.tdir/dynlibmod.post index caa0da4f5..99a4268a7 100644 --- a/testdata/dynlibmod.tdir/dynlibmod.post +++ b/testdata/dynlibmod.tdir/dynlibmod.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define WITH_DYNLIBMODULE 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $FWD_PID kill $UNBOUND_PID kill $UNBOUND_PID >/dev/null 2>&1 diff --git a/testdata/dynlibmod.tdir/dynlibmod.pre b/testdata/dynlibmod.tdir/dynlibmod.pre index 94adaa723..fbf229b8b 100644 --- a/testdata/dynlibmod.tdir/dynlibmod.pre +++ b/testdata/dynlibmod.tdir/dynlibmod.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define WITH_DYNLIBMODULE 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define WITH_DYNLIBMODULE 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 3 UNBOUND_PORT=$RND_PORT diff --git a/testdata/dynlibmod.tdir/dynlibmod.test b/testdata/dynlibmod.tdir/dynlibmod.test index f99f6fbc4..2954acaff 100644 --- a/testdata/dynlibmod.tdir/dynlibmod.test +++ b/testdata/dynlibmod.tdir/dynlibmod.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define WITH_DYNLIBMODULE 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # compile the dynamic library module if grep "define USE_WINSOCK 1" $PRE/config.h; then diff --git a/testdata/fwd_ancil.tdir/fwd_ancil.post b/testdata/fwd_ancil.tdir/fwd_ancil.post index 6578151af..c11bd44cd 100644 --- a/testdata/fwd_ancil.tdir/fwd_ancil.post +++ b/testdata/fwd_ancil.tdir/fwd_ancil.post @@ -6,11 +6,6 @@ # # do your teardown here . ../common.sh -if test `hostname`"" = "dicht.nlnetlabs.nl"; then - echo "In jail, no ::1, skip test" - exit 0 -fi - kill_pid $FWD_PID if fgrep "service stopped" unbound.log; then exit 0 diff --git a/testdata/fwd_ancil.tdir/fwd_ancil.pre b/testdata/fwd_ancil.tdir/fwd_ancil.pre index e1ce37a7f..6c0fb7a0b 100644 --- a/testdata/fwd_ancil.tdir/fwd_ancil.pre +++ b/testdata/fwd_ancil.tdir/fwd_ancil.pre @@ -6,8 +6,7 @@ . ../common.sh if test `hostname`"" = "dicht.nlnetlabs.nl"; then - echo "In jail, no ::1, skip test" - exit 0 + skip_test "In jail, no ::1, skip test" fi get_random_port 2 @@ -38,7 +37,6 @@ wait_ldns_testns_up fwd.log # string 'Start of service' in log. wait_server_up_or_fail unbound.log "start of service" "disable interface-automatic" if fgrep "disable interface-automatic" unbound.log; then - echo "skip test" - exit 1 + skip_test "skip test" fi diff --git a/testdata/fwd_ancil.tdir/fwd_ancil.test b/testdata/fwd_ancil.tdir/fwd_ancil.test index b90360fb8..8da4754ce 100644 --- a/testdata/fwd_ancil.tdir/fwd_ancil.test +++ b/testdata/fwd_ancil.tdir/fwd_ancil.test @@ -7,11 +7,6 @@ PRE="../.." . ../common.sh -if test `hostname`"" = "dicht.nlnetlabs.nl"; then - echo "In jail, no ::1, skip test" - exit 0 -fi - if fgrep "disable interface-automatic" unbound.log; then echo "skip test" exit 0 diff --git a/testdata/ipset.tdir/ipset.post b/testdata/ipset.tdir/ipset.post index 7af512a4d..4c4c17b13 100644 --- a/testdata/ipset.tdir/ipset.post +++ b/testdata/ipset.tdir/ipset.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_IPSET 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $FWD_PID kill_pid $UNBOUND_PID cat unbound.log diff --git a/testdata/ipset.tdir/ipset.pre b/testdata/ipset.tdir/ipset.pre index ee1aedc70..42c94fac4 100644 --- a/testdata/ipset.tdir/ipset.pre +++ b/testdata/ipset.tdir/ipset.pre @@ -7,7 +7,7 @@ . ../common.sh PRE="../.." -if grep "define USE_IPSET 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_IPSET 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 2 UNBOUND_PORT=$RND_PORT diff --git a/testdata/ipset.tdir/ipset.test b/testdata/ipset.tdir/ipset.test index 9150e5e3f..4dab457ba 100644 --- a/testdata/ipset.tdir/ipset.test +++ b/testdata/ipset.tdir/ipset.test @@ -6,7 +6,6 @@ . ../common.sh PRE="../.." -if grep "define USE_IPSET 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi # Make all the queries. They need to succeed by the way. echo "> dig www.example.net." diff --git a/testdata/nss_compile.tdir/nss_compile.dsc b/testdata/nss_compile.tdir/nss_compile.dsc index 6c59d245f..a719a260d 100644 --- a/testdata/nss_compile.tdir/nss_compile.dsc +++ b/testdata/nss_compile.tdir/nss_compile.dsc @@ -8,7 +8,7 @@ Component: CmdDepends: Depends: Help: -Pre: +Pre: nss_compile.pre Post: Test: nss_compile.test AuxFiles: diff --git a/testdata/nss_compile.tdir/nss_compile.pre b/testdata/nss_compile.tdir/nss_compile.pre new file mode 100644 index 000000000..313f60383 --- /dev/null +++ b/testdata/nss_compile.tdir/nss_compile.pre @@ -0,0 +1,13 @@ +# #-- nss_compile.pre --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test + +. ../common.sh +if test "`hostname`" = "open.nlnetlabs.nl"; then + echo "on open, continue test" +else + skip_test "not on open, no test, do this explicitly" +fi +exit 0 diff --git a/testdata/nss_compile.tdir/nss_compile.test b/testdata/nss_compile.tdir/nss_compile.test index 82b194668..73afd6401 100644 --- a/testdata/nss_compile.tdir/nss_compile.test +++ b/testdata/nss_compile.tdir/nss_compile.test @@ -4,13 +4,6 @@ # use .tpkg.var.test for in test variable passing [ -f .tpkg.var.test ] && source .tpkg.var.test -if test "`hostname`" = "open.nlnetlabs.nl"; then - echo "on open, continue test" -else - echo "not on open, no test, do this explicitly" - exit 0 -fi - . ../common.sh get_make PRE="../.." diff --git a/testdata/padding.tdir/padding.post b/testdata/padding.tdir/padding.post index 826798a8f..9121ccf25 100644 --- a/testdata/padding.tdir/padding.post +++ b/testdata/padding.tdir/padding.post @@ -7,7 +7,6 @@ # do your teardown here . ../common.sh PRE="../.." -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi kill_pid $DNSTAP_SOCKET_PID kill_pid $FWD_PID kill_pid `cat unbound2.pid` diff --git a/testdata/padding.tdir/padding.pre b/testdata/padding.tdir/padding.pre index 4a13d0229..fdb6386be 100644 --- a/testdata/padding.tdir/padding.pre +++ b/testdata/padding.tdir/padding.pre @@ -6,7 +6,7 @@ PRE="../.." . ../common.sh -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi get_random_port 5 UNBOUND_PORT=$RND_PORT diff --git a/testdata/padding.tdir/padding.test b/testdata/padding.tdir/padding.test index 5111d8139..6161a49ae 100644 --- a/testdata/padding.tdir/padding.test +++ b/testdata/padding.tdir/padding.test @@ -8,7 +8,6 @@ echo There we go... PRE="../.." . ../common.sh -if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi echo "> query www.example.com. A" dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile diff --git a/testdata/pylib.tdir/pylib.post b/testdata/pylib.tdir/pylib.post index 875e06d0a..8dbde8d2e 100644 --- a/testdata/pylib.tdir/pylib.post +++ b/testdata/pylib.tdir/pylib.post @@ -8,13 +8,6 @@ PRE="../.." . ../common.sh -# if no python; exit -if grep "define WITH_PYUNBOUND 1" $PRE/config.h; then - echo "have pyunbound" -else - echo "no pyunbound" - exit 0 -fi # kill fwder kill_pid $FWD_PID diff --git a/testdata/pylib.tdir/pylib.pre b/testdata/pylib.tdir/pylib.pre index 30e005906..3a74b6019 100644 --- a/testdata/pylib.tdir/pylib.pre +++ b/testdata/pylib.tdir/pylib.pre @@ -10,8 +10,7 @@ PRE="../.." if grep "define WITH_PYUNBOUND 1" $PRE/config.h; then echo "have pyunbound" else - echo "no pyunbound" - exit 0 + skip_test "no pyunbound" fi # Copy the required libraries diff --git a/testdata/pylib.tdir/pylib.test b/testdata/pylib.tdir/pylib.test index 59f996459..a583daba4 100644 --- a/testdata/pylib.tdir/pylib.test +++ b/testdata/pylib.tdir/pylib.test @@ -5,13 +5,6 @@ [ -f .tpkg.var.test ] && source .tpkg.var.test PRE="../.." -if grep "define WITH_PYUNBOUND 1" $PRE/config.h; then - echo "have pyunbound" -else - echo "no pyunbound" - exit 0 -fi - if test "`uname 2>&1`" = "Darwin"; then echo export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:../../.libs" export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:../../.libs" diff --git a/testdata/pymod.tdir/pymod.post b/testdata/pymod.tdir/pymod.post index 368d285ed..5449ad474 100644 --- a/testdata/pymod.tdir/pymod.post +++ b/testdata/pymod.tdir/pymod.post @@ -8,13 +8,6 @@ PRE="../.." . ../common.sh -# if no python; exit -if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then - echo "have python module" -else - echo "no python module" - exit 0 -fi kill_pid $FWD_PID kill_pid $UNBOUND_PID diff --git a/testdata/pymod.tdir/pymod.pre b/testdata/pymod.tdir/pymod.pre index 9029a8742..f845d6f97 100644 --- a/testdata/pymod.tdir/pymod.pre +++ b/testdata/pymod.tdir/pymod.pre @@ -10,8 +10,7 @@ PRE="../.." if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then echo "have python module" else - echo "no python module" - exit 0 + skip_test "no python module" fi # get module python local cp $PRE/pythonmod/unboundmodule.py . diff --git a/testdata/pymod.tdir/pymod.test b/testdata/pymod.tdir/pymod.test index 43bf6e65f..5ea87282b 100644 --- a/testdata/pymod.tdir/pymod.test +++ b/testdata/pymod.tdir/pymod.test @@ -5,12 +5,6 @@ [ -f .tpkg.var.test ] && source .tpkg.var.test PRE="../.." -if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then - echo "have python module" -else - echo "no python module" - exit 0 -fi if test "`uname 2>&1`" = "Darwin"; then ldnsdir=`grep ldnsdir= ../../Makefile | sed -e 's/ldnsdir=//'` diff --git a/testdata/pymod_thread.tdir/pymod_thread.post b/testdata/pymod_thread.tdir/pymod_thread.post index e9b307548..b438958b2 100644 --- a/testdata/pymod_thread.tdir/pymod_thread.post +++ b/testdata/pymod_thread.tdir/pymod_thread.post @@ -8,13 +8,6 @@ PRE="../.." . ../common.sh -# if no python; exit -if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then - echo "have python module" -else - echo "no python module" - exit 0 -fi kill_pid $FWD_PID kill_pid $UNBOUND_PID diff --git a/testdata/pymod_thread.tdir/pymod_thread.pre b/testdata/pymod_thread.tdir/pymod_thread.pre index c16362a0b..79fdc0375 100644 --- a/testdata/pymod_thread.tdir/pymod_thread.pre +++ b/testdata/pymod_thread.tdir/pymod_thread.pre @@ -10,8 +10,7 @@ PRE="../.." if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then echo "have python module" else - echo "no python module" - exit 0 + skip_test "no python module" fi # get module python local cp $PRE/pythonmod/unboundmodule.py . diff --git a/testdata/pymod_thread.tdir/pymod_thread.test b/testdata/pymod_thread.tdir/pymod_thread.test index c6baa01be..7c55d19ab 100644 --- a/testdata/pymod_thread.tdir/pymod_thread.test +++ b/testdata/pymod_thread.tdir/pymod_thread.test @@ -5,12 +5,6 @@ [ -f .tpkg.var.test ] && source .tpkg.var.test PRE="../.." -if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then - echo "have python module" -else - echo "no python module" - exit 0 -fi if test "`uname 2>&1`" = "Darwin"; then ldnsdir=`grep ldnsdir= ../../Makefile | sed -e 's/ldnsdir=//'` diff --git a/testdata/root_anchor.tdir/root_anchor.dsc b/testdata/root_anchor.tdir/root_anchor.dsc index daf231da5..2ea179e89 100644 --- a/testdata/root_anchor.tdir/root_anchor.dsc +++ b/testdata/root_anchor.tdir/root_anchor.dsc @@ -8,7 +8,7 @@ Component: CmdDepends: Depends: Help: -Pre: +Pre: root_anchor.pre Post: Test: root_anchor.test AuxFiles: diff --git a/testdata/root_anchor.tdir/root_anchor.pre b/testdata/root_anchor.tdir/root_anchor.pre new file mode 100644 index 000000000..0357646cd --- /dev/null +++ b/testdata/root_anchor.tdir/root_anchor.pre @@ -0,0 +1,11 @@ +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test + +# only do this test if the network is up. +if dig @k.root-servers.net . SOA 2>&1 | grep NOERROR ; then + : +else + skip_test "network is not up" +fi diff --git a/testdata/root_anchor.tdir/root_anchor.test b/testdata/root_anchor.tdir/root_anchor.test index f75dadf67..bbff028be 100644 --- a/testdata/root_anchor.tdir/root_anchor.test +++ b/testdata/root_anchor.tdir/root_anchor.test @@ -5,15 +5,6 @@ PRE="../.." -# only do this test if the network is up. -echo "is the net up?" -if dig @k.root-servers.net . SOA 2>&1 | grep NOERROR ; then - echo yes -else - echo no - exit 0 -fi - # test that unbound-anchor, its builtin DNSKEY, works. # so the https is disabled (go to 127.0.0.1@10099). $PRE/unbound-anchor -u "127.0.0.1" -P 10099 -a test.ds -v diff --git a/testdata/root_hints.tdir/root_hints.dsc b/testdata/root_hints.tdir/root_hints.dsc index 5576fbaf9..c01f29074 100644 --- a/testdata/root_hints.tdir/root_hints.dsc +++ b/testdata/root_hints.tdir/root_hints.dsc @@ -8,7 +8,7 @@ Component: CmdDepends: Depends: Help: -Pre: +Pre: root_hints.pre Post: Test: root_hints.test AuxFiles: diff --git a/testdata/root_hints.tdir/root_hints.pre b/testdata/root_hints.tdir/root_hints.pre new file mode 100644 index 000000000..a75669312 --- /dev/null +++ b/testdata/root_hints.tdir/root_hints.pre @@ -0,0 +1,11 @@ +# #-- root_hints.pre --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test + +# dig 9 ? +digv=`dig -v 2>&1 | wc -l` +if test $digv -ne 1; then + skip_test "Dig too old. skip test" +fi diff --git a/testdata/root_hints.tdir/root_hints.test b/testdata/root_hints.tdir/root_hints.test index 6ae4ec7f4..a5c1dc195 100644 --- a/testdata/root_hints.tdir/root_hints.test +++ b/testdata/root_hints.tdir/root_hints.test @@ -1,4 +1,4 @@ -# #-- 06-ianaports.test --# +# #-- root_hints.test --# # source the master var file when it's there [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master # use .tpkg.var.test for in test variable passing @@ -6,13 +6,6 @@ PRE="../.." -# dig 9 ? -digv=`dig -v 2>&1 | wc -l` -if test $digv -ne 1; then - echo "Dig too old. skip test" - exit 0 -fi - eval `grep ^srcdir= $PRE/Makefile` echo "srcdir="$srcdir