backport ixfr journal generation

This commit is contained in:
Mark Andrews
2014-05-14 12:40:58 +10:00
parent 27d13f5c47
commit 515e44989d
11 changed files with 183 additions and 6 deletions
+2
View File
@@ -21,3 +21,5 @@ rm -f ns1/named.conf ns1/myftp.db
rm -f */named.memstats
rm -f dig.out dig.out1 dig.out2 dig.out3
rm -f ns3/large.db
rm -f ns3/mytest.db ns3/mytest.db.jnl ns3/subtest.db
+1
View File
@@ -0,0 +1 @@
named.conf
+31
View File
@@ -0,0 +1,31 @@
; Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
; $Id: mytest0.db,v 1.3 2011/09/07 23:46:27 tbox Exp $
$ORIGIN test.
$TTL 15
test. 15 IN SOA ns1.test. hostmaster.test. (
1 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.test.
IN NS ns2.test.
ns1 IN A 10.53.0.3
ns2 IN A 10.53.0.4
host1 IN A 192.168.10.3
host2 IN A 192.168.10.4
+31
View File
@@ -0,0 +1,31 @@
; Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
; $Id: mytest1.db,v 1.3 2011/09/07 23:46:27 tbox Exp $
$ORIGIN test.
$TTL 15
test. 15 IN SOA ns1.test. hostmaster.test. (
2 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.test.
IN NS ns2.test.
ns1 IN A 10.53.0.3
ns2 IN A 10.53.0.4
host1 IN A 192.168.10.13
host2 IN A 192.168.10.4
+31
View File
@@ -0,0 +1,31 @@
; Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
; $Id: mytest2.db,v 1.3 2011/09/07 23:46:27 tbox Exp $
$ORIGIN test.
$TTL 15
test. 15 IN SOA ns1.test. hostmaster.test. (
4 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.test.
IN NS ns2.test.
ns1 IN A 10.53.0.3
ns2 IN A 10.53.0.4
host1 IN A 192.168.10.13
host2 IN A 192.168.10.14
+10 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2011, 2014 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -39,6 +39,15 @@ controls {
};
view "primary" {
ixfr-from-differences yes;
zone "test" IN {
type master;
file "mytest.db";
};
zone "sub.test" IN {
type master;
file "subtest.db";
};
zone "large" IN {
type master;
file "large.db";
+29
View File
@@ -0,0 +1,29 @@
; Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
; $Id: subtest0.db,v 1.3 2011/09/07 23:46:27 tbox Exp $
$ORIGIN sub.test.
$TTL 15
sub.test. 15 IN SOA ns1.test. hostmaster.test. (
1 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.test.
IN NS ns2.test.
host3 IN A 192.168.10.23
host4 IN A 192.168.10.24
+29
View File
@@ -0,0 +1,29 @@
; Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
; $Id: subtest1.db,v 1.3 2011/09/07 23:46:27 tbox Exp $
$ORIGIN sub.test.
$TTL 15
sub.test. 15 IN SOA ns1.test. hostmaster.test. (
3 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS ns1.test.
IN NS ns2.test.
host3 IN A 192.168.10.123
host4 IN A 192.168.10.24
+4 -2
View File
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2004, 2007, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2004, 2007, 2011, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
@@ -18,7 +18,7 @@
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
rm -f ns1/*.db ns1/*.jnl
rm -f ns1/*.db ns1/*.jnl ns3/*.jnl ns4/*.db ns4/*.jnl
cat <<EOF >ns1/named.conf
options {
@@ -44,5 +44,7 @@ controls {
EOF
# Setup initial db files for ns3
cp ns3/mytest0.db ns3/mytest.db
cp ns3/subtest0.db ns3/subtest.db
$SHELL ../genzone.sh 3 > ns3/large.db
awk 'END { for (i = 0; i < 10000; i++) printf("record%d 10 IN TXT this is record %d\n", i, i) }' < /dev/null >> ns3/large.db
+9 -3
View File
@@ -151,14 +151,20 @@ test ${messages:-0} -gt 1 || { echo "I:failed"; status=1; }
echo "I:test 'dig +notcp ixfr=<value>' vs 'dig ixfr=<value> +notcp' vs 'dig ixfr=<value>'"
ret=0
cp ns3/mytest1.db ns3/mytest.db
$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload
sleep 2
cp ns3/mytest2.db ns3/mytest.db # change to test zone, should be IXFR
$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload
sleep 2
# Should be "switch to TCP" response
$DIG +notcp ixfr=1 test -p 5300 @10.53.0.4 > dig.out1 || ret=1
$DIG ixfr=1 +notcp test -p 5300 @10.53.0.4 > dig.out2 || ret=1
$DIG +notcp ixfr=1 test -p 5300 @10.53.0.3 > dig.out1 || ret=1
$DIG ixfr=1 +notcp test -p 5300 @10.53.0.3 > dig.out2 || ret=1
$PERL ../digcomp.pl dig.out1 dig.out2 || ret=1
awk '$4 == "SOA" { soacnt++} END {exit(soacnt == 1 ? 0 : 1);}' dig.out1 || ret=1
awk '$4 == "SOA" { exit($7 == 4 ? 0 : 1);}' dig.out1 || ret=1
# Should be incremental transfer.
$DIG ixfr=1 test -p 5300 @10.53.0.4 > dig.out3 || ret=1
$DIG ixfr=1 test -p 5300 @10.53.0.3 > dig.out3 || ret=1
awk '$4 == "SOA" { soacnt++} END {exit(soacnt == 6 ? 0 : 1);}' dig.out3 || ret=1
if [ ${ret} != 0 ]; then
echo "I:failed";
+6
View File
@@ -1106,7 +1106,13 @@
./bin/tests/system/ixfr/clean.sh SH 2001,2004,2007,2012,2014
./bin/tests/system/ixfr/ns1/.gitignore X 2012
./bin/tests/system/ixfr/ns1/startme X 2012,2013
./bin/tests/system/ixfr/ns3/.gitignore X 2012
./bin/tests/system/ixfr/ns3/mytest0.db ZONE 2011
./bin/tests/system/ixfr/ns3/mytest1.db ZONE 2011
./bin/tests/system/ixfr/ns3/mytest2.db ZONE 2011
./bin/tests/system/ixfr/ns3/named.conf CONF-C 2014
./bin/tests/system/ixfr/ns3/subtest0.db ZONE 2011
./bin/tests/system/ixfr/ns3/subtest1.db ZONE 2011
./bin/tests/system/ixfr/prereq.sh SH 2001,2004,2007,2012,2014
./bin/tests/system/ixfr/setup.sh SH 2001,2004,2007,2012,2014
./bin/tests/system/ixfr/tests.sh SH 2001,2004,2007,2011,2012,2014