diff --git a/bin/tests/system/resolver/ns5/named.conf.in b/bin/tests/system/resolver/ns5/named.conf.in index a98290903b..c81a3ba5de 100644 --- a/bin/tests/system/resolver/ns5/named.conf.in +++ b/bin/tests/system/resolver/ns5/named.conf.in @@ -22,7 +22,7 @@ options { recursion yes; dnssec-validation yes; querylog yes; - prefetch 3 9; + 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/ns6/fetch.tld.db b/bin/tests/system/resolver/ns6/fetch.tld.db index 3754373ec7..b38fd51601 100644 --- a/bin/tests/system/resolver/ns6/fetch.tld.db +++ b/bin/tests/system/resolver/ns6/fetch.tld.db @@ -18,4 +18,4 @@ $TTL 300 @ NS ns.fetch.tld. ns.fetch.tld. A 10.53.0.6 -@ 10 TXT A short ttl +@ 13 TXT A short ttl diff --git a/bin/tests/system/resolver/tests.sh b/bin/tests/system/resolver/tests.sh index 7c7a8ed925..d7e0d0bd4e 100755 --- a/bin/tests/system/resolver/tests.sh +++ b/bin/tests/system/resolver/tests.sh @@ -451,10 +451,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 - 3 }' 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}` @@ -470,9 +473,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 == "2" { print $2 - 3 }' dig.out.1.${n}` +dsttl1=`awk '$4 == "DS" && $7 == "2" { 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 == "2" { print $2 }' dig.out.2.${n}`