diff --git a/bin/tests/system/xferquota/ns1/changing1.db b/bin/tests/system/xferquota/ns1/changing1.db new file mode 100644 index 0000000000..39226ab656 --- /dev/null +++ b/bin/tests/system/xferquota/ns1/changing1.db @@ -0,0 +1,16 @@ +$TTL 600 + +@ IN SOA dns.changing. postmaster.changing. ( + 1 ;; serial + 3600 ;; refresh period + 1800 ;; retry interval + 604800 ;; expire time + 600 ) ;; default TTL + + IN NS dns1.changing. + NS dns2.changing. + +dns1 IN A 10.53.0.1 +dns2 IN A 10.53.0.2 + +a IN A 10.0.0.1 diff --git a/bin/tests/system/xferquota/ns1/changing2.db b/bin/tests/system/xferquota/ns1/changing2.db new file mode 100644 index 0000000000..b57ea77aac --- /dev/null +++ b/bin/tests/system/xferquota/ns1/changing2.db @@ -0,0 +1,16 @@ +$TTL 600 + +@ IN SOA dns.changing. postmaster.changing. ( + 2 ;; serial + 3600 ;; refresh period + 1800 ;; retry interval + 604800 ;; expire time + 600 ) ;; default TTL + + IN NS dns1.changing. + NS dns2.changing. + +dns1 IN A 10.53.0.1 +dns2 IN A 10.53.0.2 + +a IN A 10.0.0.2 diff --git a/bin/tests/system/xferquota/ns1/named.conf b/bin/tests/system/xferquota/ns1/named.conf index e468eed45a..878ff32f6f 100644 --- a/bin/tests/system/xferquota/ns1/named.conf +++ b/bin/tests/system/xferquota/ns1/named.conf @@ -11,4 +11,9 @@ zone "." { file "root.db"; }; +zone "changing." { + type master; + file "changing.db"; +}; + include "zones.conf"; diff --git a/bin/tests/system/xferquota/ns1/root.db b/bin/tests/system/xferquota/ns1/root.db index 86dccdc668..b856daccd9 100644 --- a/bin/tests/system/xferquota/ns1/root.db +++ b/bin/tests/system/xferquota/ns1/root.db @@ -11,3 +11,8 @@ a.root-servers.nil. A 10.53.0.1 example. NS ns2.example. ns2.example. A 10.53.0.2 + +changing. NS dns1.changing. + A 10.53.0.1 + NS dns2.changing. + A 10.53.0.2 diff --git a/bin/tests/system/xferquota/ns2/named.conf b/bin/tests/system/xferquota/ns2/named.conf index 465222239c..9dd92bb252 100644 --- a/bin/tests/system/xferquota/ns2/named.conf +++ b/bin/tests/system/xferquota/ns2/named.conf @@ -13,4 +13,10 @@ zone "." { file "root.hint"; }; +zone "changing." { + type slave; + masters { 10.53.0.1; }; + file "changing.bk"; +}; + include "zones.conf"; diff --git a/bin/tests/system/xferquota/setup.pl b/bin/tests/system/xferquota/setup.pl index 560c0a8424..c7dcb930b8 100644 --- a/bin/tests/system/xferquota/setup.pl +++ b/bin/tests/system/xferquota/setup.pl @@ -23,7 +23,7 @@ use FileHandle; my $masterconf = new FileHandle("ns1/zones.conf", "w") or die; my $slaveconf = new FileHandle("ns2/zones.conf", "w") or die; -for ($z = 0; $z < 100; $z++) { +for ($z = 0; $z < 300; $z++) { my $zn = sprintf("zone%06d.example", $z); print $masterconf "zone \"$zn\" { type master; file \"$zn.db\"; };\n"; print $slaveconf "zone \"$zn\" { type slave; file \"$zn.bk\"; masters { 10.53.0.1; }; };\n"; diff --git a/bin/tests/system/xferquota/setup.sh b/bin/tests/system/xferquota/setup.sh index 4a3bd2f484..edadee5fe0 100644 --- a/bin/tests/system/xferquota/setup.sh +++ b/bin/tests/system/xferquota/setup.sh @@ -19,4 +19,4 @@ # Set up test data for zone transfer quota tests. # perl setup.pl - +cp ns1/changing1.db ns1/changing.db diff --git a/bin/tests/system/xferquota/tests.sh b/bin/tests/system/xferquota/tests.sh index e47f98e9ac..883177b374 100644 --- a/bin/tests/system/xferquota/tests.sh +++ b/bin/tests/system/xferquota/tests.sh @@ -32,13 +32,18 @@ fi count=0 ticks=0 -while [ $count != 100 ]; do - sleep 5 +while [ $count != 300 ]; do + if [ $ticks = 1 ]; then + echo "Changing test zone..." + cp ns1/changing2.db ns1/changing.db + kill -HUP `cat ns1/named.pid` + fi + sleep 1 ticks=`expr $ticks + 1` - seconds=`expr $ticks \* 5` + seconds=`expr $ticks \* 1` if [ $ticks = 60 ]; then echo "Took too long to load domains." - exit 1; + exit 1 fi count=`cat ns2/zone*.bk | grep xyzzy | wc -l` echo "I:Have $count domains up in $seconds seconds" @@ -58,6 +63,21 @@ grep ";" dig.out.ns2 perl ../digcomp.pl dig.out.ns1 dig.out.ns2 status=`expr $status + $?` +sleep 5 + +../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ + a.changing. @10.53.0.1 a > dig.out.ns1 +status=`expr $status + $?` +grep ";" dig.out.ns1 + +../../../dig/dig +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \ + a.changing. @10.53.0.2 a > dig.out.ns2 +status=`expr $status + $?` +grep ";" dig.out.ns2 + +perl ../digcomp.pl dig.out.ns1 dig.out.ns2 +status=`expr $status + $?` + if [ $status != 0 ]; then echo "R:FAIL" else