mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-18 10:09:27 -05:00
- Fix tests to use .tdir (from Manu Bretelle) instead of .tpkg.
git-svn-id: file:///svn/unbound/trunk@4263 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
522bff52fe
commit
ead37db595
66 changed files with 157 additions and 29 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
127
testcode/mini_tdir.sh
Executable file
127
testcode/mini_tdir.sh
Executable file
|
|
@ -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 <file>"
|
||||
echo " tdir fake <file>"
|
||||
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
|
||||
|
|
@ -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/
|
||||
|
|
|
|||
BIN
testdata/00-lint.tpkg
vendored
BIN
testdata/00-lint.tpkg
vendored
Binary file not shown.
BIN
testdata/01-doc.tpkg
vendored
BIN
testdata/01-doc.tpkg
vendored
Binary file not shown.
BIN
testdata/02-unittest.tpkg
vendored
BIN
testdata/02-unittest.tpkg
vendored
Binary file not shown.
BIN
testdata/03-testbound.tpkg
vendored
BIN
testdata/03-testbound.tpkg
vendored
Binary file not shown.
BIN
testdata/04-checkconf.tpkg
vendored
BIN
testdata/04-checkconf.tpkg
vendored
Binary file not shown.
BIN
testdata/05-asynclook.tpkg
vendored
BIN
testdata/05-asynclook.tpkg
vendored
Binary file not shown.
BIN
testdata/06-ianaports.tpkg
vendored
BIN
testdata/06-ianaports.tpkg
vendored
Binary file not shown.
BIN
testdata/07-confroot.tpkg
vendored
BIN
testdata/07-confroot.tpkg
vendored
Binary file not shown.
BIN
testdata/08-host-lib.tpkg
vendored
BIN
testdata/08-host-lib.tpkg
vendored
Binary file not shown.
BIN
testdata/09-unbound-control.tpkg
vendored
BIN
testdata/09-unbound-control.tpkg
vendored
Binary file not shown.
BIN
testdata/10-unbound-anchor.tpkg
vendored
BIN
testdata/10-unbound-anchor.tpkg
vendored
Binary file not shown.
2
testdata/common.sh
vendored
2
testdata/common.sh
vendored
|
|
@ -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:
|
||||
|
|
|
|||
BIN
testdata/ctrl_itr.tpkg
vendored
BIN
testdata/ctrl_itr.tpkg
vendored
Binary file not shown.
BIN
testdata/ctrl_pipe.tpkg
vendored
BIN
testdata/ctrl_pipe.tpkg
vendored
Binary file not shown.
BIN
testdata/dnscrypt_cert.tpkg
vendored
BIN
testdata/dnscrypt_cert.tpkg
vendored
Binary file not shown.
BIN
testdata/dnscrypt_cert_chacha.tpkg
vendored
BIN
testdata/dnscrypt_cert_chacha.tpkg
vendored
Binary file not shown.
BIN
testdata/dnscrypt_queries.tpkg
vendored
BIN
testdata/dnscrypt_queries.tpkg
vendored
Binary file not shown.
BIN
testdata/dnscrypt_queries_chacha.tpkg
vendored
BIN
testdata/dnscrypt_queries_chacha.tpkg
vendored
Binary file not shown.
BIN
testdata/edns_cache.tpkg
vendored
BIN
testdata/edns_cache.tpkg
vendored
Binary file not shown.
BIN
testdata/edns_lame.tpkg
vendored
BIN
testdata/edns_lame.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_ancil.tpkg
vendored
BIN
testdata/fwd_ancil.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_bogus.tpkg
vendored
BIN
testdata/fwd_bogus.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_capsid.tpkg
vendored
BIN
testdata/fwd_capsid.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_capsid_fallback.tpkg
vendored
BIN
testdata/fwd_capsid_fallback.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_capsid_strip.tpkg
vendored
BIN
testdata/fwd_capsid_strip.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_capsid_white.tpkg
vendored
BIN
testdata/fwd_capsid_white.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_compress_c00c.tpkg
vendored
BIN
testdata/fwd_compress_c00c.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_edns_bksec.tpkg
vendored
BIN
testdata/fwd_edns_bksec.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_edns_probe.tpkg
vendored
BIN
testdata/fwd_edns_probe.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_malformed.tpkg
vendored
BIN
testdata/fwd_malformed.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_no_edns.tpkg
vendored
BIN
testdata/fwd_no_edns.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_oneport.tpkg
vendored
BIN
testdata/fwd_oneport.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_tcp.tpkg
vendored
BIN
testdata/fwd_tcp.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_tcp_tc.tpkg
vendored
BIN
testdata/fwd_tcp_tc.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_tcp_tc6.tpkg
vendored
BIN
testdata/fwd_tcp_tc6.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_three.tpkg
vendored
BIN
testdata/fwd_three.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_three_service.tpkg
vendored
BIN
testdata/fwd_three_service.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_ttlexpire.tpkg
vendored
BIN
testdata/fwd_ttlexpire.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_udp.tpkg
vendored
BIN
testdata/fwd_udp.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_udptmout.tpkg
vendored
BIN
testdata/fwd_udptmout.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_waitudp.tpkg
vendored
BIN
testdata/fwd_waitudp.tpkg
vendored
Binary file not shown.
BIN
testdata/fwd_zero.tpkg
vendored
BIN
testdata/fwd_zero.tpkg
vendored
Binary file not shown.
BIN
testdata/hostsfileosx.tpkg
vendored
BIN
testdata/hostsfileosx.tpkg
vendored
Binary file not shown.
BIN
testdata/local_nodefault.tpkg
vendored
BIN
testdata/local_nodefault.tpkg
vendored
Binary file not shown.
BIN
testdata/local_norec.tpkg
vendored
BIN
testdata/local_norec.tpkg
vendored
Binary file not shown.
BIN
testdata/local_nosnoop.tpkg
vendored
BIN
testdata/local_nosnoop.tpkg
vendored
Binary file not shown.
BIN
testdata/nss_compile.tpkg
vendored
BIN
testdata/nss_compile.tpkg
vendored
Binary file not shown.
BIN
testdata/pylib.tpkg
vendored
BIN
testdata/pylib.tpkg
vendored
Binary file not shown.
BIN
testdata/pymod.tpkg
vendored
BIN
testdata/pymod.tpkg
vendored
Binary file not shown.
BIN
testdata/pymod_thread.tpkg
vendored
BIN
testdata/pymod_thread.tpkg
vendored
Binary file not shown.
BIN
testdata/remote-threaded.tpkg
vendored
BIN
testdata/remote-threaded.tpkg
vendored
Binary file not shown.
BIN
testdata/root_anchor.tpkg
vendored
BIN
testdata/root_anchor.tpkg
vendored
Binary file not shown.
BIN
testdata/root_hints.tpkg
vendored
BIN
testdata/root_hints.tpkg
vendored
Binary file not shown.
BIN
testdata/speed_cache.tpkg
vendored
BIN
testdata/speed_cache.tpkg
vendored
Binary file not shown.
BIN
testdata/speed_local.tpkg
vendored
BIN
testdata/speed_local.tpkg
vendored
Binary file not shown.
BIN
testdata/stat_timer.tpkg
vendored
BIN
testdata/stat_timer.tpkg
vendored
Binary file not shown.
BIN
testdata/stream_ssl.tpkg
vendored
BIN
testdata/stream_ssl.tpkg
vendored
Binary file not shown.
BIN
testdata/stream_tcp.tpkg
vendored
BIN
testdata/stream_tcp.tpkg
vendored
Binary file not shown.
BIN
testdata/stub_udp.tpkg
vendored
BIN
testdata/stub_udp.tpkg
vendored
Binary file not shown.
BIN
testdata/stub_udp6.tpkg
vendored
BIN
testdata/stub_udp6.tpkg
vendored
Binary file not shown.
BIN
testdata/tcp_sigpipe.tpkg
vendored
BIN
testdata/tcp_sigpipe.tpkg
vendored
Binary file not shown.
Loading…
Reference in a new issue