mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 18:59:59 -04:00
Add system tests for {min,max}-{cache,ncache}-ttl
This commit is contained in:
parent
02b828e63f
commit
f6ca532df4
12 changed files with 171 additions and 3 deletions
|
|
@ -69,7 +69,7 @@ PARALLEL = rpzrecurse serve-stale dnssec \
|
|||
rrchecker rrl rrsetorder rsabigexponent runtime \
|
||||
sfcache smartsign sortlist \
|
||||
spf staticstub statistics statschannel stub synthfromdnssec \
|
||||
tcp tools tsig tsiggss \
|
||||
tcp tools tsig tsiggss ttl \
|
||||
unknown upforwd verify views wildcard \
|
||||
xfer xferquota zero zonechecks
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ PARALLELDIRS="acl additional addzone allow-query auth autosign \
|
|||
rrchecker rrl rrsetorder rsabigexponent runtime \
|
||||
serve-stale sfcache smartsign sortlist \
|
||||
spf staticstub statistics statschannel stub synthfromdnssec \
|
||||
tcp tools tsig tsiggss \
|
||||
tcp tools tsig tsiggss ttl \
|
||||
unknown upforwd verify views wildcard \
|
||||
xfer xferquota zero zonechecks"
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ SEQUENTIALDIRS="acl additional addzone autosign builtin \
|
|||
reclimit redirect resolver rndc rpz rrchecker rrl \
|
||||
rrsetorder rsabigexponent runtime sfcache smartsign sortlist \
|
||||
spf staticstub statistics statschannel stub tcp tkey tsig \
|
||||
tsiggss unknown upforwd verify views wildcard xfer xferquota \
|
||||
tsiggss ttl unknown upforwd verify views wildcard xfer xferquota \
|
||||
zero zonechecks"
|
||||
|
||||
# List of tests that use unique ports (other than 5300 and 9953). These
|
||||
|
|
|
|||
12
bin/tests/system/ttl/clean.sh
Normal file
12
bin/tests/system/ttl/clean.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ../conf.sh
|
||||
|
||||
rm -f ./dig.out.*
|
||||
rm -f ./*/named.conf
|
||||
rm -f ./*/named.memstats
|
||||
rm -f ./*/named.run
|
||||
rm -f ./ns*/named.lock
|
||||
rm -f ./ns*/_default.nzf
|
||||
rm -f ./ns*/_default.nzd*
|
||||
rm -f ./ns*/managed-keys.bind* ns*/*.mkeys*
|
||||
9
bin/tests/system/ttl/ns1/max-example.db
Normal file
9
bin/tests/system/ttl/ns1/max-example.db
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
max-example. 1209600 IN SOA ns root (
|
||||
2000082401 ; serial
|
||||
1800 ; refresh (30 minutes)
|
||||
1800 ; retry (30 minutes)
|
||||
1814400 ; expire (3 weeks)
|
||||
1209600 ; minimum (2 weeks)
|
||||
)
|
||||
max-example. 1209600 IN NS ns.max-example.
|
||||
ns.max-example. 1209600 IN A 10.53.0.1
|
||||
9
bin/tests/system/ttl/ns1/min-example.db
Normal file
9
bin/tests/system/ttl/ns1/min-example.db
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
min-example. 0 IN SOA ns root (
|
||||
2000082401 ; serial
|
||||
1800 ; refresh (30 minutes)
|
||||
1800 ; retry (30 minutes)
|
||||
1814400 ; expire (3 weeks)
|
||||
0 ; minimum (0 seconds)
|
||||
)
|
||||
min-example. 0 IN NS ns.min-example.
|
||||
ns.min-example. 0 IN A 10.53.0.1
|
||||
46
bin/tests/system/ttl/ns1/named.conf.in
Normal file
46
bin/tests/system/ttl/ns1/named.conf.in
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
key rndc_key {
|
||||
secret "1234abcd8765";
|
||||
algorithm hmac-sha256;
|
||||
};
|
||||
|
||||
controls {
|
||||
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||
};
|
||||
|
||||
options {
|
||||
query-source address 10.53.0.1;
|
||||
notify-source 10.53.0.1;
|
||||
transfer-source 10.53.0.1;
|
||||
port @PORT@;
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.1; };
|
||||
listen-on-v6 { none; };
|
||||
recursion no;
|
||||
check-integrity no;
|
||||
};
|
||||
|
||||
zone "." {
|
||||
type hint;
|
||||
file "../../common/root.hint";
|
||||
};
|
||||
|
||||
zone "min-example" {
|
||||
type master;
|
||||
file "min-example.db";
|
||||
};
|
||||
|
||||
zone "max-example" {
|
||||
type master;
|
||||
file "max-example.db";
|
||||
};
|
||||
2
bin/tests/system/ttl/ns2/hints.db
Normal file
2
bin/tests/system/ttl/ns2/hints.db
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
. 60 IN NS ns.nil.
|
||||
ns.nil. 60 IN A 10.53.0.1
|
||||
40
bin/tests/system/ttl/ns2/named.conf.in
Normal file
40
bin/tests/system/ttl/ns2/named.conf.in
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
options {
|
||||
directory ".";
|
||||
query-source address 10.53.0.2;
|
||||
notify-source 10.53.0.2;
|
||||
transfer-source 10.53.0.2;
|
||||
port @PORT@;
|
||||
pid-file "named.pid";
|
||||
listen-on { 10.53.0.2; };
|
||||
listen-on-v6 { none; };
|
||||
servfail-ttl 0;
|
||||
max-recursion-depth 12;
|
||||
recursion yes;
|
||||
dnssec-validation no;
|
||||
min-cache-ttl 60;
|
||||
min-ncache-ttl 30;
|
||||
max-cache-ttl 120;
|
||||
max-ncache-ttl 60;
|
||||
};
|
||||
|
||||
key rndc_key {
|
||||
secret "1234abcd8765";
|
||||
algorithm hmac-sha256;
|
||||
};
|
||||
|
||||
controls {
|
||||
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||
};
|
||||
|
||||
zone "." { type hint; file "hints.db"; };
|
||||
7
bin/tests/system/ttl/setup.sh
Normal file
7
bin/tests/system/ttl/setup.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ../conf.sh
|
||||
|
||||
$SHELL clean.sh
|
||||
copy_setports ns1/named.conf.in ns1/named.conf
|
||||
copy_setports ns2/named.conf.in ns2/named.conf
|
||||
35
bin/tests/system/ttl/tests.sh
Normal file
35
bin/tests/system/ttl/tests.sh
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ../conf.sh
|
||||
|
||||
dig_with_options() { "$DIG" +noadd +nosea +nostat +noquest +nocomm +nocmd -p "${PORT}" "$@"; }
|
||||
|
||||
status=0
|
||||
t=0
|
||||
|
||||
echo_i "testing min-cache-ttl"
|
||||
t=$((t+1))
|
||||
dig_with_options IN SOA min-example. @10.53.0.2 > dig.out.${t}
|
||||
TTL=$(< dig.out.${t} awk '{ print $2; }')
|
||||
[ "$TTL" -eq 60 ] || status=$((status+1))
|
||||
|
||||
echo_i "testing min-ncache-ttl"
|
||||
t=$((t+1))
|
||||
dig_with_options IN MX min-example. @10.53.0.2 > dig.out.${t}
|
||||
TTL=$(< dig.out.${t} awk '{ print $2; }')
|
||||
[ "$TTL" -eq 30 ] || status=$((status+1))
|
||||
|
||||
echo_i "testing max-cache-ttl"
|
||||
t=$((t+1))
|
||||
dig_with_options IN SOA max-example. @10.53.0.2 > dig.out.${t}
|
||||
TTL=$(< dig.out.${t} awk '{ print $2; }')
|
||||
[ "$TTL" -eq 120 ] || status=$((status+1))
|
||||
|
||||
echo_i "testing max-ncache-ttl"
|
||||
t=$((t+1))
|
||||
dig_with_options IN MX max-example. @10.53.0.2 > dig.out.${t}
|
||||
TTL=$(< dig.out.${t} awk '{ print $2; }')
|
||||
[ "$TTL" -eq 60 ] || status=$((status+1))
|
||||
|
||||
echo_i "exit status: $status"
|
||||
[ $status -eq 0 ] || exit 1
|
||||
|
|
@ -1089,6 +1089,14 @@
|
|||
./bin/tests/system/tsiggss/prereq.sh SH 2010,2011,2012,2014,2016,2018
|
||||
./bin/tests/system/tsiggss/setup.sh SH 2010,2011,2012,2014,2016,2017,2018
|
||||
./bin/tests/system/tsiggss/tests.sh SH 2010,2011,2014,2016,2017,2018
|
||||
./bin/tests/system/ttl/clean.sh X 2018
|
||||
./bin/tests/system/ttl/ns1/max-example.db X 2018
|
||||
./bin/tests/system/ttl/ns1/min-example.db X 2018
|
||||
./bin/tests/system/ttl/ns1/named.conf.in X 2018
|
||||
./bin/tests/system/ttl/ns2/hints.db X 2018
|
||||
./bin/tests/system/ttl/ns2/named.conf.in X 2018
|
||||
./bin/tests/system/ttl/setup.sh X 2018
|
||||
./bin/tests/system/ttl/tests.sh X 2018
|
||||
./bin/tests/system/unknown/clean.sh SH 2000,2001,2004,2007,2012,2013,2014,2015,2016,2018
|
||||
./bin/tests/system/unknown/large.out X 2012,2018
|
||||
./bin/tests/system/unknown/ns3/sign.sh SH 2012,2014,2016,2017,2018
|
||||
|
|
|
|||
Loading…
Reference in a new issue