No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / ixfr / tests.sh
blob12b178424fa8c87ca73754efcdb8e1b697baa723
1 #!/bin/sh
3 # Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 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.5 2007/06/19 23:47:03 tbox Exp
20 SYSTEMTESTTOP=..
21 . $SYSTEMTESTTOP/conf.sh
23 status=0
25 DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd"
26 DIGCMD="$DIG $DIGOPTS @10.53.0.1 -p 5300"
27 SENDCMD="$PERL ../send.pl 10.53.0.2 5301"
28 RNDCCMD="$RNDC -s 10.53.0.1 -p 9953 -c ../common/rndc.conf"
30 echo "I:testing initial AXFR"
32 $SENDCMD <<EOF
33 /SOA/
34 nil. 300 SOA ns.nil. root.nil. 1 300 300 604800 300
35 /AXFR/
36 nil. 300 SOA ns.nil. root.nil. 1 300 300 604800 300
37 nil. 300 NS ns.nil.
38 nil. 300 TXT "initial AXFR"
39 a.nil. 60 A 10.0.0.61
40 b.nil. 60 A 10.0.0.62
41 nil. 300 SOA ns.nil. root.nil. 1 300 300 604800 300
42 EOF
44 sleep 1
46 # Initially, ns1 is not authoritative for anything (see setup.sh).
47 # Now that ans is up and running with the right data, we make it
48 # a slave for nil.
50 cat <<EOF >>ns1/named.conf
51 zone "nil" {
52 type slave;
53 file "myftp.db";
54 masters { 10.53.0.2; };
56 EOF
58 $RNDCCMD reload
60 sleep 2
62 $DIGCMD nil. TXT | grep 'initial AXFR' >/dev/null || {
63 echo "I:failed"
64 status=1
67 echo "I:testing successful IXFR"
69 # We change the IP address of a.nil., and the TXT record at the apex.
70 # Then we do a SOA-only update.
72 $SENDCMD <<EOF
73 /SOA/
74 nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
75 /IXFR/
76 nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
77 nil. 300 SOA ns.nil. root.nil. 1 300 300 604800 300
78 a.nil. 60 A 10.0.0.61
79 nil. 300 TXT "initial AXFR"
80 nil. 300 SOA ns.nil. root.nil. 2 300 300 604800 300
81 nil. 300 TXT "successful IXFR"
82 a.nil. 60 A 10.0.1.61
83 nil. 300 SOA ns.nil. root.nil. 2 300 300 604800 300
84 nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
85 nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
86 EOF
88 sleep 1
90 $RNDCCMD refresh nil
92 sleep 2
94 $DIGCMD nil. TXT | grep 'successful IXFR' >/dev/null || {
95 echo "I:failed"
96 status=1
99 echo "I:testing AXFR fallback after IXFR failure"
101 # Provide a broken IXFR response and a working fallback AXFR response
103 $SENDCMD <<EOF
104 /SOA/
105 nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
106 /IXFR/
107 nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
108 nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
109 nil. 300 TXT "delete-nonexistent-txt-record"
110 nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
111 nil. 300 TXT "this-txt-record-would-be-added"
112 nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
113 /AXFR/
114 nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
115 nil. 300 NS ns.nil.
116 nil. 300 TXT "fallback AXFR"
117 nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
120 sleep 1
122 $RNDCCMD refresh nil
124 sleep 2
126 $DIGCMD nil. TXT | grep 'fallback AXFR' >/dev/null || {
127 echo "I:failed"
128 status=1
131 echo "I:exit status: $status"
132 exit $status