diff options
Diffstat (limited to 'bin/tests/system/upforwd')
-rw-r--r-- | bin/tests/system/upforwd/clean.sh | 26 | ||||
-rw-r--r-- | bin/tests/system/upforwd/knowngood.after1 | 10 | ||||
-rw-r--r-- | bin/tests/system/upforwd/knowngood.after2 | 11 | ||||
-rw-r--r-- | bin/tests/system/upforwd/knowngood.before | 8 | ||||
-rw-r--r-- | bin/tests/system/upforwd/knowngood.ns2.before | 6 | ||||
-rw-r--r-- | bin/tests/system/upforwd/ns1/example1.db | 24 | ||||
-rw-r--r-- | bin/tests/system/upforwd/ns1/named.conf | 44 | ||||
-rw-r--r-- | bin/tests/system/upforwd/ns2/named.conf | 39 | ||||
-rw-r--r-- | bin/tests/system/upforwd/ns3/named.conf | 40 | ||||
-rw-r--r-- | bin/tests/system/upforwd/setup.sh | 21 | ||||
-rw-r--r-- | bin/tests/system/upforwd/tests.sh | 103 |
11 files changed, 332 insertions, 0 deletions
diff --git a/bin/tests/system/upforwd/clean.sh b/bin/tests/system/upforwd/clean.sh new file mode 100644 index 0000000..5d4054e --- /dev/null +++ b/bin/tests/system/upforwd/clean.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2000, 2001 Internet Software Consortium. +# +# 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: clean.sh,v 1.9 2007/09/26 03:22:44 marka Exp $ + +# +# Clean up after zone transfer tests. +# + +rm -f dig.out.ns1 dig.out.ns2 dig.out.ns1 dig.out.ns3 dig.out.ns1.after +rm -f ns1/*.jnl ns2/*.jnl ns3/*.jnl ns1/example.db ns2/*.bk ns3/*.bk +rm -f */named.memstats diff --git a/bin/tests/system/upforwd/knowngood.after1 b/bin/tests/system/upforwd/knowngood.after1 new file mode 100644 index 0000000..7fc424c --- /dev/null +++ b/bin/tests/system/upforwd/knowngood.after1 @@ -0,0 +1,10 @@ +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 2 3600 1200 604800 7200 +example. 3600 IN NS ns2.example. +example. 3600 IN NS ns3.example. +ns1.example. 3600 IN A 10.53.0.1 +ns2.example. 3600 IN A 10.53.0.2 +ns3.example. 3600 IN A 10.53.0.3 +updated.example. 600 IN TXT "Foo" +updated.example. 600 IN A 10.10.10.1 +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 2 3600 1200 604800 7200 + diff --git a/bin/tests/system/upforwd/knowngood.after2 b/bin/tests/system/upforwd/knowngood.after2 new file mode 100644 index 0000000..eab7a2c --- /dev/null +++ b/bin/tests/system/upforwd/knowngood.after2 @@ -0,0 +1,11 @@ +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 3 3600 1200 604800 7200 +example. 3600 IN NS ns2.example. +example. 3600 IN NS ns3.example. +ns1.example. 3600 IN A 10.53.0.1 +ns2.example. 3600 IN A 10.53.0.2 +ns3.example. 3600 IN A 10.53.0.3 +unsigned.example. 600 IN TXT "Foo" +unsigned.example. 600 IN A 10.10.10.1 +updated.example. 600 IN TXT "Foo" +updated.example. 600 IN A 10.10.10.1 +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 3 3600 1200 604800 7200 diff --git a/bin/tests/system/upforwd/knowngood.before b/bin/tests/system/upforwd/knowngood.before new file mode 100644 index 0000000..4bde819 --- /dev/null +++ b/bin/tests/system/upforwd/knowngood.before @@ -0,0 +1,8 @@ +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 1 3600 1200 604800 7200 +example. 3600 IN NS ns2.example. +example. 3600 IN NS ns3.example. +ns1.example. 3600 IN A 10.53.0.1 +ns2.example. 3600 IN A 10.53.0.2 +ns3.example. 3600 IN A 10.53.0.3 +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 1 3600 1200 604800 7200 + diff --git a/bin/tests/system/upforwd/knowngood.ns2.before b/bin/tests/system/upforwd/knowngood.ns2.before new file mode 100644 index 0000000..bb3c355 --- /dev/null +++ b/bin/tests/system/upforwd/knowngood.ns2.before @@ -0,0 +1,6 @@ +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 1 3600 1200 604800 7200 +example. 3600 IN NS ns2.example. +ns1.example. 3600 IN A 10.53.0.1 +ns2.example. 3600 IN A 10.53.0.2 +example. 3600 IN SOA n1.example. hostmaster.ns1.example. 1 3600 1200 604800 7200 + diff --git a/bin/tests/system/upforwd/ns1/example1.db b/bin/tests/system/upforwd/ns1/example1.db new file mode 100644 index 0000000..940b9fd --- /dev/null +++ b/bin/tests/system/upforwd/ns1/example1.db @@ -0,0 +1,24 @@ +; Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") +; Copyright (C) 2000, 2001 Internet Software Consortium. +; +; 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: example1.db,v 1.4 2007/06/19 23:47:06 tbox Exp $ + +@ 3600 SOA n1.example. hostmaster.ns1.example. ( + 1 3600 1200 604800 7200 ) + NS ns2.example. + NS ns3.example. +ns1 A 10.53.0.1 +ns2 A 10.53.0.2 +ns3 A 10.53.0.3 diff --git a/bin/tests/system/upforwd/ns1/named.conf b/bin/tests/system/upforwd/ns1/named.conf new file mode 100644 index 0000000..8d9d2fa --- /dev/null +++ b/bin/tests/system/upforwd/ns1/named.conf @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001 Internet Software Consortium. + * + * 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: named.conf,v 1.11 2007/06/18 23:47:31 tbox Exp $ */ + +key "update.example." { + algorithm "hmac-md5"; + secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K"; +}; + +controls { /* empty */ }; + +options { + query-source address 10.53.0.1; + notify-source 10.53.0.1; + transfer-source 10.53.0.1; + port 5300; + pid-file "named.pid"; + listen-on { 10.53.0.1; }; + listen-on-v6 { none; }; + recursion yes; + acache-enable yes; + notify yes; +}; + +zone "example" { + type master; + file "example.db"; + allow-update { key update.example.; 10.53.0.3; }; +}; diff --git a/bin/tests/system/upforwd/ns2/named.conf b/bin/tests/system/upforwd/ns2/named.conf new file mode 100644 index 0000000..57ad4b0 --- /dev/null +++ b/bin/tests/system/upforwd/ns2/named.conf @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001 Internet Software Consortium. + * + * 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: named.conf,v 1.10 2007/06/18 23:47:31 tbox Exp $ */ + +controls { /* empty */ }; + +options { + query-source address 10.53.0.2; + notify-source 10.53.0.2; + transfer-source 10.53.0.2; + port 5300; + pid-file "named.pid"; + listen-on { 10.53.0.2; }; + listen-on-v6 { none; }; + recursion yes; + acache-enable yes; + notify yes; +}; + +zone "example" { + type slave; + file "example.bk"; + masters { 10.53.0.1; }; +}; diff --git a/bin/tests/system/upforwd/ns3/named.conf b/bin/tests/system/upforwd/ns3/named.conf new file mode 100644 index 0000000..b1fe854 --- /dev/null +++ b/bin/tests/system/upforwd/ns3/named.conf @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001 Internet Software Consortium. + * + * 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: named.conf,v 1.10 2007/06/18 23:47:31 tbox Exp $ */ + +controls { /* empty */ }; + +options { + query-source address 10.53.0.3; + notify-source 10.53.0.3; + transfer-source 10.53.0.3; + port 5300; + pid-file "named.pid"; + listen-on { 10.53.0.3; }; + listen-on-v6 { none; }; + recursion yes; + acache-enable yes; + notify yes; +}; + +zone "example" { + type slave; + file "example.bk"; + allow-update-forwarding { any; }; + masters { 10.53.0.1; }; +}; diff --git a/bin/tests/system/upforwd/setup.sh b/bin/tests/system/upforwd/setup.sh new file mode 100644 index 0000000..21a0e36 --- /dev/null +++ b/bin/tests/system/upforwd/setup.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2000, 2001 Internet Software Consortium. +# +# 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: setup.sh,v 1.8 2007/06/19 23:47:06 tbox Exp $ + +cp -f ns1/example1.db ns1/example.db +rm -f ns1/example.db.jnl ns2/example.bk ns2/example.bk.jnl diff --git a/bin/tests/system/upforwd/tests.sh b/bin/tests/system/upforwd/tests.sh new file mode 100644 index 0000000..81156c8 --- /dev/null +++ b/bin/tests/system/upforwd/tests.sh @@ -0,0 +1,103 @@ +#!/bin/sh +# +# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2000, 2001 Internet Software Consortium. +# +# 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: tests.sh,v 1.10 2007/06/19 23:47:06 tbox Exp $ + +# ns1 = stealth master +# ns2 = slave with update forwarding disabled; not currently used +# ns3 = slave with update forwarding enabled + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +status=0 + +echo "I:fetching master copy of zone before update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1 + +echo "I:fetching slave 1 copy of zone before update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1 + +echo "I:fetching slave 2 copy of zone before update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.3 axfr -p 5300 > dig.out.ns3 || status=1 + +echo "I:comparing pre-update copies to known good data" +$PERL ../digcomp.pl knowngood.before dig.out.ns1 || status=1 +$PERL ../digcomp.pl knowngood.before dig.out.ns2 || status=1 +$PERL ../digcomp.pl knowngood.before dig.out.ns3 || status=1 + +echo "I:updating zone (signed)" +$NSUPDATE -y update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K -- - <<EOF || status=1 +server 10.53.0.3 5300 +update add updated.example. 600 A 10.10.10.1 +update add updated.example. 600 TXT Foo +send +EOF + +echo "I:sleeping 15 seconds for server to incorporate changes" +sleep 15 + +echo "I:fetching master copy of zone after update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1 + +echo "I:fetching slave 1 copy of zone after update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1 + +echo "I:fetching slave 2 copy of zone after update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.3 axfr -p 5300 > dig.out.ns3 || status=1 + +echo "I:comparing post-update copies to known good data" +$PERL ../digcomp.pl knowngood.after1 dig.out.ns1 || status=1 +$PERL ../digcomp.pl knowngood.after1 dig.out.ns2 || status=1 +$PERL ../digcomp.pl knowngood.after1 dig.out.ns3 || status=1 + +echo "I:updating zone (unsigned)" +$NSUPDATE -- - <<EOF || status=1 +server 10.53.0.3 5300 +update add unsigned.example. 600 A 10.10.10.1 +update add unsigned.example. 600 TXT Foo +send +EOF + +echo "I:sleeping 15 seconds for server to incorporate changes" +sleep 15 + +echo "I:fetching master copy of zone after update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1 + +echo "I:fetching slave 1 copy of zone after update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1 + +echo "I:fetching slave 2 copy of zone after update" +$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\ + @10.53.0.3 axfr -p 5300 > dig.out.ns3 || status=1 + +echo "I:comparing post-update copies to known good data" +$PERL ../digcomp.pl knowngood.after2 dig.out.ns1 || status=1 +$PERL ../digcomp.pl knowngood.after2 dig.out.ns2 || status=1 +$PERL ../digcomp.pl knowngood.after2 dig.out.ns3 || status=1 + +echo "I:exit status: $status" +exit $status |