diff --git a/bin/tests/system/ixfr/clean.sh b/bin/tests/system/ixfr/clean.sh index 54f9559505..d6e80edd42 100644 --- a/bin/tests/system/ixfr/clean.sh +++ b/bin/tests/system/ixfr/clean.sh @@ -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 + diff --git a/bin/tests/system/ixfr/ns3/.gitignore b/bin/tests/system/ixfr/ns3/.gitignore new file mode 100644 index 0000000000..58e5c9282d --- /dev/null +++ b/bin/tests/system/ixfr/ns3/.gitignore @@ -0,0 +1 @@ +named.conf diff --git a/bin/tests/system/ixfr/ns3/mytest0.db b/bin/tests/system/ixfr/ns3/mytest0.db new file mode 100644 index 0000000000..bd34c494d8 --- /dev/null +++ b/bin/tests/system/ixfr/ns3/mytest0.db @@ -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 diff --git a/bin/tests/system/ixfr/ns3/mytest1.db b/bin/tests/system/ixfr/ns3/mytest1.db new file mode 100644 index 0000000000..5c07fef911 --- /dev/null +++ b/bin/tests/system/ixfr/ns3/mytest1.db @@ -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 diff --git a/bin/tests/system/ixfr/ns3/mytest2.db b/bin/tests/system/ixfr/ns3/mytest2.db new file mode 100644 index 0000000000..8ac3cae100 --- /dev/null +++ b/bin/tests/system/ixfr/ns3/mytest2.db @@ -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 diff --git a/bin/tests/system/ixfr/ns3/named.conf b/bin/tests/system/ixfr/ns3/named.conf index e58114ecdc..d304ab8876 100644 --- a/bin/tests/system/ixfr/ns3/named.conf +++ b/bin/tests/system/ixfr/ns3/named.conf @@ -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"; diff --git a/bin/tests/system/ixfr/ns3/subtest0.db b/bin/tests/system/ixfr/ns3/subtest0.db new file mode 100644 index 0000000000..81c276ec0a --- /dev/null +++ b/bin/tests/system/ixfr/ns3/subtest0.db @@ -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 diff --git a/bin/tests/system/ixfr/ns3/subtest1.db b/bin/tests/system/ixfr/ns3/subtest1.db new file mode 100644 index 0000000000..db3577e637 --- /dev/null +++ b/bin/tests/system/ixfr/ns3/subtest1.db @@ -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 diff --git a/bin/tests/system/ixfr/setup.sh b/bin/tests/system/ixfr/setup.sh index 8cc51e9fc2..9715b06945 100644 --- a/bin/tests/system/ixfr/setup.sh +++ b/bin/tests/system/ixfr/setup.sh @@ -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 <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 diff --git a/bin/tests/system/ixfr/tests.sh b/bin/tests/system/ixfr/tests.sh index ad2bcf25de..39e850e38b 100644 --- a/bin/tests/system/ixfr/tests.sh +++ b/bin/tests/system/ixfr/tests.sh @@ -151,14 +151,20 @@ test ${messages:-0} -gt 1 || { echo "I:failed"; status=1; } echo "I:test 'dig +notcp ixfr=' vs 'dig ixfr= +notcp' vs 'dig ixfr='" 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"; diff --git a/util/copyrights b/util/copyrights index 88090509da..bc5c81665f 100644 --- a/util/copyrights +++ b/util/copyrights @@ -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