summaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2024-03-16 23:58:33 +0000
committerCy Schubert <cy@FreeBSD.org>2024-03-17 00:00:52 +0000
commit5a33598e88ad8fbc0affa74dee0a2d8cc4010fbc (patch)
tree211c17b0e7eeb34cdd84e378e3720514e8987b8c /testdata
parent217a625642d38bfc0d3d03192b013d4bc7a32458 (diff)
Diffstat (limited to 'testdata')
-rw-r--r--testdata/01-doc.tdir/01-doc.test26
-rw-r--r--testdata/auth_axfr.tdir/auth_axfr.test14
-rw-r--r--testdata/auth_https.tdir/auth_https.test14
-rw-r--r--testdata/blanks_cached_zone.tdir/blanks_cached_zone.test14
-rw-r--r--testdata/blanks_https.tdir/blanks_https.test14
-rw-r--r--testdata/cachedb_no_store.tdir/cachedb_no_store.post2
-rw-r--r--testdata/cachedb_no_store.tdir/cachedb_no_store.test14
-rw-r--r--testdata/common.sh128
-rw-r--r--testdata/fwd_ancil.tdir/fwd_ancil.post4
-rw-r--r--testdata/fwd_ancil.tdir/fwd_ancil.pre2
-rw-r--r--testdata/fwd_ancil.tdir/fwd_ancil.test2
-rw-r--r--testdata/fwd_bogus.tdir/fwd_bogus.test2
-rw-r--r--testdata/fwd_capsid.tdir/fwd_capsid.test2
-rw-r--r--testdata/fwd_capsid_fallback.tdir/fwd_capsid_fallback.test2
-rw-r--r--testdata/fwd_capsid_strip.tdir/fwd_capsid_strip.test2
-rw-r--r--testdata/fwd_capsid_white.tdir/fwd_capsid_white.test2
-rw-r--r--testdata/fwd_edns_bksec.tdir/fwd_edns_bksec.test4
-rw-r--r--testdata/fwd_edns_probe.tdir/fwd_edns_probe.test4
-rw-r--r--testdata/fwd_malformed.tdir/fwd_malformed.test2
-rw-r--r--testdata/fwd_no_edns.tdir/fwd_no_edns.test2
-rw-r--r--testdata/fwd_oneport.tdir/fwd_oneport.post2
-rw-r--r--testdata/fwd_oneport.tdir/fwd_oneport.test14
-rw-r--r--testdata/fwd_tcp.tdir/fwd_tcp.test2
-rw-r--r--testdata/fwd_tcp_tc.tdir/fwd_tcp_tc.test2
-rw-r--r--testdata/fwd_three.tdir/fwd_three.post2
-rw-r--r--testdata/fwd_three.tdir/fwd_three.test8
-rw-r--r--testdata/fwd_three_service.tdir/fwd_three_service.post2
-rw-r--r--testdata/fwd_three_service.tdir/fwd_three_service.test8
-rw-r--r--testdata/fwd_ttlexpire.tdir/fwd_ttlexpire.test4
-rw-r--r--testdata/fwd_udp.tdir/fwd_udp.test2
-rw-r--r--testdata/fwd_udp_with_tcp_upstream.tdir/fwd_udp_with_tcp_upstream.test4
-rw-r--r--testdata/fwd_udptmout.tdir/fwd_udptmout.post2
-rw-r--r--testdata/fwd_udptmout.tdir/fwd_udptmout.test14
-rw-r--r--testdata/fwd_waitudp.tdir/fwd_waitudp.post2
-rw-r--r--testdata/fwd_waitudp.tdir/fwd_waitudp.test8
-rw-r--r--testdata/fwd_zero.tdir/fwd_zero.test2
-rw-r--r--testdata/http_user_agent.tdir/http_user_agent.test14
-rw-r--r--testdata/iter_cname_minimise_nx.rpl1
-rw-r--r--testdata/iter_dname_insec.rpl20
-rw-r--r--testdata/iter_dname_ttl.rpl310
-rw-r--r--testdata/iter_dname_yx.rpl699
-rw-r--r--testdata/iter_ghost_sub.rpl2
-rw-r--r--testdata/iter_scrub_dname_insec.rpl4
-rw-r--r--testdata/local_cname.rpl36
-rw-r--r--testdata/local_nodefault.tdir/local_nodefault.test6
-rw-r--r--testdata/local_norec.tdir/local_norec.test8
-rw-r--r--testdata/local_nosnoop.tdir/local_nosnoop.test8
-rw-r--r--testdata/padding.tdir/padding.post4
-rw-r--r--testdata/padding.tdir/padding.test25
-rw-r--r--testdata/pymod.tdir/pymod.test4
-rw-r--r--testdata/pymod_thread.tdir/pymod_thread.test20
-rw-r--r--testdata/root_zonemd.tdir/root_zonemd.test32
-rw-r--r--testdata/rrset_use_cached.rpl151
-rw-r--r--testdata/serve_expired_0ttl_nodata.rpl2
-rw-r--r--testdata/serve_expired_0ttl_nxdomain.rpl2
-rw-r--r--testdata/serve_expired_0ttl_servfail.rpl2
-rw-r--r--testdata/serve_expired_cached_servfail.rpl2
-rw-r--r--testdata/serve_expired_cached_servfail_refresh.rpl2
-rw-r--r--testdata/serve_expired_client_timeout_servfail.rpl2
-rw-r--r--testdata/stat_timer.tdir/stat_timer.test2
-rw-r--r--testdata/stat_values.tdir/stat_values.test4
-rw-r--r--testdata/stub_auth_tc.tdir/stub_auth_tc.test2
-rw-r--r--testdata/subnet_scopezero_noedns.crpl441
-rw-r--r--testdata/tcp_reuse.tdir/tcp_reuse.post4
-rw-r--r--testdata/tls_reuse.tdir/tls_reuse.post4
-rw-r--r--testdata/val_cnametocnamewctoposwc.rpl2
-rw-r--r--testdata/val_cnametodnametocnametopos.rpl4
-rw-r--r--testdata/val_dnametopos.rpl4
-rw-r--r--testdata/val_dnametoposwc.rpl4
-rw-r--r--testdata/val_nsec3_cnametocnamewctoposwc.rpl2
-rw-r--r--testdata/zonemd_reload.tdir/zonemd_reload.test14
71 files changed, 1262 insertions, 915 deletions
diff --git a/testdata/01-doc.tdir/01-doc.test b/testdata/01-doc.tdir/01-doc.test
index 484b0be42e43..904672bd02de 100644
--- a/testdata/01-doc.tdir/01-doc.test
+++ b/testdata/01-doc.tdir/01-doc.test
@@ -24,21 +24,21 @@ fi
(cd $PRE; find . -name "*.h" -print) >hlist
(cd $PRE; find . -name "*.c" -print) >>hlist
# filter out config.h
-fgrep -v -e "config.h" hlist > ilist; mv ilist hlist
-fgrep -v -e "util/configparser" hlist > ilist; mv ilist hlist
-fgrep -v -e "util/configlexer" hlist > ilist; mv ilist hlist
-fgrep -v -e "util/configyyrename" hlist > ilist; mv ilist hlist
-fgrep -v -e "util/locks.h" hlist > ilist; mv ilist hlist
-fgrep -v -e "util/storage/lookup3.c" hlist > ilist; mv ilist hlist
-fgrep -v -e "ldns-src/" hlist > ilist; mv ilist hlist
-fgrep -v -e "libunbound/python/libunbound_wrap.c" hlist > ilist; mv ilist hlist
-fgrep -v -e "pythonmod/interface.h" hlist > ilist; mv ilist hlist
-fgrep -v -e "dnstap" hlist > ilist; mv ilist hlist
-fgrep -v -e "util/siphash.c" hlist > ilist; mv ilist hlist
+grep -F -v -e "config.h" hlist > ilist; mv ilist hlist
+grep -F -v -e "util/configparser" hlist > ilist; mv ilist hlist
+grep -F -v -e "util/configlexer" hlist > ilist; mv ilist hlist
+grep -F -v -e "util/configyyrename" hlist > ilist; mv ilist hlist
+grep -F -v -e "util/locks.h" hlist > ilist; mv ilist hlist
+grep -F -v -e "util/storage/lookup3.c" hlist > ilist; mv ilist hlist
+grep -F -v -e "ldns-src/" hlist > ilist; mv ilist hlist
+grep -F -v -e "libunbound/python/libunbound_wrap.c" hlist > ilist; mv ilist hlist
+grep -F -v -e "pythonmod/interface.h" hlist > ilist; mv ilist hlist
+grep -F -v -e "dnstap" hlist > ilist; mv ilist hlist
+grep -F -v -e "util/siphash.c" hlist > ilist; mv ilist hlist
# filter out compat
-fgrep -v -e "compat/" hlist > ilist; mv ilist hlist
+grep -F -v -e "compat/" hlist > ilist; mv ilist hlist
for h in `cat hlist`; do
- if fgrep "`basename $h`" $PRE/doc/html/files.html >/dev/null; then
+ if grep -F "`basename $h`" $PRE/doc/html/files.html >/dev/null; then
: # ok
else
echo "Warning: $h has no documentation."
diff --git a/testdata/auth_axfr.tdir/auth_axfr.test b/testdata/auth_axfr.tdir/auth_axfr.test
index f9171eea0728..39b9f97424ce 100644
--- a/testdata/auth_axfr.tdir/auth_axfr.test
+++ b/testdata/auth_axfr.tdir/auth_axfr.test
@@ -7,35 +7,35 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> cat logfiles"
cat fwd.log
diff --git a/testdata/auth_https.tdir/auth_https.test b/testdata/auth_https.tdir/auth_https.test
index c2471b7d6439..a99be1a7ae5d 100644
--- a/testdata/auth_https.tdir/auth_https.test
+++ b/testdata/auth_https.tdir/auth_https.test
@@ -8,35 +8,35 @@ PRE="../.."
. ../common.sh
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> cat logfiles"
cat petal.log
diff --git a/testdata/blanks_cached_zone.tdir/blanks_cached_zone.test b/testdata/blanks_cached_zone.tdir/blanks_cached_zone.test
index c405950c3794..580cd22b3fed 100644
--- a/testdata/blanks_cached_zone.tdir/blanks_cached_zone.test
+++ b/testdata/blanks_cached_zone.tdir/blanks_cached_zone.test
@@ -8,35 +8,35 @@ PRE="../.."
# do the test
TARGET=ns1.blanks.example.com.
echo "> dig $TARGET"
-dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
echo "> cat logfiles"
cat unbound.log
diff --git a/testdata/blanks_https.tdir/blanks_https.test b/testdata/blanks_https.tdir/blanks_https.test
index 2c4c5dc7a473..7e0ac89364d1 100644
--- a/testdata/blanks_https.tdir/blanks_https.test
+++ b/testdata/blanks_https.tdir/blanks_https.test
@@ -8,35 +8,35 @@ PRE="../.."
# do the test
TARGET=ns1.blanks.example.com.
echo "> dig $TARGET"
-dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
echo "> cat logfiles"
cat petal.log
diff --git a/testdata/cachedb_no_store.tdir/cachedb_no_store.post b/testdata/cachedb_no_store.tdir/cachedb_no_store.post
index 901f01a8753d..320dcc3e3e3b 100644
--- a/testdata/cachedb_no_store.tdir/cachedb_no_store.post
+++ b/testdata/cachedb_no_store.tdir/cachedb_no_store.post
@@ -16,5 +16,5 @@ if test -f fwd4.log; then cat fwd4.log; else echo "no fwd4.log"; fi
cat unbound.log
if test -f unbound2.log; then cat unbound2.log; else echo "no unbound2.log"; fi
kill_pid $FWD_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
rm -f $CONTROL_PATH/controlpipe.$CONTROL_PID
diff --git a/testdata/cachedb_no_store.tdir/cachedb_no_store.test b/testdata/cachedb_no_store.tdir/cachedb_no_store.test
index 352026844776..47a89656c6c2 100644
--- a/testdata/cachedb_no_store.tdir/cachedb_no_store.test
+++ b/testdata/cachedb_no_store.tdir/cachedb_no_store.test
@@ -13,7 +13,7 @@ get_ldns_testns
# query for a text record that is stored by unbound's cache and cachedb
# in the testframe cache.
echo "> dig txt1.example.com."
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
@@ -31,7 +31,7 @@ echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
wait_ldns_testns_up fwd2.log
echo "> dig txt1.example.com. from unbound cache"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
@@ -50,7 +50,7 @@ else
fi
echo "> dig txt1.example.com. from cachedb"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
@@ -69,7 +69,7 @@ wait_ldns_testns_up fwd3.log
# stop unbound to flush the cachedb cache
echo "> stop unbound"
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
echo ""
echo "> config unbound with cachedb-no-store: yes"
@@ -84,7 +84,7 @@ wait_unbound_up unbound2.log
echo ""
echo "> dig txt1.example.com."
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
@@ -102,7 +102,7 @@ echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
wait_ldns_testns_up fwd4.log
echo "> dig txt1.example.com. from unbound cache"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
@@ -121,7 +121,7 @@ else
fi
echo "> dig txt1.example.com. from cachedb, but that has no message stored"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "SERVFAIL" outfile; then
echo "OK"
else
diff --git a/testdata/common.sh b/testdata/common.sh
index b0e66f8dfa7f..bf2d301eb815 100644
--- a/testdata/common.sh
+++ b/testdata/common.sh
@@ -1,7 +1,12 @@
# common.sh - an include file for commonly used functions for test code.
# BSD licensed (see LICENSE file).
#
-# Version 3
+# Version 6
+# 2023-12-06: list wait_for_soa_serial in overview
+# 2023-12-06: get_ldns_notify, skip_test and teststep, and previous changes
+# also included are wait_logfile, cpu_count, process_cpu_list, and
+# kill_from_pidfile, and use HOME variable for HOME/bin.
+# 2011-04-06: tpk wait_logfile to wait (with timeout) for a logfile line to appear
# 2011-02-23: get_pcat for PCAT, PCAT_DIFF and PCAT_PRINT defines.
# 2011-02-18: ports check on BSD,Solaris. wait_nsd_up.
# 2011-02-11: first version.
@@ -21,14 +26,19 @@
# set_doxygen_path : set doxygen path
# skip_if_in_list : set SKIP=1 if name in list and tool not available.
# get_random_port x : get RND_PORT a sequence of free random port numbers.
+# wait_logfile : wait on logfile to see entry.
# wait_server_up : wait on logfile to see when server comes up.
# wait_ldns_testns_up : wait for ldns-testns to come up.
# wait_unbound_up : wait for unbound to come up.
# wait_petal_up : wait for petal to come up.
# wait_nsd_up : wait for nsd to come up.
# wait_server_up_or_fail: wait for server to come up or print a failure string
+# wait_for_soa_serial : wait and dig at server for serial.
# skip_test x : print message and skip test (must be called in .pre)
# kill_pid : kill a server, make sure and wait for it to go down.
+# cpu_count : get number of cpus in system
+# process_cpu_list : get cpu affinity list for process
+# kill_from_pidfile : kill the pid in the given pid file
# teststep : print the current test step in the output
@@ -61,7 +71,7 @@ get_ldns_testns () {
if test -x "`which ldns-testns 2>&1`"; then
LDNS_TESTNS=ldns-testns
else
- LDNS_TESTNS=/home/wouter/bin/ldns-testns
+ LDNS_TESTNS=$HOME/bin/ldns-testns
fi
}
@@ -70,7 +80,7 @@ get_ldns_notify () {
if test -x "`which ldns-notify 2>&1`"; then
LDNS_NOTIFY=ldns-notify
else
- LDNS_NOTIFY=/home/wouter/bin/ldns-notify
+ LDNS_NOTIFY=$HOME/bin/ldns-notify
fi
}
@@ -160,16 +170,42 @@ get_random_port () {
done
}
+# wait for a logfile line to appear, with a timeout.
+# pass <logfilename> <string to watch> <timeout>
+# $1 : logfilename
+# $2 : string to watch for.
+# $3 : timeout in seconds.
+# exits with failure if it times out
+wait_logfile () {
+ local WAIT_THRES=30
+ local MAX_UP_TRY=`expr $3 + $WAIT_THRES`
+ local try
+ for (( try=0 ; try <= $MAX_UP_TRY ; try++ )) ; do
+ if test -f $1 && grep -F "$2" $1 >/dev/null; then
+ #echo "done on try $try"
+ break;
+ fi
+ if test $try -eq $MAX_UP_TRY; then
+ echo "Logfile in $1 did not get $2!"
+ cat $1
+ exit 1;
+ fi
+ if test $try -ge $WAIT_THRES; then
+ sleep 1
+ fi
+ done
+}
+
# wait for server to go up, pass <logfilename> <string to watch>
# $1 : logfilename
# $2 : string to watch for.
# exits with failure if it does not come up
wait_server_up () {
- local MAX_UP_TRY=120
local WAIT_THRES=30
+ local MAX_UP_TRY=120
local try
for (( try=0 ; try <= $MAX_UP_TRY ; try++ )) ; do
- if test -f $1 && fgrep "$2" $1 >/dev/null; then
+ if test -f $1 && grep -F "$2" $1 >/dev/null; then
#echo "done on try $try"
break;
fi
@@ -220,11 +256,11 @@ wait_server_up_or_fail () {
local WAIT_THRES=30
local try
for (( try=0 ; try <= $MAX_UP_TRY ; try++ )) ; do
- if test -f $1 && fgrep "$2" $1 >/dev/null; then
+ if test -f $1 && grep -F "$2" $1 >/dev/null; then
echo "done on try $try"
break;
fi
- if test -f $1 && fgrep "$3" $1 >/dev/null; then
+ if test -f $1 && grep -F "$3" $1 >/dev/null; then
echo "failed on try $try"
break;
fi
@@ -239,6 +275,33 @@ wait_server_up_or_fail () {
done
}
+# $1: zone
+# $2: serial to be expected
+# $3: server to query
+# $4: port
+# $5: # times to try (# seconds dig is ran)
+wait_for_soa_serial () {
+ TS_START=`date +%s`
+ for i in `seq 1 $5`
+ do
+ SERIAL=`dig -p $4 @$3 $1 SOA +short | awk '{ print $3 }'`
+ if test "$?" != "0"
+ then
+ echo "** \"dig -p $4 @$3 $1 SOA +short\" failed!"
+ return 1
+ fi
+ if test "$SERIAL" = "$2"
+ then
+ TS_END=`date +%s`
+ echo "*** Serial $2 was seen in $i tries (`expr $TS_END - $TS_START`) seconds"
+ return 0
+ fi
+ sleep 1
+ done
+ echo "** Serial $2 was not seen in $5 tries (did see: $SERIAL)"
+ return 1
+}
+
# kill a pid, make sure and wait for it to go down.
# $1 : pid to kill
kill_pid () {
@@ -268,11 +331,58 @@ kill_pid () {
# set doxygen path, so that make doc can find doxygen
set_doxygen_path () {
- if test -x '/home/wouter/bin/doxygen'; then
- export PATH="/home/wouter/bin:$PATH"
+ if test -x '$HOME/bin/doxygen'; then
+ export PATH="$HOME/bin:$PATH"
fi
}
+# get number of cpus in system
+cpu_count()
+{
+ local sys=$(uname -s)
+ if [ "${sys}" = "Linux" ]; then
+ nproc
+ elif [ "${sys}" = "FreeBSD" ]; then
+ sysctl -n hw.ncpu
+ fi
+}
+
+# get cpu affinity list for process
+# $1 : pid
+process_cpu_list() {
+ local pid=${1}
+ local sys=$(uname -s)
+
+ if [ "${sys}" = "Linux" ]; then
+ local defl=$(taskset -pc ${pid} | sed -n -e 's/^.*: //p' | head -n 1)
+ elif [ "${sys}" = "FreeBSD" ]; then
+ local defl=$(cpuset -g -p ${pid} | sed -n -e 's/^.*: //p' | head -n 1)
+ fi
+
+ if [ -n "${defl}" ]; then
+ local infl
+ defl=$(echo "${defl}" | sed -e 's/,/ /g')
+ for i in ${defl}; do
+ rng=$(echo "${i}-${i}" | sed -e 's/^\([0-9]*\)-\([0-9]*\).*$/\1 \2/')
+ infl="${infl} $(seq -s ' ' ${rng})"
+ done
+ infl=$(echo ${infl} | sed -e 's/ */ /' -e 's/^ *//')
+ echo "${infl}"
+ fi
+}
+
+#
+#
+kill_from_pidfile() {
+ local pidfile="$1"
+ if test -f "$pidfile"; then
+ local pid=`head -n 1 "$pidfile"`
+ if test ! -z "$pid"; then
+ kill_pid "$pid"
+ fi
+ fi
+}
+
# Print the current test step in the output
teststep () {
echo
diff --git a/testdata/fwd_ancil.tdir/fwd_ancil.post b/testdata/fwd_ancil.tdir/fwd_ancil.post
index c11bd44cd8a0..6bb5f2ecc6fb 100644
--- a/testdata/fwd_ancil.tdir/fwd_ancil.post
+++ b/testdata/fwd_ancil.tdir/fwd_ancil.post
@@ -7,10 +7,10 @@
# do your teardown here
. ../common.sh
kill_pid $FWD_PID
-if fgrep "service stopped" unbound.log; then
+if grep -F "service stopped" unbound.log; then
exit 0
fi
-if fgrep "disable interface-automatic" unbound.log; then
+if grep -F "disable interface-automatic" unbound.log; then
echo "skip test"
exit 0
fi
diff --git a/testdata/fwd_ancil.tdir/fwd_ancil.pre b/testdata/fwd_ancil.tdir/fwd_ancil.pre
index 6c0fb7a0b234..ceede1afed99 100644
--- a/testdata/fwd_ancil.tdir/fwd_ancil.pre
+++ b/testdata/fwd_ancil.tdir/fwd_ancil.pre
@@ -36,7 +36,7 @@ wait_ldns_testns_up fwd.log
# wait for unbound to come up
# 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
+if grep -F "disable interface-automatic" unbound.log; then
skip_test "skip test"
fi
diff --git a/testdata/fwd_ancil.tdir/fwd_ancil.test b/testdata/fwd_ancil.tdir/fwd_ancil.test
index 8da4754ce0ac..b5d063aa0184 100644
--- a/testdata/fwd_ancil.tdir/fwd_ancil.test
+++ b/testdata/fwd_ancil.tdir/fwd_ancil.test
@@ -7,7 +7,7 @@
PRE="../.."
. ../common.sh
-if fgrep "disable interface-automatic" unbound.log; then
+if grep -F "disable interface-automatic" unbound.log; then
echo "skip test"
exit 0
fi
diff --git a/testdata/fwd_bogus.tdir/fwd_bogus.test b/testdata/fwd_bogus.tdir/fwd_bogus.test
index 743b4e66a694..c0c38bb25f09 100644
--- a/testdata/fwd_bogus.tdir/fwd_bogus.test
+++ b/testdata/fwd_bogus.tdir/fwd_bogus.test
@@ -8,7 +8,7 @@ PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_capsid.tdir/fwd_capsid.test b/testdata/fwd_capsid.tdir/fwd_capsid.test
index 8b49691e5fd5..79dc997f9943 100644
--- a/testdata/fwd_capsid.tdir/fwd_capsid.test
+++ b/testdata/fwd_capsid.tdir/fwd_capsid.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_capsid_fallback.tdir/fwd_capsid_fallback.test b/testdata/fwd_capsid_fallback.tdir/fwd_capsid_fallback.test
index eba834f14dfd..b392a3958d88 100644
--- a/testdata/fwd_capsid_fallback.tdir/fwd_capsid_fallback.test
+++ b/testdata/fwd_capsid_fallback.tdir/fwd_capsid_fallback.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_capsid_strip.tdir/fwd_capsid_strip.test b/testdata/fwd_capsid_strip.tdir/fwd_capsid_strip.test
index a74f89f79af2..414ceb074ac2 100644
--- a/testdata/fwd_capsid_strip.tdir/fwd_capsid_strip.test
+++ b/testdata/fwd_capsid_strip.tdir/fwd_capsid_strip.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
echo "> cat logfiles"
cat fwd.log
cat fwd2.log
diff --git a/testdata/fwd_capsid_white.tdir/fwd_capsid_white.test b/testdata/fwd_capsid_white.tdir/fwd_capsid_white.test
index d287259e045b..d4dd9106d161 100644
--- a/testdata/fwd_capsid_white.tdir/fwd_capsid_white.test
+++ b/testdata/fwd_capsid_white.tdir/fwd_capsid_white.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
echo "> cat logfiles"
cat fwd.log
cat fwd2.log
diff --git a/testdata/fwd_edns_bksec.tdir/fwd_edns_bksec.test b/testdata/fwd_edns_bksec.tdir/fwd_edns_bksec.test
index 4acd01e88dd1..93bbef88d7da 100644
--- a/testdata/fwd_edns_bksec.tdir/fwd_edns_bksec.test
+++ b/testdata/fwd_edns_bksec.tdir/fwd_edns_bksec.test
@@ -10,7 +10,7 @@ PRE="../.."
# First the nasty name.
# The server should not have performed EDNS fallback and cached it.
echo "> dig nasty.example.com."
-dig @localhost -p $UNBOUND_PORT nasty.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT nasty.example.com. | tee outfile
# no answer possible for it.
echo "> check backed-off"
@@ -27,7 +27,7 @@ fi
# Then the www name.
# See if we can still get the EDNS data.
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_edns_probe.tdir/fwd_edns_probe.test b/testdata/fwd_edns_probe.tdir/fwd_edns_probe.test
index 225120421cb0..2e3ae1dc2a90 100644
--- a/testdata/fwd_edns_probe.tdir/fwd_edns_probe.test
+++ b/testdata/fwd_edns_probe.tdir/fwd_edns_probe.test
@@ -10,7 +10,7 @@ PRE="../.."
# First the nasty name.
# The server should not have performed EDNS fallback and cached it.
echo "> dig nasty.example.com."
-dig @localhost -p $UNBOUND_PORT nasty.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT nasty.example.com. | tee outfile
# no answer possible for it.
echo "> check no-answer"
@@ -27,7 +27,7 @@ fi
# Then the www name.
# See if we can still get the EDNS data.
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_malformed.tdir/fwd_malformed.test b/testdata/fwd_malformed.tdir/fwd_malformed.test
index 621605daeee8..8d6567bef3e8 100644
--- a/testdata/fwd_malformed.tdir/fwd_malformed.test
+++ b/testdata/fwd_malformed.tdir/fwd_malformed.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_no_edns.tdir/fwd_no_edns.test b/testdata/fwd_no_edns.tdir/fwd_no_edns.test
index bc209ea09c50..405d17b09dcb 100644
--- a/testdata/fwd_no_edns.tdir/fwd_no_edns.test
+++ b/testdata/fwd_no_edns.tdir/fwd_no_edns.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_oneport.tdir/fwd_oneport.post b/testdata/fwd_oneport.tdir/fwd_oneport.post
index 8aafab7ca9bd..11c96dbae683 100644
--- a/testdata/fwd_oneport.tdir/fwd_oneport.post
+++ b/testdata/fwd_oneport.tdir/fwd_oneport.post
@@ -9,7 +9,7 @@
kill_pid $FWD_PID
# find all extra forked testns and kill them.
-pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'`
+pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do
kill_pid $p
done
diff --git a/testdata/fwd_oneport.tdir/fwd_oneport.test b/testdata/fwd_oneport.tdir/fwd_oneport.test
index 59d5b016308e..930277112300 100644
--- a/testdata/fwd_oneport.tdir/fwd_oneport.test
+++ b/testdata/fwd_oneport.tdir/fwd_oneport.test
@@ -11,7 +11,7 @@ PRE="../.."
# so that all three queries get timeouts during the later test.
#
#echo "> dig www1.example.com."
-#dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+#dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
#echo "> cat logfiles"
#cat fwd.log
#cat unbound.log
@@ -24,17 +24,17 @@ PRE="../.."
#fi
echo "> do queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
-dig @localhost -p $UNBOUND_PORT www4.example.com. >outfile4 &
+dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. >outfile4 &
digpid4=$!
-dig @localhost -p $UNBOUND_PORT www5.example.com. >outfile5 &
+dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. >outfile5 &
digpid5=$!
-dig @localhost -p $UNBOUND_PORT www6.example.com. >outfile6 &
+dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. >outfile6 &
digpid6=$!
sleep 12
kill -9 $digpid1
diff --git a/testdata/fwd_tcp.tdir/fwd_tcp.test b/testdata/fwd_tcp.tdir/fwd_tcp.test
index 9ecc5df153e9..e887b50d257f 100644
--- a/testdata/fwd_tcp.tdir/fwd_tcp.test
+++ b/testdata/fwd_tcp.tdir/fwd_tcp.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost +vc -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 +vc -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_tcp_tc.tdir/fwd_tcp_tc.test b/testdata/fwd_tcp_tc.tdir/fwd_tcp_tc.test
index 1a8f9edc1e64..80f15e438b2d 100644
--- a/testdata/fwd_tcp_tc.tdir/fwd_tcp_tc.test
+++ b/testdata/fwd_tcp_tc.tdir/fwd_tcp_tc.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_three.tdir/fwd_three.post b/testdata/fwd_three.tdir/fwd_three.post
index 7b2971d625f6..00a92103cc62 100644
--- a/testdata/fwd_three.tdir/fwd_three.post
+++ b/testdata/fwd_three.tdir/fwd_three.post
@@ -11,7 +11,7 @@
kill_pid $FWD_PID
# find all extra forked testns and kill them.
-pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'`
+pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do
kill_pid $p
done
diff --git a/testdata/fwd_three.tdir/fwd_three.test b/testdata/fwd_three.tdir/fwd_three.test
index 962d0bf1c12b..b0c8b9af9186 100644
--- a/testdata/fwd_three.tdir/fwd_three.test
+++ b/testdata/fwd_three.tdir/fwd_three.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www1.example.com."
-dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -20,11 +20,11 @@ else
fi
echo "> do three queries"
-dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT +retry=10 +time=1 www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT +retry=10 +time=1 www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT +retry=10 +time=1 www3.example.com. >outfile3 &
digpid3=$!
sleep 5
kill -9 $digpid1
diff --git a/testdata/fwd_three_service.tdir/fwd_three_service.post b/testdata/fwd_three_service.tdir/fwd_three_service.post
index 1d7a8daaebe0..d4dec9bcd566 100644
--- a/testdata/fwd_three_service.tdir/fwd_three_service.post
+++ b/testdata/fwd_three_service.tdir/fwd_three_service.post
@@ -11,7 +11,7 @@
kill_pid $FWD_PID
# find all extra forked testns and kill them.
-pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'`
+pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do
kill_pid $p
done
diff --git a/testdata/fwd_three_service.tdir/fwd_three_service.test b/testdata/fwd_three_service.tdir/fwd_three_service.test
index 6c5e34a7c305..7262cb724cbe 100644
--- a/testdata/fwd_three_service.tdir/fwd_three_service.test
+++ b/testdata/fwd_three_service.tdir/fwd_three_service.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www1.example.com."
-dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -20,11 +20,11 @@ else
fi
echo "> do three queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
sleep 5
kill -9 $digpid1
diff --git a/testdata/fwd_ttlexpire.tdir/fwd_ttlexpire.test b/testdata/fwd_ttlexpire.tdir/fwd_ttlexpire.test
index 41ea3953ccb6..13a83e617c4c 100644
--- a/testdata/fwd_ttlexpire.tdir/fwd_ttlexpire.test
+++ b/testdata/fwd_ttlexpire.tdir/fwd_ttlexpire.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> check answer"
if grep "10.20.30.40" outfile; then
echo "OK"
@@ -20,7 +20,7 @@ sleep 4
# query again
rm outfile
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> check answer"
if grep "10.20.30.40" outfile; then
echo "OK"
diff --git a/testdata/fwd_udp.tdir/fwd_udp.test b/testdata/fwd_udp.tdir/fwd_udp.test
index 9bd37adb3a7a..837fe6c8806c 100644
--- a/testdata/fwd_udp.tdir/fwd_udp.test
+++ b/testdata/fwd_udp.tdir/fwd_udp.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_udp_with_tcp_upstream.tdir/fwd_udp_with_tcp_upstream.test b/testdata/fwd_udp_with_tcp_upstream.tdir/fwd_udp_with_tcp_upstream.test
index fad6497beb15..576e65a0d1fc 100644
--- a/testdata/fwd_udp_with_tcp_upstream.tdir/fwd_udp_with_tcp_upstream.test
+++ b/testdata/fwd_udp_with_tcp_upstream.tdir/fwd_udp_with_tcp_upstream.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig tcp.example.com."
-dig @localhost -p $UNBOUND_PORT tcp.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT tcp.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -20,7 +20,7 @@ else
fi
echo "> dig udp.example.com."
-dig @localhost -p $UNBOUND_PORT udp.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT udp.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/fwd_udptmout.tdir/fwd_udptmout.post b/testdata/fwd_udptmout.tdir/fwd_udptmout.post
index f2138b9ec8ac..b8d3cc8a308c 100644
--- a/testdata/fwd_udptmout.tdir/fwd_udptmout.post
+++ b/testdata/fwd_udptmout.tdir/fwd_udptmout.post
@@ -10,7 +10,7 @@
kill_pid $FWD_PID
# find all extra forked testns and kill them.
-pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'`
+pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do
kill_pid $p
done
diff --git a/testdata/fwd_udptmout.tdir/fwd_udptmout.test b/testdata/fwd_udptmout.tdir/fwd_udptmout.test
index 8d89961047bc..1f8feda357d5 100644
--- a/testdata/fwd_udptmout.tdir/fwd_udptmout.test
+++ b/testdata/fwd_udptmout.tdir/fwd_udptmout.test
@@ -11,7 +11,7 @@ PRE="../.."
# so that all three queries get timeouts during the later test.
#
#echo "> dig www1.example.com."
-#dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+#dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
#echo "> cat logfiles"
#cat fwd.log
#cat unbound.log
@@ -24,17 +24,17 @@ PRE="../.."
#fi
echo "> do queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
-dig @localhost -p $UNBOUND_PORT www4.example.com. >outfile4 &
+dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. >outfile4 &
digpid4=$!
-dig @localhost -p $UNBOUND_PORT www5.example.com. >outfile5 &
+dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. >outfile5 &
digpid5=$!
-dig @localhost -p $UNBOUND_PORT www6.example.com. >outfile6 &
+dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. >outfile6 &
digpid6=$!
sleep 15
diff --git a/testdata/fwd_waitudp.tdir/fwd_waitudp.post b/testdata/fwd_waitudp.tdir/fwd_waitudp.post
index fedf97a41641..384418c56f10 100644
--- a/testdata/fwd_waitudp.tdir/fwd_waitudp.post
+++ b/testdata/fwd_waitudp.tdir/fwd_waitudp.post
@@ -11,7 +11,7 @@
kill_pid $FWD_PID
# find all extra forked testns and kill them.
-pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'`
+pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do
kill_pid $p
done
diff --git a/testdata/fwd_waitudp.tdir/fwd_waitudp.test b/testdata/fwd_waitudp.tdir/fwd_waitudp.test
index 1247885348ac..5158bd065232 100644
--- a/testdata/fwd_waitudp.tdir/fwd_waitudp.test
+++ b/testdata/fwd_waitudp.tdir/fwd_waitudp.test
@@ -11,7 +11,7 @@ PRE="../.."
# so that all three queries get timeouts during the later test.
#
#echo "> dig www1.example.com."
-#dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+#dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
#echo "> cat logfiles"
#cat fwd.log
#cat unbound.log
@@ -24,11 +24,11 @@ PRE="../.."
#fi
echo "> do three queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
sleep 15
kill -9 $digpid1
diff --git a/testdata/fwd_zero.tdir/fwd_zero.test b/testdata/fwd_zero.tdir/fwd_zero.test
index 2e0806d6f401..c939188831ac 100644
--- a/testdata/fwd_zero.tdir/fwd_zero.test
+++ b/testdata/fwd_zero.tdir/fwd_zero.test
@@ -17,7 +17,7 @@ echo "b4380100000100000000000003777777076578616d706c6503636f6d00" | xxd -r -p |
# now test that server is still up
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/http_user_agent.tdir/http_user_agent.test b/testdata/http_user_agent.tdir/http_user_agent.test
index dce2d476c8f6..95803089506c 100644
--- a/testdata/http_user_agent.tdir/http_user_agent.test
+++ b/testdata/http_user_agent.tdir/http_user_agent.test
@@ -9,35 +9,35 @@ PRE="../.."
# Query and check check that we get the correct answer from the auth_zone
query () {
echo "> dig www.example.com."
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> check answer"
if grep "1.2.3.4" outfile; then
diff --git a/testdata/iter_cname_minimise_nx.rpl b/testdata/iter_cname_minimise_nx.rpl
index 080055208daf..a04eb8b24791 100644
--- a/testdata/iter_cname_minimise_nx.rpl
+++ b/testdata/iter_cname_minimise_nx.rpl
@@ -241,6 +241,5 @@ v.example.com. 3600 IN RRSIG NSEC 3 3 3600 20070926134150 20070829134150 2854 ex
example.com. 3600 IN NSEC abc.example.com. NS SOA RRSIG NSEC DNSKEY
example.com. 3600 IN RRSIG NSEC 3 2 3600 20070926134150 20070829134150 2854 example.com. ABEOu6iietfjKY1MS0TutZZxUtRYA6XKsC1rMTrenwBF2darY3/Emco=
ENTRY_END
-ENTRY_END
SCENARIO_END
diff --git a/testdata/iter_dname_insec.rpl b/testdata/iter_dname_insec.rpl
index ce593ba5c20a..051363bd2e8f 100644
--- a/testdata/iter_dname_insec.rpl
+++ b/testdata/iter_dname_insec.rpl
@@ -397,7 +397,7 @@ ENTRY_END
STEP 220302 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
SECTION QUESTION
a.example.com. IN A
@@ -420,7 +420,7 @@ ENTRY_END
STEP 220402 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
SECTION QUESTION
a.b.example.com. IN A
@@ -523,7 +523,7 @@ ENTRY_END
STEP 220702 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
SECTION QUESTION
a.x.example.com. IN A
@@ -607,7 +607,7 @@ ENTRY_END
STEP 220802 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
SECTION QUESTION
a2.example.com. IN A
@@ -691,14 +691,14 @@ ENTRY_END
; CNAME chains should be followed and CNAME loops signalled as an error
STEP 220902 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
REPLY NOERROR
SECTION QUESTION
cyc.example.com. IN A
SECTION ANSWER
-example.com. 0 IN DNAME example.com.
-cyc.example.com. 0 IN CNAME cyc.example.com.
+example.com. 3600 IN DNAME example.com.
+cyc.example.com. 3600 IN CNAME cyc.example.com.
ENTRY_END
; ns1.example.com.
@@ -857,7 +857,7 @@ ENTRY_END
STEP 221102 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
SECTION QUESTION
shortloop.x.x. IN TXT
@@ -885,7 +885,7 @@ ENTRY_END
STEP 221202 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
SECTION QUESTION
shortloop.x. IN TXT
@@ -999,7 +999,7 @@ ENTRY_END
; query returning maximal permissible length - should work
STEP 229002 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA DO
SECTION QUESTION
x.long. IN A
diff --git a/testdata/iter_dname_ttl.rpl b/testdata/iter_dname_ttl.rpl
new file mode 100644
index 000000000000..115947af3ab3
--- /dev/null
+++ b/testdata/iter_dname_ttl.rpl
@@ -0,0 +1,310 @@
+; config options
+; The island of trust is at example.com
+; validation is enabled because the pickup of DNAME from cache wants
+; a DNSSEC signed DNAME.
+server:
+ trust-anchor: "example.com. 3600 IN DS 2854 3 1 46e4ffc6e9a4793b488954bd3f0cc6af0dfb201b"
+ trust-anchor: "example.net. 3600 IN DNSKEY 256 3 5 AQPQ41chR9DEHt/aIzIFAqanbDlRflJoRs5yz1jFsoRIT7dWf0r+PeDuewdxkszNH6wnU4QL8pfKFRh5PIYVBLK3 ;{id = 30899 (zsk), size = 512b}"
+ val-override-date: "20070916134226"
+ target-fetch-policy: "0 0 0 0 0"
+ qname-minimisation: "no"
+ fake-sha1: yes
+ trust-anchor-signaling: no
+
+stub-zone:
+ name: "."
+ stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.
+CONFIG_END
+
+SCENARIO_BEGIN Test iterator for TTL of synthesized CNAME of a DNAME from cache.
+
+; K.ROOT-SERVERS.NET.
+RANGE_BEGIN 0 100
+ ADDRESS 193.0.14.129
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+. IN NS
+SECTION ANSWER
+. IN NS K.ROOT-SERVERS.NET.
+SECTION ADDITIONAL
+K.ROOT-SERVERS.NET. IN A 193.0.14.129
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode subdomain
+ADJUST copy_id copy_query
+REPLY QR NOERROR
+SECTION QUESTION
+com. IN NS
+SECTION AUTHORITY
+com. IN NS a.gtld-servers.net.
+SECTION ADDITIONAL
+a.gtld-servers.net. IN A 192.5.6.30
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode subdomain
+ADJUST copy_id copy_query
+REPLY QR NOERROR
+SECTION QUESTION
+net. IN A
+SECTION AUTHORITY
+net. IN NS a.gtld-servers.net.
+SECTION ADDITIONAL
+a.gtld-servers.net. IN A 192.5.6.30
+ENTRY_END
+RANGE_END
+
+; a.gtld-servers.net.
+RANGE_BEGIN 0 100
+ ADDRESS 192.5.6.30
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+com. IN NS
+SECTION ANSWER
+com. IN NS a.gtld-servers.net.
+SECTION ADDITIONAL
+a.gtld-servers.net. IN A 192.5.6.30
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+net. IN NS
+SECTION ANSWER
+net. IN NS a.gtld-servers.net.
+SECTION ADDITIONAL
+a.gtld-servers.net. IN A 192.5.6.30
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode subdomain
+ADJUST copy_id copy_query
+REPLY QR NOERROR
+SECTION QUESTION
+example.com. IN NS
+SECTION AUTHORITY
+example.com. IN NS ns.example.com.
+SECTION ADDITIONAL
+ns.example.com. IN A 1.2.3.4
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode subdomain
+ADJUST copy_id copy_query
+REPLY QR NOERROR
+SECTION QUESTION
+example.net. IN A
+SECTION AUTHORITY
+example.net. IN NS ns.example.net.
+SECTION ADDITIONAL
+ns.example.net. IN A 1.2.3.5
+ENTRY_END
+RANGE_END
+
+; ns.example.com.
+RANGE_BEGIN 0 100
+ ADDRESS 1.2.3.4
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+example.com. IN NS
+SECTION ANSWER
+example.com. IN NS ns.example.com.
+example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
+SECTION ADDITIONAL
+ns.example.com. IN A 1.2.3.4
+ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926135752 20070829135752 2854 example.com. MC0CFQCMSWxVehgOQLoYclB9PIAbNP229AIUeH0vNNGJhjnZiqgIOKvs1EhzqAo= ;{id = 2854}
+ENTRY_END
+
+; response to DNSKEY priming query
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+example.com. IN DNSKEY
+SECTION ANSWER
+example.com. 3600 IN DNSKEY 256 3 3 ALXLUsWqUrY3JYER3T4TBJII s70j+sDS/UT2QRp61SE7S3E EXopNXoFE73JLRmvpi/UrOO/Vz4Se 6wXv/CYCKjGw06U4WRgR YXcpEhJROyNapmdIKSx hOzfLVE1gqA0PweZR8d tY3aNQSRn3sPpwJr6Mi /PqQKAMMrZ9ckJpf1+b QMOOvxgzz2U1GS18b3y ZKcgTMEaJzd/GZYzi/B N2DzQ0MsrSwYXfsNLFO Bbs8PJMW4LYIxeeOe6rUgkWOF 7CC9Dh/dduQ1QrsJhmZAEFfd6ByYV+ ;{id = 2854 (zsk), size = 1688b}
+example.com. 3600 IN RRSIG DNSKEY DSA 2 3600 20070926134150 20070829134150 2854 example.com. MCwCFBQRtlR4BEv9ohi+PGFjp+AHsJuHAhRCvz0shggvnvI88DFnBDCczHUcVA== ;{id = 2854}
+SECTION AUTHORITY
+example.com. IN NS ns.example.com.
+example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
+SECTION ADDITIONAL
+ns.example.com. IN A 1.2.3.4
+ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926135752 20070829135752 2854 example.com. MC0CFQCMSWxVehgOQLoYclB9PIAbNP229AIUeH0vNNGJhjnZiqgIOKvs1EhzqAo= ;{id = 2854}
+ENTRY_END
+
+; response to query of interest
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.com. IN CNAME
+SECTION ANSWER
+www.example.com. IN CNAME www.example.net.
+www.example.com. 3600 IN RRSIG CNAME DSA 3 3600 20070926134150 20070829134150 2854 example.com. MC0CFGcJxnNxpWCBzXejiSdl4p1BKRMnAhUApoJrugVBRwFgAoYAhhqlZFac7fE= ;{id = 2854}
+SECTION AUTHORITY
+SECTION ADDITIONAL
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+www2.example.com. IN A
+SECTION ANSWER
+www2.example.com. 3600 IN CNAME www.example.net.
+www2.example.com. 3600 IN RRSIG CNAME 3 3 3600 20070926135752 20070829135752 2854 example.com. AGgh6pDCL7VF0uJablClW7cgvsPuNzpHZ+M7nZIwi61+0RPhFZLHcN4=
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+foo.test-dname.example.com. IN A
+SECTION ANSWER
+test-dname.example.com. 3600 IN DNAME example.net.
+test-dname.example.com. 3600 IN RRSIG DNAME 3 3 3600 20070926135752 20070829135752 2854 example.com. ACp31Evt1c6tKzmTh/smAuGFydZ1OO26Qkej/BW4Bw5RFBQiKaY22Z0=
+foo.test-dname.example.com. 3600 IN CNAME foo.example.net.
+ENTRY_END
+RANGE_END
+
+; ns.example.net.
+RANGE_BEGIN 0 100
+ ADDRESS 1.2.3.5
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+example.net. IN NS
+SECTION ANSWER
+example.net. IN NS ns.example.net.
+example.net. 3600 IN RRSIG NS RSASHA1 2 3600 20070926134150 20070829134150 30899 example.net. E8JX0l4B+cSR5bkHQwOJy1pBmlLMTYCJ8EwfNMU/eCv0YhKwo26rHhn52FGisgv+Nwp7/NbhHqQ+kJgoZC94XA== ;{id = 30899}
+SECTION ADDITIONAL
+ns.example.net. IN A 1.2.3.5
+ns.example.net. 3600 IN RRSIG A RSASHA1 3 3600 20070926134150 20070829134150 30899 example.net. x+tQMC9FhzT7Fcy1pM5NrOC7E8nLd7THPI3C6ie4EwL8PrxllqlR3q/DKB0d/m0qCOPcgN6HFOYURV1s4uAcsw== ;{id = 30899}
+ENTRY_END
+
+; response to DNSKEY priming query
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+example.net. IN DNSKEY
+SECTION ANSWER
+example.net. 3600 IN DNSKEY 256 3 5 AQPQ41chR9DEHt/aIzIFAqanbDlRflJoRs5yz1jFsoRIT7dWf0r+PeDuewdxkszNH6wnU4QL8pfKFRh5PIYVBLK3 ;{id = 30899 (zsk), size = 512b}
+example.net. 3600 IN RRSIG DNSKEY RSASHA1 2 3600 20070926134150 20070829134150 30899 example.net. hiFzlQ8VoYgCuvIsfVuxC3mfJDqsTh0yc6abs5xMx5uEcIjb0dndFQx7INOM+imlzveEN73Hqp4OLFpFhsWLlw== ;{id = 30899}
+SECTION AUTHORITY
+example.net. IN NS ns.example.net.
+example.net. 3600 IN RRSIG NS RSASHA1 2 3600 20070926134150 20070829134150 30899 example.net. E8JX0l4B+cSR5bkHQwOJy1pBmlLMTYCJ8EwfNMU/eCv0YhKwo26rHhn52FGisgv+Nwp7/NbhHqQ+kJgoZC94XA== ;{id = 30899}
+SECTION ADDITIONAL
+ns.example.net. IN A 1.2.3.5
+ns.example.net. 3600 IN RRSIG A RSASHA1 3 3600 20070926134150 20070829134150 30899 example.net. x+tQMC9FhzT7Fcy1pM5NrOC7E8nLd7THPI3C6ie4EwL8PrxllqlR3q/DKB0d/m0qCOPcgN6HFOYURV1s4uAcsw== ;{id = 30899}
+ENTRY_END
+
+; response to query of interest
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.net. IN A
+SECTION ANSWER
+www.example.net. IN A 11.12.13.14
+www.example.net. 3600 IN RRSIG A 5 3 3600 20070926134150 20070829134150 30899 example.net. CPxF5hK9Kg5eT7W6LgZwr0ePYEm9HMcSY4vvqCS6gDWB4X9jvXLCfBkCLhsNybPBpGWlsLi5wM6MTdJXuPpsRA== ;{id = 30899}
+SECTION AUTHORITY
+SECTION ADDITIONAL
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+foo.example.net. IN A
+SECTION ANSWER
+foo.example.net. IN A 11.12.13.15
+foo.example.net. 3600 IN RRSIG A 5 3 3600 20070926134150 20070829134150 30899 example.net. X6T6SE9UzxAD/4zKpwGOxEDyE4g7lfYYw3lvw533uwRN8mWTcBvSva0/jjyhrogJcuLO32jPHK6zGb93w2xnuA==
+SECTION AUTHORITY
+SECTION ADDITIONAL
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+foo2.example.net. IN A
+SECTION ANSWER
+foo2.example.net. IN A 11.12.13.16
+foo2.example.net. 3600 IN RRSIG A 5 3 3600 20070926134150 20070829134150 30899 example.net. BZm+GljD8m9N+pNJN8D+LlSyHqM+InNUe0+heKILR9be+Goqv6SEb7LKtX6+kj3239Y5by7u+/Cuk8kkWistEQ==
+SECTION AUTHORITY
+SECTION ADDITIONAL
+ENTRY_END
+RANGE_END
+
+STEP 1 TIME_PASSES ELAPSE 10
+; Get DNAME in cache and then pick it up again from cache.
+STEP 10 QUERY
+ENTRY_BEGIN
+REPLY RD DO
+SECTION QUESTION
+foo.test-dname.example.com. IN A
+ENTRY_END
+
+STEP 20 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all
+REPLY QR RD RA AD DO NOERROR
+SECTION QUESTION
+foo.test-dname.example.com. IN A
+SECTION ANSWER
+test-dname.example.com. 3600 IN DNAME example.net.
+test-dname.example.com. 3600 IN RRSIG DNAME 3 3 3600 20070926135752 20070829135752 2854 example.com. ACp31Evt1c6tKzmTh/smAuGFydZ1OO26Qkej/BW4Bw5RFBQiKaY22Z0=
+foo.test-dname.example.com. 3600 IN CNAME foo.example.net.
+foo.example.net. IN A 11.12.13.15
+foo.example.net. 3600 IN RRSIG A 5 3 3600 20070926134150 20070829134150 30899 example.net. X6T6SE9UzxAD/4zKpwGOxEDyE4g7lfYYw3lvw533uwRN8mWTcBvSva0/jjyhrogJcuLO32jPHK6zGb93w2xnuA==
+ENTRY_END
+
+STEP 30 TIME_PASSES ELAPSE 10
+
+; Use DNAME from cache
+STEP 40 QUERY
+ENTRY_BEGIN
+REPLY RD DO
+SECTION QUESTION
+foo2.test-dname.example.com. IN A
+ENTRY_END
+
+; Test the TTL on the synthesized CNAME for the DNAME record from cache.
+STEP 50 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ttl
+REPLY QR RD RA AD DO NOERROR
+SECTION QUESTION
+foo2.test-dname.example.com. IN A
+SECTION ANSWER
+test-dname.example.com. 3590 IN DNAME example.net.
+test-dname.example.com. 3590 IN RRSIG DNAME 3 3 3600 20070926135752 20070829135752 2854 example.com. ACp31Evt1c6tKzmTh/smAuGFydZ1OO26Qkej/BW4Bw5RFBQiKaY22Z0=
+foo2.test-dname.example.com. 3590 IN CNAME foo2.example.net.
+foo2.example.net. 3600 IN A 11.12.13.16
+foo2.example.net. 3600 IN RRSIG A 5 3 3600 20070926134150 20070829134150 30899 example.net. BZm+GljD8m9N+pNJN8D+LlSyHqM+InNUe0+heKILR9be+Goqv6SEb7LKtX6+kj3239Y5by7u+/Cuk8kkWistEQ==
+ENTRY_END
+
+SCENARIO_END
diff --git a/testdata/iter_dname_yx.rpl b/testdata/iter_dname_yx.rpl
index 18b9725cc66f..00d77de047cc 100644
--- a/testdata/iter_dname_yx.rpl
+++ b/testdata/iter_dname_yx.rpl
@@ -2,6 +2,8 @@
server:
harden-referral-path: no
target-fetch-policy: "0 0 0 0 0"
+ qname-minimisation: "no"
+ minimal-responses: no
stub-zone:
name: "."
@@ -321,680 +323,6 @@ ENTRY_END
RANGE_END
; end of a.gtld-servers.net.
-; RFC 6672 section 2.2. The DNAME Substitution table tests
-;# QNAME owner DNAME target result
-;-- ---------------- -------------- -------------- -----------------
-;1 com. example.com. example.net. <no match>
-;2 example.com. example.com. example.net. [0]
-;3 a.example.com. example.com. example.net. a.example.net.
-;4 a.b.example.com. example.com. example.net. a.b.example.net.
-;5 ab.example.com. b.example.com. example.net. <no match>
-;6 foo.example.com. example.com. example.net. foo.example.net.
-;7 a.x.example.com. x.example.com. example.net. a.example.net.
-;8 a.example.com. example.com. y.example.net. a.y.example.net.
-;9 cyc.example.com. example.com. example.com. cyc.example.com.
-;10 cyc.example.com. example.com. c.example.com. cyc.c.example.com.
-;11 shortloop.x.x. x. . shortloop.x.
-;12 shortloop.x. x. . shortloop.
-;
-; [0] The result depends on the QTYPE. If the QTYPE = DNAME, then
-; the result is "example.com.", else "<no match>".
-;
-; Table 1. DNAME Substitution Examples
-
-; ; line no. 1 is mostly for authoritative server
-; ; line no. 2 QTYPE != DNAME
-; STEP 220201 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; example.com. IN NS
-; ENTRY_END
-;
-; STEP 220202 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode answer
-; REPLY QR RD RA DO
-; SECTION QUESTION
-; example.com. IN NS
-; SECTION ANSWER
-; example.com. IN NS ns1.example.com.
-; ENTRY_END
-;
-; ; line no. 2 QTYPE == DNAME
-; STEP 220203 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; example.com. IN DNAME
-; ENTRY_END
-;
-; STEP 220204 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; REPLY QR RD RA DO
-; SECTION QUESTION
-; example.com. IN DNAME
-; SECTION ANSWER
-; example.com. IN DNAME example.net.
-; ENTRY_END
-;
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;3 a.example.com. example.com. example.net. a.example.net.
-;
-; STEP 220301 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; a.example.com. IN A
-; ENTRY_END
-;
-; STEP 220302 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; SECTION QUESTION
-; a.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME example.net.
-; a.example.com. IN CNAME a.example.net.
-; a.example.net. IN A 10.0.0.97
-; ENTRY_END
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;4 a.b.example.com. example.com. example.net. a.b.example.net.
-;
-; STEP 220401 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; a.b.example.com. IN A
-; ENTRY_END
-;
-; STEP 220402 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; SECTION QUESTION
-; a.b.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME example.net.
-; a.b.example.com. IN CNAME a.b.example.net.
-; a.b.example.net. IN A 10.0.97.98
-; ENTRY_END
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;5 ab.example.com. b.example.com. example.net. <no match>
-; ;6 foo.example.com. example.com. example.net. foo.example.net.
-;
-; ; line no. 5 is mostly for authoritative server
-; ; line no. 6 is basically the same as line no. 3
-;
-; ; ns1.example.com.
-; RANGE_BEGIN 220000 220699
-; ADDRESS 168.192.2.2
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN NS
-; SECTION ANSWER
-; example.com. IN NS ns1.example.com.
-; SECTION ADDITIONAL
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN A
-; SECTION ANSWER
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN AAAA
-; SECTION ANSWER
-; ENTRY_END
-;
-; ; line 2 DNAME
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN DNAME
-; SECTION ANSWER
-; example.com. IN DNAME example.net.
-; ENTRY_END
-;
-; ; line 3
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; a.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME example.net.
-; a.example.com. IN CNAME a.example.net.
-; ENTRY_END
-;
-; ; line 4
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; a.b.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME example.net.
-; a.b.example.com. IN CNAME a.b.example.net.
-; ENTRY_END
-; RANGE_END
-; ; end of ns1.example.com.
-;
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;7 a.x.example.com. x.example.com. example.net. a.example.net.
-;
-; STEP 220701 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; a.x.example.com. IN A
-; ENTRY_END
-;
-; STEP 220702 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; SECTION QUESTION
-; a.x.example.com. IN A
-; SECTION ANSWER
-; x.example.com. IN DNAME example.net.
-; a.x.example.com. IN CNAME a.example.net.
-; a.example.net. IN A 10.0.0.97
-; ENTRY_END
-;
-; ; ns1.example.com.
-; RANGE_BEGIN 220700 220799
-; ADDRESS 168.192.2.2
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN NS
-; SECTION ANSWER
-; example.com. IN NS ns1.example.com.
-; SECTION ADDITIONAL
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN A
-; SECTION ANSWER
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN AAAA
-; SECTION ANSWER
-; ENTRY_END
-;
-; ; line 7 DNAME
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN DNAME
-; SECTION ANSWER
-; x.example.com. IN DNAME example.net.
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; a.x.example.com. IN A
-; SECTION ANSWER
-; x.example.com. IN DNAME example.net.
-; a.x.example.com. IN CNAME a.example.net.
-; ENTRY_END
-; RANGE_END
-; ; end of ns1.example.com.
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;8 a.example.com. example.com. y.example.net. a.y.example.net.
-; ;
-; ; a.example.com. was renamed to a2.example.com. to avoid cache clashes
-; ; on the synthetized CNAME (caching CNAMEs is allowed by RFC 6672 section 3.4)
-;
-; STEP 220801 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; a2.example.com. IN A
-; ENTRY_END
-;
-; STEP 220802 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; SECTION QUESTION
-; a2.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME y.example.net.
-; a2.example.com. IN CNAME a2.y.example.net.
-; a2.y.example.net. IN A 10.97.50.121
-; ENTRY_END
-;
-; ; ns1.example.com.
-; RANGE_BEGIN 220800 220899
-; ADDRESS 168.192.2.2
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN NS
-; SECTION ANSWER
-; example.com. IN NS ns1.example.com.
-; SECTION ADDITIONAL
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN A
-; SECTION ANSWER
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN AAAA
-; SECTION ANSWER
-; ENTRY_END
-;
-; ; line 8 DNAME
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN DNAME
-; SECTION ANSWER
-; example.com. IN DNAME y.example.net.
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; a2.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME y.example.net.
-; a2.example.com. IN CNAME a2.y.example.net.
-; ENTRY_END
-; RANGE_END
-; ; end of ns1.example.com.
-;
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;9 cyc.example.com. example.com. example.com. cyc.example.com.
-;
-; STEP 220901 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; cyc.example.com. IN A
-; ENTRY_END
-;
-; ; Expected result is defined by RFC 1034 section 3.6.2:
-; ; CNAME chains should be followed and CNAME loops signalled as an error
-; STEP 220902 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; REPLY SERVFAIL
-; SECTION QUESTION
-; cyc.example.com. IN A
-; ENTRY_END
-;
-; ; ns1.example.com.
-; RANGE_BEGIN 220900 220999
-; ADDRESS 168.192.2.2
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN NS
-; SECTION ANSWER
-; example.com. IN NS ns1.example.com.
-; SECTION ADDITIONAL
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN A
-; SECTION ANSWER
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN AAAA
-; SECTION ANSWER
-; ENTRY_END
-;
-; ; line 9 DNAME
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN DNAME
-; SECTION ANSWER
-; example.com. IN DNAME example.com.
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; cyc.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME example.com.
-; cyc.example.com. IN CNAME cyc.example.com.
-; ENTRY_END
-; RANGE_END
-; ; end of ns1.example.com.
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;10 cyc.example.com. example.com. c.example.com. cyc.c.example.com.
-; ;
-; ; cyc.example.com. was renamed to cyc2.example.com. to avoid cache clashes
-; ; on the synthetized CNAME (caching CNAMEs is allowed by RFC 6672 section 3.4)
-; ;
-; ; target c.example.com. was renamed to cyc2.example.net.
-; ; to limit number of pre-canned answers required for the test
-;
-; STEP 221001 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; cyc2.example.com. IN A
-; ENTRY_END
-;
-; ; Expected result is defined by RFC 1034 section 3.6.2:
-; ; CNAME chains should be followed and CNAME loops signalled as an error
-; STEP 221002 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; REPLY SERVFAIL
-; SECTION QUESTION
-; cyc2.example.com. IN A
-; ENTRY_END
-;
-; ; ns1.example.com.
-; RANGE_BEGIN 221000 221099
-; ADDRESS 168.192.2.2
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN NS
-; SECTION ANSWER
-; example.com. IN NS ns1.example.com.
-; SECTION ADDITIONAL
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN A
-; SECTION ANSWER
-; ns1.example.com. IN A 168.192.2.2
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.com. IN AAAA
-; SECTION ANSWER
-; ENTRY_END
-;
-; ; line 10 DNAME
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.com. IN DNAME
-; SECTION ANSWER
-; example.com. IN DNAME cyc2.example.net.
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; cyc2.example.com. IN A
-; SECTION ANSWER
-; example.com. IN DNAME cyc2.example.net.
-; cyc2.example.com. IN CNAME cyc2.cyc2.example.net.
-; ENTRY_END
-; RANGE_END
-; ; end of ns1.example.com.
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;11 shortloop.x.x. x. . shortloop.x.
-;
-; STEP 221101 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; shortloop.x.x. TXT
-; ENTRY_END
-;
-; STEP 221102 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; SECTION QUESTION
-; shortloop.x.x. IN TXT
-; SECTION ANSWER
-; x. IN DNAME .
-; ; unbound hack
-; x. IN DNAME .
-; shortloop.x.x. IN CNAME shortloop.x.
-; shortloop.x. IN CNAME shortloop.
-; shortloop. IN TXT "shortloop end"
-; ENTRY_END
-;
-; ;# QNAME owner DNAME target result
-; ;-- ---------------- -------------- -------------- -----------------
-; ;12 shortloop.x. x. . shortloop.
-;
-; ; expire potentically cached CNAMEs for shortloop.x. from cache
-; STEP 221200 TIME_PASSES ELAPSE 10000
-;
-; STEP 221201 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; shortloop.x. TXT
-; ENTRY_END
-;
-; STEP 221202 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; SECTION QUESTION
-; shortloop.x. IN TXT
-; SECTION ANSWER
-; x. IN DNAME .
-; shortloop.x. IN CNAME shortloop.
-; shortloop. IN TXT "shortloop end"
-; ENTRY_END
-;
-;
-; ; ns1.example.net. (data shared by whole 22xxxx range)
-; RANGE_BEGIN 220000 229999
-; ADDRESS 168.192.3.3
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; example.net. IN NS
-; SECTION ANSWER
-; example.net. IN NS ns1.example.net.
-; SECTION ADDITIONAL
-; example.net. IN A 168.192.3.3
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.net. IN A
-; SECTION ANSWER
-; ns1.example.net. IN A 168.192.3.3
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; ns1.example.net. IN AAAA
-; SECTION ANSWER
-; ENTRY_END
-;
-; ; line 3
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; a.example.net. IN A
-; SECTION ANSWER
-; a.example.net. IN A 10.0.0.97
-; ENTRY_END
-;
-; ; line 4
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; a.b.example.net. IN A
-; SECTION ANSWER
-; a.b.example.net. IN A 10.0.97.98
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; a2.y.example.net. IN A
-; SECTION ANSWER
-; a2.y.example.net. IN A 10.97.50.121
-; ENTRY_END
-;
-; ; line 10
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; cyc2.example.net. IN DNAME
-; SECTION ANSWER
-; cyc2.example.net. IN DNAME example.com.
-; ENTRY_END
-;
-; ENTRY_BEGIN
-; MATCH opcode qtype qname
-; ADJUST copy_id
-; REPLY QR AA NOERROR
-; SECTION QUESTION
-; cyc2.cyc2.example.net. IN A
-; SECTION ANSWER
-; cyc2.example.net. IN DNAME example.com.
-; cyc2.cyc2.example.com. IN CNAME cyc2.example.com.
-; ENTRY_END
-; RANGE_END
-; ; end of ns1.example.net.
-;
-;
-; ; RFC 6672 section 2.2: YXDOMAIN answers for too long results for substitution
-; ; RFC 6672 section 2.3: DNAME can be at zone apex: zone apex = long.
-; STEP 229001 QUERY
-; ENTRY_BEGIN
-; REPLY RD DO
-; SECTION QUESTION
-; x.long. IN A
-; ENTRY_END
-;
-; ; query returning maximal permissible length - should work
-; STEP 229002 CHECK_ANSWER
-; ENTRY_BEGIN
-; MATCH rcode question answer
-; SECTION QUESTION
-; x.long. IN A
-; SECTION ANSWER
-; long. 3600 IN DNAME 63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.60o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
-; x.long. 3600 IN CNAME x.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.60o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
-; x.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.60o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. 3600 IN A 192.0.2.1
-; ENTRY_END
-
; result of substitution has too long name
; YXDOMAIN should be propagated to the client
; Unbound SEVFAILs: https://www.ietf.org/mail-archive/web/dnsext/current/msg11282.html
@@ -1015,27 +343,4 @@ SECTION ANSWER
long. 3600 IN DNAME 63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.60o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
ENTRY_END
- ; ; YXDOMAIN should work even if the cache is empty
- ; STEP 229005 TIME_PASSES ELAPSE 4000
- ;
- ; STEP 229006 QUERY
- ; ENTRY_BEGIN
- ; REPLY RD DO
- ; SECTION QUESTION
- ; too.long. IN A
- ; ENTRY_END
- ;
- ; STEP 229007 CHECK_ANSWER
- ; ENTRY_BEGIN
- ; MATCH rcode question answer
- ; REPLY QR YXDOMAIN
- ; SECTION QUESTION
- ; x.long. IN A
- ; SECTION ANSWER
- ; long. 3600 IN DNAME 63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.63o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.60o-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
- ; ENTRY_END
-
-
-
-
SCENARIO_END
diff --git a/testdata/iter_ghost_sub.rpl b/testdata/iter_ghost_sub.rpl
index ccd6b29842e4..ccb736755d70 100644
--- a/testdata/iter_ghost_sub.rpl
+++ b/testdata/iter_ghost_sub.rpl
@@ -19,7 +19,7 @@ MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
-. 86400 IN NS
+. IN NS
SECTION ANSWER
. 86400 IN NS K.ROOT-SERVERS.NET.
SECTION ADDITIONAL
diff --git a/testdata/iter_scrub_dname_insec.rpl b/testdata/iter_scrub_dname_insec.rpl
index 921abe628f7f..826d89e29e6d 100644
--- a/testdata/iter_scrub_dname_insec.rpl
+++ b/testdata/iter_scrub_dname_insec.rpl
@@ -166,7 +166,7 @@ ENTRY_END
; answer to first query (simply puts DNAME in cache)
STEP 120 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA
SECTION QUESTION
x.y.example.com. IN A
@@ -235,7 +235,7 @@ ENTRY_END
STEP 250 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA
SECTION QUESTION
other.y.example.com. IN A
diff --git a/testdata/local_cname.rpl b/testdata/local_cname.rpl
index b8c4a56013ed..d68a2c40e3c0 100644
--- a/testdata/local_cname.rpl
+++ b/testdata/local_cname.rpl
@@ -52,6 +52,10 @@ server:
local-zone: example.net redirect
local-data: "example.net. IN CNAME cname.example.org."
+ # Test setup for synthesized CNAMEs
+ local-zone: synth.cname redirect
+ local-data: "synth.cname. IN CNAME *.from.resolution."
+
### template zone and tag intended to be used for tests with CNAME and
### other data.
##local-zone: ambiguous.example.com redirect
@@ -138,6 +142,18 @@ MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
+www.synth.cname.from.resolution. IN A
+SECTION ANSWER
+www.synth.cname.from.resolution. IN A 192.0.2.3
+SECTION AUTHORITY
+SECTION ADDITIONAL
+ENTRY_END
+
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
example.org. IN AAAA
SECTION ANSWER
SECTION AUTHORITY
@@ -396,6 +412,26 @@ SECTION AUTHORITY
SECTION ADDITIONAL
ENTRY_END
+; Check CNAME synthesis
+STEP 201 QUERY
+ENTRY_BEGIN
+REPLY RD
+SECTION QUESTION
+www.synth.cname. IN A
+ENTRY_END
+
+STEP 202 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ttl
+REPLY QR RD RA AA NOERROR
+SECTION QUESTION
+www.synth.cname. IN A
+SECTION ANSWER
+www.synth.cname. IN CNAME www.synth.cname.from.resolution.
+www.synth.cname.from.resolution. IN A 192.0.2.3
+SECTION AUTHORITY
+SECTION ADDITIONAL
+ENTRY_END
; Relatively minor cases follow
diff --git a/testdata/local_nodefault.tdir/local_nodefault.test b/testdata/local_nodefault.tdir/local_nodefault.test
index 01e0ac042717..9bca122610f5 100644
--- a/testdata/local_nodefault.tdir/local_nodefault.test
+++ b/testdata/local_nodefault.tdir/local_nodefault.test
@@ -9,7 +9,7 @@ PRE="../.."
# this one should have NXDOMAIN builtin
#
echo "> dig 1.0.31.172.in-addr.arpa."
-dig @localhost -p $UNBOUND_PORT 1.0.31.172.in-addr.arpa. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT 1.0.31.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -23,7 +23,7 @@ fi
# this one should give our own data as the reply
echo "> dig 1.0.30.172.in-addr.arpa."
-dig @localhost -p $UNBOUND_PORT 1.0.30.172.in-addr.arpa. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT 1.0.30.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -38,7 +38,7 @@ fi
# this one should give our own data as the reply
# but different trailing dot in unbound.conf file
echo "> dig 1.0.29.172.in-addr.arpa."
-dig @localhost -p $UNBOUND_PORT 1.0.29.172.in-addr.arpa. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT 1.0.29.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/local_norec.tdir/local_norec.test b/testdata/local_norec.tdir/local_norec.test
index b32f0aed1a8c..ce01d6b7c85a 100644
--- a/testdata/local_norec.tdir/local_norec.test
+++ b/testdata/local_norec.tdir/local_norec.test
@@ -11,7 +11,7 @@ PRE="../.."
# foo.example.com is available through local-data (and recursion...).
#
echo "> dig www.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -24,7 +24,7 @@ else
fi
echo "> dig www.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -37,7 +37,7 @@ else
fi
echo "> dig foo.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -50,7 +50,7 @@ else
fi
echo "> dig foo.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/local_nosnoop.tdir/local_nosnoop.test b/testdata/local_nosnoop.tdir/local_nosnoop.test
index 1e762d5dc921..70a9de5f5579 100644
--- a/testdata/local_nosnoop.tdir/local_nosnoop.test
+++ b/testdata/local_nosnoop.tdir/local_nosnoop.test
@@ -14,7 +14,7 @@ PRE="../.."
# dig +norec for www does not work any more.
#
echo "> dig www.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -27,7 +27,7 @@ else
fi
echo "> dig www.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -47,7 +47,7 @@ else
fi
echo "> dig foo.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -60,7 +60,7 @@ else
fi
echo "> dig foo.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/padding.tdir/padding.post b/testdata/padding.tdir/padding.post
index 9121ccf257eb..eaeefb8c4fe1 100644
--- a/testdata/padding.tdir/padding.post
+++ b/testdata/padding.tdir/padding.post
@@ -9,13 +9,13 @@
PRE="../.."
kill_pid $DNSTAP_SOCKET_PID
kill_pid $FWD_PID
-kill_pid `cat unbound2.pid`
+kill_from_pidfile "unbound2.pid"
if test -f unbound2.log; then
echo ">>> upstream log"
cat unbound2.log
fi
#kill_pid $UNBOUND_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
if test -f unbound.log; then
echo ">>> unbound log"
cat unbound.log
diff --git a/testdata/padding.tdir/padding.test b/testdata/padding.tdir/padding.test
index 6161a49ae25d..2a0860851fa0 100644
--- a/testdata/padding.tdir/padding.test
+++ b/testdata/padding.tdir/padding.test
@@ -25,17 +25,10 @@ else
exit 1
fi
-echo "> wait for log to happen on timer"
-sleep 3
+echo "> wait for log to happen"
+wait_logfile tap.log "www.example.com" 45
echo "> check tap.log for dnstap info"
# see if it logged the information in tap.log
-# wait for a moment for filesystem to catch up.
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "www.example.com" tap.log >/dev/null; then :; else sleep 10; fi
if grep "www.example.com" tap.log; then echo "yes it is in tap.log";
else
echo "information not in tap.log"
@@ -67,12 +60,7 @@ fi
echo "> check tap.log for dnstap info"
# see if it logged the information in tap.log
# wait for a moment for filesystem to catch up.
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "txt.example.com" tap.log >/dev/null; then :; else sleep 10; fi
+wait_logfile tap.log "txt.example.com" 45
if grep "txt.example.com" tap.log; then echo "yes it is in tap.log";
else
echo "information not in tap.log"
@@ -131,12 +119,7 @@ dig @127.0.0.1 -p $UNBOUND_PORT fin.example.com. TXT | tee outfile
echo "> check tap.log for dnstap info"
# see if it logged the information in tap.log
# wait for a moment for filesystem to catch up.
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 1; fi
-if grep "fini" tap.log >/dev/null; then :; else sleep 10; fi
+wait_logfile tap.log "fini" 45
if grep "fini" tap.log; then echo "yes it is in tap.log";
else
echo "information not in tap.log"
diff --git a/testdata/pymod.tdir/pymod.test b/testdata/pymod.tdir/pymod.test
index 5ea87282b6f7..8d8ffcc3a56f 100644
--- a/testdata/pymod.tdir/pymod.test
+++ b/testdata/pymod.tdir/pymod.test
@@ -22,7 +22,7 @@ fi
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
@@ -35,7 +35,7 @@ else
fi
echo "> dig www2.example.com."
-dig @localhost -p $UNBOUND_PORT www2.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/pymod_thread.tdir/pymod_thread.test b/testdata/pymod_thread.tdir/pymod_thread.test
index 7c55d19ab49e..2b0464ae8c47 100644
--- a/testdata/pymod_thread.tdir/pymod_thread.test
+++ b/testdata/pymod_thread.tdir/pymod_thread.test
@@ -23,16 +23,16 @@ fi
# do the test
# generate some load.
echo "> dig www[1-10].example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile1 &
-dig @localhost -p $UNBOUND_PORT www2.example.com. | tee outfile3 &
-dig @localhost -p $UNBOUND_PORT www3.example.com. | tee outfile2 &
-dig @localhost -p $UNBOUND_PORT www4.example.com. | tee outfile4 &
-dig @localhost -p $UNBOUND_PORT www5.example.com. | tee outfile5 &
-dig @localhost -p $UNBOUND_PORT www6.example.com. | tee outfile6 &
-dig @localhost -p $UNBOUND_PORT www7.example.com. | tee outfile7 &
-dig @localhost -p $UNBOUND_PORT www8.example.com. | tee outfile8 &
-dig @localhost -p $UNBOUND_PORT www9.example.com. | tee outfile9 &
-dig @localhost -p $UNBOUND_PORT www10.example.com. | tee outfile10 &
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. | tee outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. | tee outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. | tee outfile4 &
+dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. | tee outfile5 &
+dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. | tee outfile6 &
+dig @127.0.0.1 -p $UNBOUND_PORT www7.example.com. | tee outfile7 &
+dig @127.0.0.1 -p $UNBOUND_PORT www8.example.com. | tee outfile8 &
+dig @127.0.0.1 -p $UNBOUND_PORT www9.example.com. | tee outfile9 &
+dig @127.0.0.1 -p $UNBOUND_PORT www10.example.com. | tee outfile10 &
wait # wait for all jobs to complete.
diff --git a/testdata/root_zonemd.tdir/root_zonemd.test b/testdata/root_zonemd.tdir/root_zonemd.test
index da64ab6e9c2d..2745b5009e8f 100644
--- a/testdata/root_zonemd.tdir/root_zonemd.test
+++ b/testdata/root_zonemd.tdir/root_zonemd.test
@@ -6,8 +6,8 @@
PRE="../.."
# do the test
-echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT . SOA | tee outfile
+echo "> dig . SOA"
+dig @127.0.0.1 -p $UNBOUND_PORT . SOA | tee outfile
echo "> check answer"
if grep root-servers outfile | grep "nstld.verisign-grs.com"; then
echo "OK"
@@ -26,7 +26,19 @@ else
fi
# This is the output when an unsupported algorithm is used.
-if grep "auth zone . ZONEMD unsupported algorithm" unbound.log; then
+if grep "auth zone . zonemd DNSSEC verification of SOA and ZONEMD RRsets secure" unbound.log; then
+ echo "OK"
+else
+ echo "ZONEMD verification not OK"
+ exit 1
+fi
+if grep "auth-zone . ZONEMD hash is correct" unbound.log; then
+ echo "OK"
+else
+ echo "ZONEMD verification not OK"
+ exit 1
+fi
+if grep "auth zone . ZONEMD verification successful" unbound.log; then
echo "OK"
else
echo "ZONEMD verification not OK"
@@ -40,12 +52,12 @@ if test $? -ne 0; then
exit 1
fi
# The output of the reload can be checked.
-#echo "> check unbound-control output"
-#if grep "example.com: ZONEMD verification successful" outfile; then
- #echo "OK"
-#else
- #echo "Not OK"
- #exit 1
-#fi
+echo "> check unbound-control output"
+if grep ".: ZONEMD verification successful" outfile; then
+ echo "OK"
+else
+ echo "Not OK"
+ exit 1
+fi
exit 0
diff --git a/testdata/rrset_use_cached.rpl b/testdata/rrset_use_cached.rpl
new file mode 100644
index 000000000000..8420ae02afe6
--- /dev/null
+++ b/testdata/rrset_use_cached.rpl
@@ -0,0 +1,151 @@
+server:
+ minimal-responses: no
+ serve-expired: yes
+ # The value does not matter, we will not simulate delay.
+ # We do not want only serve-expired because fetches from that
+ # apply a generous PREFETCH_LEEWAY.
+ serve-expired-client-timeout: 1000
+ # So that we can only have to give one SERVFAIL answer.
+ outbound-msg-retry: 0
+
+forward-zone: name: "." forward-addr: 216.0.0.1
+CONFIG_END
+
+SCENARIO_BEGIN RRset from cache updates the message TTL.
+
+STEP 1 QUERY
+ENTRY_BEGIN
+ REPLY RD
+ SECTION QUESTION
+ www.example.com. IN A
+ENTRY_END
+; the query is sent to the forwarder - no cache yet.
+STEP 2 CHECK_OUT_QUERY
+ENTRY_BEGIN
+ MATCH qname qtype opcode
+ SECTION QUESTION
+ www.example.com. IN A
+ENTRY_END
+STEP 3 REPLY
+ENTRY_BEGIN
+ MATCH opcode qtype qname
+ ADJUST copy_id
+ ; authoritative answer
+ REPLY QR AA RD RA NOERROR
+ SECTION QUESTION
+ www.example.com. IN A
+ SECTION ANSWER
+ www.example.com. 5 IN A 10.20.30.40
+ SECTION AUTHORITY
+ example.com. 10 IN NS ns.example.com.
+ SECTION ADDITIONAL
+ ns.example.com. 10 IN A 10.20.30.50
+ENTRY_END
+STEP 4 CHECK_ANSWER
+ENTRY_BEGIN
+ MATCH all ttl
+ REPLY QR RD RA
+ SECTION QUESTION
+ www.example.com. IN A
+ SECTION ANSWER
+ www.example.com. 5 IN A 10.20.30.40
+ SECTION AUTHORITY
+ example.com. 10 IN NS ns.example.com.
+ SECTION ADDITIONAL
+ ns.example.com. 10 IN A 10.20.30.50
+ENTRY_END
+
+; Wait for the A RRSET to expire.
+STEP 5 TIME_PASSES ELAPSE 6
+
+STEP 6 QUERY
+ENTRY_BEGIN
+ REPLY RD
+ SECTION QUESTION
+ www.example.com. IN A
+ENTRY_END
+; expired answer will not be served due to serve-expired-client-timeout.
+STEP 7 CHECK_OUT_QUERY
+ENTRY_BEGIN
+ MATCH qname qtype opcode
+ SECTION QUESTION
+ www.example.com. IN A
+ENTRY_END
+STEP 8 REPLY
+ENTRY_BEGIN
+ MATCH opcode qtype qname
+ ADJUST copy_id
+ ; authoritative answer
+ REPLY QR AA RD RA NOERROR
+ SECTION QUESTION
+ www.example.com. IN A
+ SECTION ANSWER
+ www.example.com. 5 IN A 10.20.30.40
+ SECTION AUTHORITY
+ example.com. 10 IN NS ns.example.com.
+ SECTION ADDITIONAL
+ ns.example.com. 10 IN A 10.20.30.50
+ENTRY_END
+; The cached NS related RRSETs will not be overwritten by the fresh answer.
+; The message should have a TTL of 4 instead of 5 from above.
+STEP 9 CHECK_ANSWER
+ENTRY_BEGIN
+ MATCH all ttl
+ REPLY QR RD RA
+ SECTION QUESTION
+ www.example.com. IN A
+ SECTION ANSWER
+ www.example.com. 5 IN A 10.20.30.40
+ SECTION AUTHORITY
+ example.com. 4 IN NS ns.example.com.
+ SECTION ADDITIONAL
+ ns.example.com. 4 IN A 10.20.30.50
+ENTRY_END
+
+; Wait for the NS RRSETs to expire.
+STEP 10 TIME_PASSES ELAPSE 5
+
+STEP 11 QUERY
+ENTRY_BEGIN
+ REPLY RD
+ SECTION QUESTION
+ www.example.com. IN A
+ENTRY_END
+; The message should be expired, again no expired answer at this point due to
+; serve-expired-client-timeout.
+STEP 12 CHECK_OUT_QUERY
+ENTRY_BEGIN
+ MATCH qname qtype opcode
+ SECTION QUESTION
+ www.example.com. IN A
+ENTRY_END
+STEP 13 REPLY
+ENTRY_BEGIN
+ MATCH opcode qtype qname
+ ADJUST copy_id
+ REPLY QR RD RA SERVFAIL
+ SECTION QUESTION
+ www.example.com. IN A
+ENTRY_END
+; The SERVFAIL will trigger the serve-expired-client-timeout logic to try and
+; replace the SERVFAIL with a possible cached (expired) answer.
+; The A RRSET would be at 0TTL left (not expired) but the message should have
+; been updated to use a TTL of 4 so expired by now.
+; If the message TTL was not updated (bug), this message would be treated as
+; non-expired and the now expired NS related RRSETs would fail sanity checks
+; for non-expired messages. The result would be SERVFAIL here.
+STEP 14 CHECK_ANSWER
+ENTRY_BEGIN
+ MATCH all ttl
+ REPLY QR RD RA
+ SECTION QUESTION
+ www.example.com. IN A
+ SECTION ANSWER
+ www.example.com. 0 IN A 10.20.30.40
+ SECTION AUTHORITY
+ example.com. 30 IN NS ns.example.com.
+ SECTION ADDITIONAL
+ ns.example.com. 30 IN A 10.20.30.50
+ENTRY_END
+
+SCENARIO_END
diff --git a/testdata/serve_expired_0ttl_nodata.rpl b/testdata/serve_expired_0ttl_nodata.rpl
index 45b51444bccd..7f1b5a565853 100644
--- a/testdata/serve_expired_0ttl_nodata.rpl
+++ b/testdata/serve_expired_0ttl_nodata.rpl
@@ -46,7 +46,7 @@ RANGE_BEGIN 30 100
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
- example.com. 10 IN NS
+ example.com. IN NS
SECTION ANSWER
example.com. 10 IN NS ns.example.com.
SECTION ADDITIONAL
diff --git a/testdata/serve_expired_0ttl_nxdomain.rpl b/testdata/serve_expired_0ttl_nxdomain.rpl
index 0fcde9f2ddb6..4adb4b839a69 100644
--- a/testdata/serve_expired_0ttl_nxdomain.rpl
+++ b/testdata/serve_expired_0ttl_nxdomain.rpl
@@ -46,7 +46,7 @@ RANGE_BEGIN 30 100
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
- example.com. 10 IN NS
+ example.com. IN NS
SECTION ANSWER
example.com. 10 IN NS ns.example.com.
SECTION ADDITIONAL
diff --git a/testdata/serve_expired_0ttl_servfail.rpl b/testdata/serve_expired_0ttl_servfail.rpl
index aad7aa8c984f..6833af17b827 100644
--- a/testdata/serve_expired_0ttl_servfail.rpl
+++ b/testdata/serve_expired_0ttl_servfail.rpl
@@ -44,7 +44,7 @@ RANGE_BEGIN 30 100
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
- example.com. 10 IN NS
+ example.com. IN NS
SECTION ANSWER
example.com. 10 IN NS ns.example.com.
SECTION ADDITIONAL
diff --git a/testdata/serve_expired_cached_servfail.rpl b/testdata/serve_expired_cached_servfail.rpl
index 286de708b9c5..f5f4c7030198 100644
--- a/testdata/serve_expired_cached_servfail.rpl
+++ b/testdata/serve_expired_cached_servfail.rpl
@@ -45,7 +45,7 @@ RANGE_BEGIN 30 100
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
- example.com. 10 IN NS
+ example.com. IN NS
SECTION ANSWER
example.com. 10 IN NS ns.example.com.
SECTION ADDITIONAL
diff --git a/testdata/serve_expired_cached_servfail_refresh.rpl b/testdata/serve_expired_cached_servfail_refresh.rpl
index 664de9aa8732..9b7c1fda16c1 100644
--- a/testdata/serve_expired_cached_servfail_refresh.rpl
+++ b/testdata/serve_expired_cached_servfail_refresh.rpl
@@ -49,7 +49,7 @@ RANGE_BEGIN 60 100
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
- example.com. 10 IN NS
+ example.com. IN NS
SECTION ANSWER
example.com. 10 IN NS ns.example.com.
SECTION ADDITIONAL
diff --git a/testdata/serve_expired_client_timeout_servfail.rpl b/testdata/serve_expired_client_timeout_servfail.rpl
index 1cae3fd822ff..51aa04370da8 100644
--- a/testdata/serve_expired_client_timeout_servfail.rpl
+++ b/testdata/serve_expired_client_timeout_servfail.rpl
@@ -32,7 +32,7 @@ RANGE_BEGIN 0 20
ADJUST copy_id
REPLY QR NOERROR
SECTION QUESTION
- example.com. 10 IN NS
+ example.com. IN NS
SECTION ANSWER
example.com. 10 IN NS ns.example.com.
SECTION ADDITIONAL
diff --git a/testdata/stat_timer.tdir/stat_timer.test b/testdata/stat_timer.tdir/stat_timer.test
index 8a84c3f41d17..1dfd8dc71d21 100644
--- a/testdata/stat_timer.tdir/stat_timer.test
+++ b/testdata/stat_timer.tdir/stat_timer.test
@@ -7,7 +7,7 @@
PRE="../.."
# test if unbound is up
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> check answer"
if grep "10.20.30.40" outfile; then
echo "OK"
diff --git a/testdata/stat_values.tdir/stat_values.test b/testdata/stat_values.tdir/stat_values.test
index 22d55f1f0d31..814ecd1168d3 100644
--- a/testdata/stat_values.tdir/stat_values.test
+++ b/testdata/stat_values.tdir/stat_values.test
@@ -272,7 +272,7 @@ if grep "192.0.2.1" outfile; then
else
end 1
fi
-sleep 1 # make sure the outgoing UDP (and the edns1xx0 retry) are accounted for.
+sleep 1 # make sure the outgoing UDP (and no edns1xx0 retry because not a smaller buffer size) are accounted for.
check_stats "\
total.num.queries=1
total.num.expired=1
@@ -284,7 +284,7 @@ num.query.flags.AD=1
num.query.flags.RD=1
num.query.opcode.QUERY=1
num.query.type.A=1
-num.query.udpout=2
+num.query.udpout=1
total.num.cachemiss=1
msg.cache.count=2
rrset.cache.count=2
diff --git a/testdata/stub_auth_tc.tdir/stub_auth_tc.test b/testdata/stub_auth_tc.tdir/stub_auth_tc.test
index 7b7440274a60..f50c2b8fc273 100644
--- a/testdata/stub_auth_tc.tdir/stub_auth_tc.test
+++ b/testdata/stub_auth_tc.tdir/stub_auth_tc.test
@@ -7,7 +7,7 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
diff --git a/testdata/subnet_scopezero_noedns.crpl b/testdata/subnet_scopezero_noedns.crpl
new file mode 100644
index 000000000000..25df0dd71cf2
--- /dev/null
+++ b/testdata/subnet_scopezero_noedns.crpl
@@ -0,0 +1,441 @@
+; scope of 0, if the query also had scope of 0, do not answer this
+; to everyone, but only for scope 0 queries. Otherwise can answer cached.
+
+server:
+ target-fetch-policy: "0 0 0 0 0"
+ send-client-subnet: 1.2.3.4
+ module-config: "subnetcache validator iterator"
+ verbosity: 4
+ qname-minimisation: no
+
+stub-zone:
+ name: "."
+ stub-addr: 193.0.14.129
+
+stub-zone:
+ name: "example.com"
+ stub-addr: 1.2.3.4
+CONFIG_END
+
+SCENARIO_BEGIN Test subnet cache with scope zero response without EDNS.
+
+; the upstream server.
+RANGE_BEGIN 0 100
+ ADDRESS 193.0.14.129
+
+ENTRY_BEGIN
+MATCH opcode qtype qname ednsdata
+ADJUST copy_id
+REPLY QR NOERROR
+SECTION QUESTION
+. IN NS
+SECTION ANSWER
+. IN NS K.ROOT-SERVERS.NET.
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ;; we expect to receive empty
+HEX_EDNSDATA_END
+K.ROOT-SERVERS.NET. IN A 193.0.14.129
+ENTRY_END
+RANGE_END
+
+RANGE_BEGIN 0 11
+ ADDRESS 1.2.3.4
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+;copy_ednsdata_assume_clientsubnet
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.40
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.0.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 11 ; source mask, scopemask
+ 7f 00 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+RANGE_END
+
+RANGE_BEGIN 20 31
+ ADDRESS 1.2.3.4
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+;copy_ednsdata_assume_clientsubnet
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.41
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.0.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 11 ; source mask, scopemask
+ 7f 01 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+RANGE_END
+
+RANGE_BEGIN 40 51
+ ADDRESS 1.2.3.4
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+;copy_ednsdata_assume_clientsubnet
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.42
+SECTION AUTHORITY
+SECTION ADDITIONAL
+;no EDNS in this answer. Tests if the back_parsed callback
+;is called to process the lack of edns contents.
+;HEX_EDNSDATA_BEGIN
+ ;00 08 ; OPC
+ ;00 04 ; option length
+ ;00 01 ; Family
+ ;00 00 ; source mask, scopemask
+ ; ; address 0.0.0.0/0 scope 0
+;HEX_EDNSDATA_END
+ENTRY_END
+RANGE_END
+
+RANGE_BEGIN 120 131
+ ADDRESS 1.2.3.4
+ENTRY_BEGIN
+MATCH opcode qtype qname
+ADJUST copy_id
+;copy_ednsdata_assume_clientsubnet
+REPLY QR NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.43
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 00 ; source mask, scopemask
+ 7f 02 00 ; address 127.2.0.0/24 scope 0
+HEX_EDNSDATA_END
+ENTRY_END
+RANGE_END
+
+; query for 127.0.0.0/24
+STEP 1 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 0b
+
+ 00 08 00 07 ; OPC, optlen
+ 00 01 18 00 ; ip4, scope 24, source 0
+ 7f 00 00 ;127.0.0.0/24
+HEX_ANSWER_END
+ENTRY_END
+
+; answer is 10.20.30.40 for 127.0.0.0/24 scope 17
+STEP 10 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.40
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.0.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 11 ; source mask, scopemask
+ 7f 00 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+; query for 127.1.0.0/24
+STEP 20 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 0b
+
+ 00 08 00 07 ; OPC, optlen
+ 00 01 18 00 ; ip4, scope 24, source 0
+ 7f 01 00 ;127.1.0.0/24
+HEX_ANSWER_END
+ENTRY_END
+
+; answer is 10.20.30.41 for 127.1.0.0/24 scope 17
+STEP 30 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.41
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.1.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 11 ; source mask, scopemask
+ 7f 01 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+; query for 0.0.0.0/0
+STEP 40 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 08
+
+ 00 08 00 04 ; OPC, optlen
+ 00 01 00 00 ; ip4, scope 0, source 0
+ ;0.0.0.0/0
+HEX_ANSWER_END
+ENTRY_END
+
+; answer is 10.20.30.42 for 0.0.0.0/0 scope 0
+STEP 50 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.42
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ 00 08 ; OPC
+ 00 04 ; option length
+ 00 01 ; Family
+ 00 00 ; source mask, scopemask
+ ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+; query for 127.0.0.0/24, again, it should be in cache.
+; and not from the scope 0 answer.
+STEP 60 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 0b
+
+ 00 08 00 07 ; OPC, optlen
+ 00 01 18 00 ; ip4, scope 24, source 0
+ 7f 00 00 ;127.0.0.0/24
+HEX_ANSWER_END
+ENTRY_END
+
+; answer should be 10.20.30.40 for 127.0.0.0/24 scope 17
+STEP 70 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.40
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.0.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 11 ; source mask, scopemask
+ 7f 00 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+; query for 127.1.0.0/24, again, it should be in cache.
+STEP 80 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 0b
+
+ 00 08 00 07 ; OPC, optlen
+ 00 01 18 00 ; ip4, scope 24, source 0
+ 7f 01 00 ;127.1.0.0/24
+HEX_ANSWER_END
+ENTRY_END
+
+; answer should be 10.20.30.41 for 127.1.0.0/24 scope 17
+STEP 90 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.41
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.1.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 11 ; source mask, scopemask
+ 7f 01 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+; query for 0.0.0.0/0, again.
+STEP 100 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 08
+
+ 00 08 00 04 ; OPC, optlen
+ 00 01 00 00 ; ip4, scope 0, source 0
+ ;0.0.0.0/0
+HEX_ANSWER_END
+ENTRY_END
+
+; answer should be 10.20.30.42 for 0.0.0.0/0 scope 0
+STEP 110 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.42
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ 00 08 ; OPC
+ 00 04 ; option length
+ 00 01 ; Family
+ 00 00 ; source mask, scopemask
+ ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+; now a query for a /24 that gets an answer for a /0.
+STEP 120 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 0b
+
+ 00 08 00 07 ; OPC, optlen
+ 00 01 18 00 ; ip4, scope 24, source 0
+ 7f 02 00 ;127.2.0.0/24
+HEX_ANSWER_END
+ENTRY_END
+
+; answer should be 10.20.30.43 for 127.2.0.0/24 scope 0
+STEP 130 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.43
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.2.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 00 ; source mask, scopemask
+ 7f 02 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+; the scope 0 answer is now used to answer queries from
+; query for 127.0.0.0/24
+STEP 140 QUERY
+ENTRY_BEGIN
+HEX_ANSWER_BEGIN
+ 00 00 01 00 00 01 00 00 ;ID 0
+ 00 00 00 01 03 77 77 77 ; www.example.com A? (DO)
+ 07 65 78 61 6d 70 6c 65
+ 03 63 6f 6d 00 00 01 00
+ 01 00 00 29 10 00 00 00
+ 80 00 00 0b
+
+ 00 08 00 07 ; OPC, optlen
+ 00 01 18 00 ; ip4, scope 24, source 0
+ 7f 00 00 ;127.0.0.0/24
+HEX_ANSWER_END
+ENTRY_END
+
+STEP 150 CHECK_ANSWER
+ENTRY_BEGIN
+MATCH all ednsdata
+REPLY QR RD RA NOERROR
+SECTION QUESTION
+www.example.com. IN A
+SECTION ANSWER
+www.example.com. IN A 10.20.30.43
+SECTION AUTHORITY
+SECTION ADDITIONAL
+HEX_EDNSDATA_BEGIN
+ ; client is 127.0.0.1
+ 00 08 ; OPC
+ 00 07 ; option length
+ 00 01 ; Family
+ 18 00 ; source mask, scopemask
+ 7f 00 00 ; address
+HEX_EDNSDATA_END
+ENTRY_END
+
+SCENARIO_END
diff --git a/testdata/tcp_reuse.tdir/tcp_reuse.post b/testdata/tcp_reuse.tdir/tcp_reuse.post
index ca75354714ed..7536918b7666 100644
--- a/testdata/tcp_reuse.tdir/tcp_reuse.post
+++ b/testdata/tcp_reuse.tdir/tcp_reuse.post
@@ -6,13 +6,13 @@
#
# do your teardown here
. ../common.sh
-kill_pid `cat unbound2.pid`
+kill_from_pidfile "unbound2.pid"
if test -f unbound2.log; then
echo ">>> upstream log"
cat unbound2.log
fi
#kill_pid $UNBOUND_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
if test -f unbound.log; then
echo ">>> unbound log"
cat unbound.log
diff --git a/testdata/tls_reuse.tdir/tls_reuse.post b/testdata/tls_reuse.tdir/tls_reuse.post
index 2eef0da96233..6162086e8ede 100644
--- a/testdata/tls_reuse.tdir/tls_reuse.post
+++ b/testdata/tls_reuse.tdir/tls_reuse.post
@@ -6,13 +6,13 @@
#
# do your teardown here
. ../common.sh
-kill_pid `cat unbound2.pid`
+kill_from_pidfile "unbound2.pid"
if test -f unbound2.log; then
echo ">>> upstream log"
cat unbound2.log
fi
#kill_pid $UNBOUND_PID
-kill_pid `cat unbound.pid`
+kill_from_pidfile "unbound.pid"
if test -f unbound.log; then
echo ">>> unbound log"
cat unbound.log
diff --git a/testdata/val_cnametocnamewctoposwc.rpl b/testdata/val_cnametocnamewctoposwc.rpl
index c290026baa20..407666efc0fc 100644
--- a/testdata/val_cnametocnamewctoposwc.rpl
+++ b/testdata/val_cnametocnamewctoposwc.rpl
@@ -153,7 +153,7 @@ ns.example.com. 3600 IN A 1.2.3.4
ns.example.com. 3600 IN RRSIG A 8 2 3600 20121126131826 20121029131826 64050 example.com. L/EsWsRNhM0Lt8877XYfm0FkVc+utuRPYlW/yxEi/Nzs/mTb9BMrOygsW0qfpYakYgfFvinR7S7ce9/naWidzGkWKYR85g2WFms3/TgchpmfjZHEsNyuT8zsiGrj3bQ3RxpT5cmt/IS2QlOak/RhdtawKfd9aqkMTVpP2idEQwY=
ENTRY_END
-ENTRY_BEGING
+ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
diff --git a/testdata/val_cnametodnametocnametopos.rpl b/testdata/val_cnametodnametocnametopos.rpl
index 280e557b8acb..b8a1159acb29 100644
--- a/testdata/val_cnametodnametocnametopos.rpl
+++ b/testdata/val_cnametodnametocnametopos.rpl
@@ -400,7 +400,7 @@ ENTRY_END
; recursion happens here.
STEP 10 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA AD DO NOERROR
SECTION QUESTION
www.example.com. IN A
@@ -409,7 +409,7 @@ www.example.com. 3600 IN CNAME www.sub.example.net.
www.example.com. 3600 IN RRSIG CNAME 3 3 3600 20070926134150 20070829134150 2854 example.com. MC0CFEv1gOb7KEskzkJNtFKKVBxY+Hb2AhUAqKJDIZJvNl+AdzqAt+JgdvnYAF0= ;{id = 2854}
sub.example.net. 3600 IN DNAME sub.example.com.
sub.example.net. 3600 IN RRSIG DNAME 5 3 3600 20070926134150 20070829134150 30899 example.net. G/UmcL1VmCF2mjB1O9IeNM2DnvayxEy6vOrvA+Ic/Gqcsgnq/f4VTCV9soQQIAWEir2v5Vt8hqPDP8rCRbMnyA== ;{id = 30899}
-www.sub.example.net. 0 IN CNAME www.sub.example.com.
+www.sub.example.net. 3600 IN CNAME www.sub.example.com.
www.sub.example.com. 3600 IN CNAME www.example.org.
www.sub.example.com. 3600 IN RRSIG CNAME 5 4 3600 20070926134150 20070829134150 30899 sub.example.com. ZE6A4pkyeUpNCscu2oeBv/3JbbirdwUaAMgmQ/ighzacUJCC6Lh8vAL5aYDEyTk7oktb8uS7gmYan171aM9/tg== ;{id = 30899}
www.example.org. 3600 IN A 11.11.11.11
diff --git a/testdata/val_dnametopos.rpl b/testdata/val_dnametopos.rpl
index c0ccc5977903..f314f3d9e431 100644
--- a/testdata/val_dnametopos.rpl
+++ b/testdata/val_dnametopos.rpl
@@ -220,14 +220,14 @@ ENTRY_END
; recursion happens here.
STEP 10 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA AD DO NOERROR
SECTION QUESTION
www.example.com. IN A
SECTION ANSWER
example.com. 3600 IN DNAME example.net.
example.com. 3600 IN RRSIG DNAME 3 2 3600 20070926134150 20070829134150 2854 example.com. MCwCFH1xw24Hswia3g10AVL1yFUHUPdFAhQDrA+qZJwqXRPg2C1oiNPk9fosGg== ;{id = 2854}
-www.example.com. 0 IN CNAME www.example.net.
+www.example.com. 3600 IN CNAME www.example.net.
www.example.net. 3600 IN A 11.12.13.14
www.example.net. 3600 IN RRSIG A 5 3 3600 20070926134150 20070829134150 30899 example.net. CPxF5hK9Kg5eT7W6LgZwr0ePYEm9HMcSY4vvqCS6gDWB4X9jvXLCfBkCLhsNybPBpGWlsLi5wM6MTdJXuPpsRA== ;{id = 30899}
SECTION AUTHORITY
diff --git a/testdata/val_dnametoposwc.rpl b/testdata/val_dnametoposwc.rpl
index 16481d17f704..3132e9ad1182 100644
--- a/testdata/val_dnametoposwc.rpl
+++ b/testdata/val_dnametoposwc.rpl
@@ -222,14 +222,14 @@ ENTRY_END
; recursion happens here.
STEP 10 CHECK_ANSWER
ENTRY_BEGIN
-MATCH all
+MATCH all ttl
REPLY QR RD RA AD DO NOERROR
SECTION QUESTION
www.example.com. IN A
SECTION ANSWER
example.com. 3600 IN DNAME example.net.
example.com. 3600 IN RRSIG DNAME 3 2 3600 20070926134150 20070829134150 2854 example.com. MCwCFH1xw24Hswia3g10AVL1yFUHUPdFAhQDrA+qZJwqXRPg2C1oiNPk9fosGg== ;{id = 2854}
-www.example.com. 0 IN CNAME www.example.net.
+www.example.com. 3600 IN CNAME www.example.net.
www.example.net. 3600 IN A 11.12.13.14
www.example.net. 3600 IN RRSIG A 5 2 3600 20070926134150 20070829134150 30899 example.net. quSyDbSeHRvyMmanqq5rW+APC9MKOswbRLB5QP/G+C2iyokQFLuRTlX9Wmo/jo1Oo1MGBefJUmP9NdRd2EqABA== ;{id = 30899}
SECTION AUTHORITY
diff --git a/testdata/val_nsec3_cnametocnamewctoposwc.rpl b/testdata/val_nsec3_cnametocnamewctoposwc.rpl
index 0fba0e2e17e7..1651ae7dc94f 100644
--- a/testdata/val_nsec3_cnametocnamewctoposwc.rpl
+++ b/testdata/val_nsec3_cnametocnamewctoposwc.rpl
@@ -151,7 +151,7 @@ example.com. 3600 IN RRSIG NS 8 2 3600 20121126123249 20121029123249 64050 examp
SECTION ADDITIONAL
ENTRY_END
-ENTRY_BEGING
+ENTRY_BEGIN
MATCH opcode qtype qname
ADJUST copy_id
REPLY QR NOERROR
diff --git a/testdata/zonemd_reload.tdir/zonemd_reload.test b/testdata/zonemd_reload.tdir/zonemd_reload.test
index fbdf07511306..aac23d6b848e 100644
--- a/testdata/zonemd_reload.tdir/zonemd_reload.test
+++ b/testdata/zonemd_reload.tdir/zonemd_reload.test
@@ -7,35 +7,35 @@
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> cat logfiles"
cat fwd.log