diff --git a/bin/tests/system/resolver/ns4/tld1.db b/bin/tests/system/resolver/ns4/tld1.db index 6b90e1b1ba..f9a9463440 100644 --- a/bin/tests/system/resolver/ns4/tld1.db +++ b/bin/tests/system/resolver/ns4/tld1.db @@ -20,7 +20,7 @@ ns A 10.53.0.4 $TTL 5 to-be-removed NS ns.to-be-removed ns.to-be-removed A 10.53.0.6 -fetch 10 TXT A short ttl +fetch 13 TXT A short ttl no-edns-version.tld. NS ns.no-edns-version.tld. ns.no-edns-version.tld. A 10.53.0.6 edns-version.tld. NS ns.edns-version.tld. diff --git a/bin/tests/system/resolver/ns4/tld2.db b/bin/tests/system/resolver/ns4/tld2.db index 22e1d4ed79..24ed348d89 100644 --- a/bin/tests/system/resolver/ns4/tld2.db +++ b/bin/tests/system/resolver/ns4/tld2.db @@ -17,7 +17,7 @@ $TTL 300 ) @ NS ns.tld. ns A 10.53.0.4 -fetch 10 TXT A short ttl +fetch 13 TXT A short ttl fetchall 10 TXT A short ttl fetchall 10 A 1.2.3.4 fetchall 10 AAAA ::1 diff --git a/bin/tests/system/resolver/ns5/named.conf.in b/bin/tests/system/resolver/ns5/named.conf.in index 07205c9938..f6f96f3fc4 100644 --- a/bin/tests/system/resolver/ns5/named.conf.in +++ b/bin/tests/system/resolver/ns5/named.conf.in @@ -21,6 +21,7 @@ options { listen-on-v6 { none; }; recursion yes; querylog yes; + prefetch 4 10; }; server 10.53.0.7 { diff --git a/bin/tests/system/resolver/ns6/example.net.db.in b/bin/tests/system/resolver/ns6/example.net.db.in index fa4e96aad8..eab3267b79 100644 --- a/bin/tests/system/resolver/ns6/example.net.db.in +++ b/bin/tests/system/resolver/ns6/example.net.db.in @@ -16,6 +16,6 @@ mail IN A 10.53.0.6 fetch 10 IN TXT A short ttl non-zero 10 IN TXT A short ttl zero 0 IN TXT A zero ttl -$TTL 10 +$TTL 13 ds IN NS ns.ds ns.ds IN A 10.53.0.6 diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index 02f713dce4..4001136683 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -443,10 +443,13 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "check prefetch (${n})" ret=0 +# read prefetch value from config. +PREFETCH=`sed -n "s/[[:space:]]*prefetch \([0-9]\).*/\1/p" ns5/named.conf` $DIG $DIGOPTS @10.53.0.5 fetch.tld txt > dig.out.1.${n} || ret=1 -ttl1=`awk '/"A" "short" "ttl"/ { print $2 - 2 }' dig.out.1.${n}` +ttl1=`awk '/"A" "short" "ttl"/ { print $2 }' dig.out.1.${n}` +interval=$((ttl1 - PREFETCH + 1)) # sleep so we are in prefetch range -sleep ${ttl1:-0} +sleep ${interval:-0} # trigger prefetch $DIG $DIGOPTS @10.53.0.5 fetch.tld txt > dig.out.2.${n} || ret=1 ttl2=`awk '/"A" "short" "ttl"/ { print $2 }' dig.out.2.${n}` @@ -462,9 +465,10 @@ n=`expr $n + 1` echo_i "check prefetch of validated DS's RRSIG TTL is updated (${n})" ret=0 $DIG $DIGOPTS +dnssec @10.53.0.5 ds.example.net ds > dig.out.1.${n} || ret=1 -dsttl1=`awk '$4 == "DS" && $7 == "1" { print $2 - 2 }' dig.out.1.${n}` +dsttl1=`awk '$4 == "DS" && $7 == "1" { print $2 }' dig.out.1.${n}` # sleep so we are in prefetch range -sleep ${dsttl1:-0} +interval=$((dsttl1 - PREFETCH + 1)) +sleep ${interval:-0} # trigger prefetch $DIG $DIGOPTS @10.53.0.5 ds.example.net ds > dig.out.2.${n} || ret=1 dsttl2=`awk '$4 == "DS" && $7 == "1" { print $2 }' dig.out.2.${n}`