diff --git a/doc/Changelog b/doc/Changelog index 2bdaed379..dc8e08f90 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +6 July 2017: Wouter + - Fix tests to use .tdir (from Manu Bretelle) instead of .tpkg. + 4 July 2017: Wouter - Fix 1332: Bump verbosity of failed chown'ing of the control socket. diff --git a/testcode/do-tests.sh b/testcode/do-tests.sh index dcf93907e..5439f0f28 100755 --- a/testcode/do-tests.sh +++ b/testcode/do-tests.sh @@ -1,15 +1,15 @@ #!/usr/bin/env bash . testdata/common.sh -NEED_SPLINT='00-lint.tpkg' -NEED_DOXYGEN='01-doc.tpkg' -NEED_XXD='fwd_compress_c00c.tpkg fwd_zero.tpkg' -NEED_NC='fwd_compress_c00c.tpkg fwd_zero.tpkg' -NEED_CURL='06-ianaports.tpkg root_anchor.tpkg' -NEED_WHOAMI='07-confroot.tpkg' -NEED_IPV6='fwd_ancil.tpkg fwd_tcp_tc6.tpkg stub_udp6.tpkg edns_cache.tpkg' -NEED_NOMINGW='tcp_sigpipe.tpkg 07-confroot.tpkg 08-host-lib.tpkg fwd_ancil.tpkg' -NEED_DNSCRYPT_PROXY='dnscrypt_queries.tpkg dnscrypt_queries_chacha.tpkg' +NEED_SPLINT='00-lint.tdir' +NEED_DOXYGEN='01-doc.tdir' +NEED_XXD='fwd_compress_c00c.tdir fwd_zero.tdir' +NEED_NC='fwd_compress_c00c.tdir fwd_zero.tdir' +NEED_CURL='06-ianaports.tdir root_anchor.tdir' +NEED_WHOAMI='07-confroot.tdir' +NEED_IPV6='fwd_ancil.tdir fwd_tcp_tc6.tdir stub_udp6.tdir edns_cache.tdir' +NEED_NOMINGW='tcp_sigpipe.tdir 07-confroot.tdir 08-host-lib.tdir fwd_ancil.tdir' +NEED_DNSCRYPT_PROXY='dnscrypt_queries.tdir dnscrypt_queries_chacha.tdir' # test if dig and ldns-testns are available. test_tool_avail "dig" @@ -30,9 +30,9 @@ else fi cd testdata; -sh ../testcode/mini_tpkg.sh clean +sh ../testcode/mini_tdir.sh clean rm -f .perfstats.txt -for test in `ls *.tpkg`; do +for test in `ls -d *.tdir`; do SKIP=0 skip_if_in_list $test "$NEED_SPLINT" "splint" skip_if_in_list $test "$NEED_DOXYGEN" "doxygen" @@ -54,10 +54,10 @@ for test in `ls *.tpkg`; do fi if test $SKIP -eq 0; then echo $test - sh ../testcode/mini_tpkg.sh -a ../.. exe $test + sh ../testcode/mini_tdir.sh -a ../.. exe $test else echo "skip $test" fi done -sh ../testcode/mini_tpkg.sh report +sh ../testcode/mini_tdir.sh report cat .perfstats.txt diff --git a/testcode/fake_event.c b/testcode/fake_event.c index 154013a8c..cd23b8feb 100644 --- a/testcode/fake_event.c +++ b/testcode/fake_event.c @@ -1331,7 +1331,7 @@ int serviced_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b)) return 0; } -/* timers in testbound for autotrust. statistics tested in tpkg. */ +/* timers in testbound for autotrust. statistics tested in tdir. */ struct comm_timer* comm_timer_create(struct comm_base* base, void (*cb)(void*), void* cb_arg) { diff --git a/testcode/mini_tdir.sh b/testcode/mini_tdir.sh new file mode 100755 index 000000000..7e93d8735 --- /dev/null +++ b/testcode/mini_tdir.sh @@ -0,0 +1,127 @@ +# tdir that only exes the files. +args="../.." +if test "$1" = "-a"; then + args=$2 + shift + shift +fi + +if test "$1" = "clean"; then + echo "rm -f result.* .done* .tdir.var.master .tdir.var.test" + rm -f result.* .done* .tdir.var.master .tdir.var.test + exit 0 +fi +if test "$1" = "fake"; then + echo "minitdir fake $2" + echo "fake" > .done-`basename $2 .tdir` + exit 0 +fi +if test "$1" = "report" || test "$2" = "report"; then + echo "Minitdir Report" + for result in *.tdir; do + name=`basename $result .tdir` + if test -f ".done-$name"; then + if test "$1" != "-q"; then + echo "** PASSED ** : $name" + fi + else + if test -f "result.$name"; then + echo "!! FAILED !! : $name" + else + echo ">> SKIPPED<< : $name" + fi + fi + done + exit 0 +fi + +if test "$1" != 'exe'; then + # usage + echo "mini tdir. Reduced functionality for old shells." + echo " tdir exe " + echo " tdir fake " + echo " tdir clean" + echo " tdir [-q] report" + exit 1 +fi +shift + +# do not execute if the disk is too full +#DISKLIMIT=100000 +# This check is not portable (to Solaris 10). +#avail=`df . | tail -1 | awk '{print $4}'` +#if test "$avail" -lt "$DISKLIMIT"; then + #echo "minitdir: The disk is too full! Only $avail." + #exit 1 +#fi + +name=`basename $1 .tdir` +dir=$name.$$ +result=result.$name +done=.done-$name +success="no" +if test -x "`which bash`"; then + shell="bash" +else + shell="sh" +fi + +# check already done +if test -f .done-$name; then + echo "minitdir .done-$name exists. skip test." + exit 0 +fi + +# Copy +echo "minitdir copy $1 to $dir" +mkdir $dir +cp -a $name.tdir/* $dir/ +cd $dir + +# EXE +echo "minitdir exe $name" > $result +grep "Description:" $name.dsc >> $result 2>&1 +echo "DateRunStart: "`date "+%s" 2>/dev/null` >> $result +if test -f $name.pre; then + echo "minitdir exe $name.pre" + echo "minitdir exe $name.pre" >> $result + $shell $name.pre $args >> $result + if test $? -ne 0; then + echo "Warning: $name.pre did not exit successfully" + fi +fi +if test -f $name.test; then + echo "minitdir exe $name.test" + echo "minitdir exe $name.test" >> $result + $shell $name.test $args >>$result 2>&1 + if test $? -ne 0; then + echo "$name: FAILED" >> $result + echo "$name: FAILED" + success="no" + else + echo "$name: PASSED" >> $result + echo "$name: PASSED" > ../.done-$name + echo "$name: PASSED" + success="yes" + fi +fi +if test -f $name.post; then + echo "minitdir exe $name.post" + echo "minitdir exe $name.post" >> $result + $shell $name.post $args >> $result + if test $? -ne 0; then + echo "Warning: $name.post did not exit successfully" + fi +fi +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 + rm -rf $dir +fi diff --git a/testcode/run_vm.sh b/testcode/run_vm.sh index 78649f07a..268fb70eb 100644 --- a/testcode/run_vm.sh +++ b/testcode/run_vm.sh @@ -1,7 +1,7 @@ #!/usr/local/bin/bash -# run tpkg tests from within a VM. Looks for loopback addr. +# run tdir tests from within a VM. Looks for loopback addr. # if run not from within a VM, runs the tests as usual. -# with one argument: run that tpkg, otherwise, run all tpkgs. +# with one argument: run that tdir, otherwise, run all tdirs. get_lo0_ip4() { if test -x /sbin/ifconfig @@ -23,12 +23,12 @@ else ALT_LOOPBACK=true fi cd testdata -TPKG=../testcode/mini_tpkg.sh -#RUNLIST=`(ls -1 *.tpkg|grep -v '^0[016]')` -RUNLIST=`(ls -1 *.tpkg)` +TPKG=../testcode/mini_tdir.sh +#RUNLIST=`(ls -1 *.tdir|grep -v '^0[016]')` +RUNLIST=`(ls -1 *.tdir)` if test "$#" = "1"; then RUNLIST="$1"; fi -# fix up tpkg that was edited on keyboard interrupt. +# fix up tdir that was edited on keyboard interrupt. cleanup() { echo cleanup if test -f "$t.bak"; then mv "$t.bak" "$t"; fi @@ -44,16 +44,15 @@ do continue fi # We have alternative 127.0.0.1 number - if ( echo $t | grep '6\.tpkg$' ) # skip IPv6 tests + if ( echo $t | grep '6\.tdir$' ) # skip IPv6 tests then continue - elif test "$t" = "edns_cache.tpkg" # This one is IPv6 too! + elif test "$t" = "edns_cache.tdir" # This one is IPv6 too! then continue fi - cp -p "$t" "$t.bak" - tar xzf $t - find "${t%.tpkg}.dir" -type f \ + cp -ap "$t" "$t.bak" + find "${t}" -type f \ -exec grep -q -e '127\.0\.0\.1' -e '@localhost' {} \; -print | { while read f do @@ -63,15 +62,14 @@ do mv "$f._" "$f" done } - find "${t%.tpkg}.dir" -type d -name "127.0.0.1" -print | { + find "${t}" -type d -name "127.0.0.1" -print | { while read d do mv -v "$d" "${d%127.0.0.1}${LO0_IP4}" done } - tar czf $t "${t%.tpkg}.dir" - rm -fr "${t%.tpkg}.dir" $TPKG exe $t + rm -fr "${t}" mv "$t.bak" "$t" done # get out of testdata/ diff --git a/testdata/00-lint.tpkg b/testdata/00-lint.tpkg deleted file mode 100644 index 89e44966d..000000000 Binary files a/testdata/00-lint.tpkg and /dev/null differ diff --git a/testdata/01-doc.tpkg b/testdata/01-doc.tpkg deleted file mode 100644 index 6502bdc14..000000000 Binary files a/testdata/01-doc.tpkg and /dev/null differ diff --git a/testdata/02-unittest.tpkg b/testdata/02-unittest.tpkg deleted file mode 100644 index 4618ae30e..000000000 Binary files a/testdata/02-unittest.tpkg and /dev/null differ diff --git a/testdata/03-testbound.tpkg b/testdata/03-testbound.tpkg deleted file mode 100644 index 5db2b7731..000000000 Binary files a/testdata/03-testbound.tpkg and /dev/null differ diff --git a/testdata/04-checkconf.tpkg b/testdata/04-checkconf.tpkg deleted file mode 100644 index c100355de..000000000 Binary files a/testdata/04-checkconf.tpkg and /dev/null differ diff --git a/testdata/05-asynclook.tpkg b/testdata/05-asynclook.tpkg deleted file mode 100644 index e13476ab2..000000000 Binary files a/testdata/05-asynclook.tpkg and /dev/null differ diff --git a/testdata/06-ianaports.tpkg b/testdata/06-ianaports.tpkg deleted file mode 100644 index 98020a0a5..000000000 Binary files a/testdata/06-ianaports.tpkg and /dev/null differ diff --git a/testdata/07-confroot.tpkg b/testdata/07-confroot.tpkg deleted file mode 100644 index 705c70876..000000000 Binary files a/testdata/07-confroot.tpkg and /dev/null differ diff --git a/testdata/08-host-lib.tpkg b/testdata/08-host-lib.tpkg deleted file mode 100644 index 818ed5bca..000000000 Binary files a/testdata/08-host-lib.tpkg and /dev/null differ diff --git a/testdata/09-unbound-control.tpkg b/testdata/09-unbound-control.tpkg deleted file mode 100644 index d5b11b77f..000000000 Binary files a/testdata/09-unbound-control.tpkg and /dev/null differ diff --git a/testdata/10-unbound-anchor.tpkg b/testdata/10-unbound-anchor.tpkg deleted file mode 100644 index db8680a64..000000000 Binary files a/testdata/10-unbound-anchor.tpkg and /dev/null differ diff --git a/testdata/common.sh b/testdata/common.sh index 2a8ec7bb3..f6d72c2f0 100644 --- a/testdata/common.sh +++ b/testdata/common.sh @@ -6,7 +6,7 @@ # 2011-02-18: ports check on BSD,Solaris. wait_nsd_up. # 2011-02-11: first version. # -# include this file from a tpkg script with +# include this file from a tdir script with # . ../common.sh # # overview of functions available: diff --git a/testdata/ctrl_itr.tpkg b/testdata/ctrl_itr.tpkg deleted file mode 100644 index dadf0a307..000000000 Binary files a/testdata/ctrl_itr.tpkg and /dev/null differ diff --git a/testdata/ctrl_pipe.tpkg b/testdata/ctrl_pipe.tpkg deleted file mode 100644 index 877fcf901..000000000 Binary files a/testdata/ctrl_pipe.tpkg and /dev/null differ diff --git a/testdata/dnscrypt_cert.tpkg b/testdata/dnscrypt_cert.tpkg deleted file mode 100644 index 4263b9347..000000000 Binary files a/testdata/dnscrypt_cert.tpkg and /dev/null differ diff --git a/testdata/dnscrypt_cert_chacha.tpkg b/testdata/dnscrypt_cert_chacha.tpkg deleted file mode 100644 index 0da443816..000000000 Binary files a/testdata/dnscrypt_cert_chacha.tpkg and /dev/null differ diff --git a/testdata/dnscrypt_queries.tpkg b/testdata/dnscrypt_queries.tpkg deleted file mode 100644 index c856303cd..000000000 Binary files a/testdata/dnscrypt_queries.tpkg and /dev/null differ diff --git a/testdata/dnscrypt_queries_chacha.tpkg b/testdata/dnscrypt_queries_chacha.tpkg deleted file mode 100644 index 8cb39dc2c..000000000 Binary files a/testdata/dnscrypt_queries_chacha.tpkg and /dev/null differ diff --git a/testdata/edns_cache.tpkg b/testdata/edns_cache.tpkg deleted file mode 100644 index 637564108..000000000 Binary files a/testdata/edns_cache.tpkg and /dev/null differ diff --git a/testdata/edns_lame.tpkg b/testdata/edns_lame.tpkg deleted file mode 100644 index 643fe0c61..000000000 Binary files a/testdata/edns_lame.tpkg and /dev/null differ diff --git a/testdata/fwd_ancil.tpkg b/testdata/fwd_ancil.tpkg deleted file mode 100644 index 34021180e..000000000 Binary files a/testdata/fwd_ancil.tpkg and /dev/null differ diff --git a/testdata/fwd_bogus.tpkg b/testdata/fwd_bogus.tpkg deleted file mode 100644 index 3a49d1f75..000000000 Binary files a/testdata/fwd_bogus.tpkg and /dev/null differ diff --git a/testdata/fwd_capsid.tpkg b/testdata/fwd_capsid.tpkg deleted file mode 100644 index 3f50639cb..000000000 Binary files a/testdata/fwd_capsid.tpkg and /dev/null differ diff --git a/testdata/fwd_capsid_fallback.tpkg b/testdata/fwd_capsid_fallback.tpkg deleted file mode 100644 index fed74134c..000000000 Binary files a/testdata/fwd_capsid_fallback.tpkg and /dev/null differ diff --git a/testdata/fwd_capsid_strip.tpkg b/testdata/fwd_capsid_strip.tpkg deleted file mode 100644 index c0be8a3c5..000000000 Binary files a/testdata/fwd_capsid_strip.tpkg and /dev/null differ diff --git a/testdata/fwd_capsid_white.tpkg b/testdata/fwd_capsid_white.tpkg deleted file mode 100644 index 199befb56..000000000 Binary files a/testdata/fwd_capsid_white.tpkg and /dev/null differ diff --git a/testdata/fwd_compress_c00c.tpkg b/testdata/fwd_compress_c00c.tpkg deleted file mode 100644 index a75a56a7d..000000000 Binary files a/testdata/fwd_compress_c00c.tpkg and /dev/null differ diff --git a/testdata/fwd_edns_bksec.tpkg b/testdata/fwd_edns_bksec.tpkg deleted file mode 100644 index dc8ac739d..000000000 Binary files a/testdata/fwd_edns_bksec.tpkg and /dev/null differ diff --git a/testdata/fwd_edns_probe.tpkg b/testdata/fwd_edns_probe.tpkg deleted file mode 100644 index c92689797..000000000 Binary files a/testdata/fwd_edns_probe.tpkg and /dev/null differ diff --git a/testdata/fwd_malformed.tpkg b/testdata/fwd_malformed.tpkg deleted file mode 100644 index 82a11ac23..000000000 Binary files a/testdata/fwd_malformed.tpkg and /dev/null differ diff --git a/testdata/fwd_no_edns.tpkg b/testdata/fwd_no_edns.tpkg deleted file mode 100644 index 9de545d16..000000000 Binary files a/testdata/fwd_no_edns.tpkg and /dev/null differ diff --git a/testdata/fwd_oneport.tpkg b/testdata/fwd_oneport.tpkg deleted file mode 100644 index 02f5182d3..000000000 Binary files a/testdata/fwd_oneport.tpkg and /dev/null differ diff --git a/testdata/fwd_tcp.tpkg b/testdata/fwd_tcp.tpkg deleted file mode 100644 index e85b93b90..000000000 Binary files a/testdata/fwd_tcp.tpkg and /dev/null differ diff --git a/testdata/fwd_tcp_tc.tpkg b/testdata/fwd_tcp_tc.tpkg deleted file mode 100644 index 3f2c42338..000000000 Binary files a/testdata/fwd_tcp_tc.tpkg and /dev/null differ diff --git a/testdata/fwd_tcp_tc6.tpkg b/testdata/fwd_tcp_tc6.tpkg deleted file mode 100644 index 443482018..000000000 Binary files a/testdata/fwd_tcp_tc6.tpkg and /dev/null differ diff --git a/testdata/fwd_three.tpkg b/testdata/fwd_three.tpkg deleted file mode 100644 index 24771698d..000000000 Binary files a/testdata/fwd_three.tpkg and /dev/null differ diff --git a/testdata/fwd_three_service.tpkg b/testdata/fwd_three_service.tpkg deleted file mode 100644 index 949cdcefa..000000000 Binary files a/testdata/fwd_three_service.tpkg and /dev/null differ diff --git a/testdata/fwd_ttlexpire.tpkg b/testdata/fwd_ttlexpire.tpkg deleted file mode 100644 index 1111d8e52..000000000 Binary files a/testdata/fwd_ttlexpire.tpkg and /dev/null differ diff --git a/testdata/fwd_udp.tpkg b/testdata/fwd_udp.tpkg deleted file mode 100644 index 4fd674699..000000000 Binary files a/testdata/fwd_udp.tpkg and /dev/null differ diff --git a/testdata/fwd_udptmout.tpkg b/testdata/fwd_udptmout.tpkg deleted file mode 100644 index 0c4763200..000000000 Binary files a/testdata/fwd_udptmout.tpkg and /dev/null differ diff --git a/testdata/fwd_waitudp.tpkg b/testdata/fwd_waitudp.tpkg deleted file mode 100644 index db3cd8ea6..000000000 Binary files a/testdata/fwd_waitudp.tpkg and /dev/null differ diff --git a/testdata/fwd_zero.tpkg b/testdata/fwd_zero.tpkg deleted file mode 100644 index bff17baa9..000000000 Binary files a/testdata/fwd_zero.tpkg and /dev/null differ diff --git a/testdata/hostsfileosx.tpkg b/testdata/hostsfileosx.tpkg deleted file mode 100644 index 05ab7c233..000000000 Binary files a/testdata/hostsfileosx.tpkg and /dev/null differ diff --git a/testdata/local_nodefault.tpkg b/testdata/local_nodefault.tpkg deleted file mode 100644 index 5f9dc441a..000000000 Binary files a/testdata/local_nodefault.tpkg and /dev/null differ diff --git a/testdata/local_norec.tpkg b/testdata/local_norec.tpkg deleted file mode 100644 index 2258695d8..000000000 Binary files a/testdata/local_norec.tpkg and /dev/null differ diff --git a/testdata/local_nosnoop.tpkg b/testdata/local_nosnoop.tpkg deleted file mode 100644 index 23765b298..000000000 Binary files a/testdata/local_nosnoop.tpkg and /dev/null differ diff --git a/testdata/nss_compile.tpkg b/testdata/nss_compile.tpkg deleted file mode 100644 index d6412017c..000000000 Binary files a/testdata/nss_compile.tpkg and /dev/null differ diff --git a/testdata/pylib.tpkg b/testdata/pylib.tpkg deleted file mode 100644 index 202595c15..000000000 Binary files a/testdata/pylib.tpkg and /dev/null differ diff --git a/testdata/pymod.tpkg b/testdata/pymod.tpkg deleted file mode 100644 index 164a82a00..000000000 Binary files a/testdata/pymod.tpkg and /dev/null differ diff --git a/testdata/pymod_thread.tpkg b/testdata/pymod_thread.tpkg deleted file mode 100644 index 96d5d9b39..000000000 Binary files a/testdata/pymod_thread.tpkg and /dev/null differ diff --git a/testdata/remote-threaded.tpkg b/testdata/remote-threaded.tpkg deleted file mode 100644 index 0e614d87a..000000000 Binary files a/testdata/remote-threaded.tpkg and /dev/null differ diff --git a/testdata/root_anchor.tpkg b/testdata/root_anchor.tpkg deleted file mode 100644 index 98aa57e52..000000000 Binary files a/testdata/root_anchor.tpkg and /dev/null differ diff --git a/testdata/root_hints.tpkg b/testdata/root_hints.tpkg deleted file mode 100644 index 9c83fc32d..000000000 Binary files a/testdata/root_hints.tpkg and /dev/null differ diff --git a/testdata/speed_cache.tpkg b/testdata/speed_cache.tpkg deleted file mode 100644 index bade5288b..000000000 Binary files a/testdata/speed_cache.tpkg and /dev/null differ diff --git a/testdata/speed_local.tpkg b/testdata/speed_local.tpkg deleted file mode 100644 index 572f60cf1..000000000 Binary files a/testdata/speed_local.tpkg and /dev/null differ diff --git a/testdata/stat_timer.tpkg b/testdata/stat_timer.tpkg deleted file mode 100644 index 982e69882..000000000 Binary files a/testdata/stat_timer.tpkg and /dev/null differ diff --git a/testdata/stream_ssl.tpkg b/testdata/stream_ssl.tpkg deleted file mode 100644 index cf734d4d7..000000000 Binary files a/testdata/stream_ssl.tpkg and /dev/null differ diff --git a/testdata/stream_tcp.tpkg b/testdata/stream_tcp.tpkg deleted file mode 100644 index 9cc58912e..000000000 Binary files a/testdata/stream_tcp.tpkg and /dev/null differ diff --git a/testdata/stub_udp.tpkg b/testdata/stub_udp.tpkg deleted file mode 100644 index 9a4757d60..000000000 Binary files a/testdata/stub_udp.tpkg and /dev/null differ diff --git a/testdata/stub_udp6.tpkg b/testdata/stub_udp6.tpkg deleted file mode 100644 index c5e7ffe9d..000000000 Binary files a/testdata/stub_udp6.tpkg and /dev/null differ diff --git a/testdata/tcp_sigpipe.tpkg b/testdata/tcp_sigpipe.tpkg deleted file mode 100644 index 4d6dee4d4..000000000 Binary files a/testdata/tcp_sigpipe.tpkg and /dev/null differ