No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / upforwd / tests.sh
blobe5bd2f5960d7375130d19f09c171d89d7af1e664
1 #!/bin/sh
3 # Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000, 2001 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
18 # Id: tests.sh,v 1.10 2007/06/19 23:47:06 tbox Exp
20 # ns1 = stealth master
21 # ns2 = slave with update forwarding disabled; not currently used
22 # ns3 = slave with update forwarding enabled
24 SYSTEMTESTTOP=..
25 . $SYSTEMTESTTOP/conf.sh
27 status=0
29 echo "I:fetching master copy of zone before update"
30 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
31 @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1
33 echo "I:fetching slave 1 copy of zone before update"
34 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
35 @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1
37 echo "I:fetching slave 2 copy of zone before update"
38 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
39 @10.53.0.3 axfr -p 5300 > dig.out.ns3 || status=1
41 echo "I:comparing pre-update copies to known good data"
42 $PERL ../digcomp.pl knowngood.before dig.out.ns1 || status=1
43 $PERL ../digcomp.pl knowngood.before dig.out.ns2 || status=1
44 $PERL ../digcomp.pl knowngood.before dig.out.ns3 || status=1
46 echo "I:updating zone (signed)"
47 $NSUPDATE -y update.example:c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K -- - <<EOF || status=1
48 server 10.53.0.3 5300
49 update add updated.example. 600 A 10.10.10.1
50 update add updated.example. 600 TXT Foo
51 send
52 EOF
54 echo "I:sleeping 15 seconds for server to incorporate changes"
55 sleep 15
57 echo "I:fetching master copy of zone after update"
58 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
59 @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1
61 echo "I:fetching slave 1 copy of zone after update"
62 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
63 @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1
65 echo "I:fetching slave 2 copy of zone after update"
66 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
67 @10.53.0.3 axfr -p 5300 > dig.out.ns3 || status=1
69 echo "I:comparing post-update copies to known good data"
70 $PERL ../digcomp.pl knowngood.after1 dig.out.ns1 || status=1
71 $PERL ../digcomp.pl knowngood.after1 dig.out.ns2 || status=1
72 $PERL ../digcomp.pl knowngood.after1 dig.out.ns3 || status=1
74 echo "I:updating zone (unsigned)"
75 $NSUPDATE -- - <<EOF || status=1
76 server 10.53.0.3 5300
77 update add unsigned.example. 600 A 10.10.10.1
78 update add unsigned.example. 600 TXT Foo
79 send
80 EOF
82 echo "I:sleeping 15 seconds for server to incorporate changes"
83 sleep 15
85 echo "I:fetching master copy of zone after update"
86 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
87 @10.53.0.1 axfr -p 5300 > dig.out.ns1 || status=1
89 echo "I:fetching slave 1 copy of zone after update"
90 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
91 @10.53.0.2 axfr -p 5300 > dig.out.ns2 || status=1
93 echo "I:fetching slave 2 copy of zone after update"
94 $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.\
95 @10.53.0.3 axfr -p 5300 > dig.out.ns3 || status=1
97 echo "I:comparing post-update copies to known good data"
98 $PERL ../digcomp.pl knowngood.after2 dig.out.ns1 || status=1
99 $PERL ../digcomp.pl knowngood.after2 dig.out.ns2 || status=1
100 $PERL ../digcomp.pl knowngood.after2 dig.out.ns3 || status=1
102 echo "I:exit status: $status"
103 exit $status