1 # Copyright (C) 2011, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
3 # Permission to use, copy, modify, and/or distribute this software for any
4 # purpose with or without fee is hereby granted, provided that the above
5 # copyright notice and this permission notice appear in all copies.
7 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13 # PERFORMANCE OF THIS SOFTWARE.
15 # Id: tests.sh,v 1.3 2011/08/09 04:12:25 tbox Exp
21 echo "I:Checking that reconfiguring empty zones is silent ($n)"
22 $RNDC -c ..
/common
/rndc.conf
-s 10.53.0.1 -p 9953 reconfig
24 grep "automatic empty zone" ns
1/named.run
> /dev
/null || ret
=1
25 grep "received control channel command 'reconfig'" ns
1/named.run
> /dev
/null || ret
=1
26 grep "reloading configuration succeeded" ns
1/named.run
> /dev
/null || ret
=1
28 grep "zone serial (0) unchanged." ns
1/named.run
> /dev
/null
&& ret
=1
29 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
32 echo "I:Checking that reloading empty zones is silent ($n)"
33 $RNDC -c ..
/common
/rndc.conf
-s 10.53.0.1 -p 9953 reload
> /dev
/null
35 grep "automatic empty zone" ns
1/named.run
> /dev
/null || ret
=1
36 grep "received control channel command 'reload'" ns
1/named.run
> /dev
/null || ret
=1
37 grep "reloading configuration succeeded" ns
1/named.run
> /dev
/null || ret
=1
39 grep "zone serial (0) unchanged." ns
1/named.run
> /dev
/null
&& ret
=1
40 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
42 VERSION
=`../../../../isc-config.sh --version | cut -d = -f 2`
43 HOSTNAME
=`./gethostname`
47 echo "I:Checking that default version works for rndc ($n)"
48 $RNDC -c ..
/common
/rndc.conf
-s 10.53.0.1 -p 9953 status
> rndc.status.ns1.
$n 2>&1
49 grep "^version: $VERSION " rndc.status.ns1.
$n > /dev
/null || ret
=1
50 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
54 echo "I:Checking that custom version works for rndc ($n)"
55 $RNDC -c ..
/common
/rndc.conf
-s 10.53.0.3 -p 9953 status
> rndc.status.ns3.
$n 2>&1
56 grep "^version: $VERSION (this is a test of version) " rndc.status.ns3.
$n > /dev
/null || ret
=1
57 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
61 echo "I:Checking that default version works for query ($n)"
62 $DIG +short version.
bind txt ch @
10.53.0.1 -p 5300 > dig.out.ns1.
$n
63 grep "^\"$VERSION\"$" dig.out.ns1.
$n > /dev
/null || ret
=1
64 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
68 echo "I:Checking that custom version works for query ($n)"
69 $DIG +short version.
bind txt ch @
10.53.0.3 -p 5300 > dig.out.ns3.
$n
70 grep "^\"this is a test of version\"$" dig.out.ns3.
$n > /dev
/null || ret
=1
71 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
75 echo "I:Checking that default hostname works for query ($n)"
76 $DIG +short hostname.
bind txt ch @
10.53.0.1 -p 5300 > dig.out.ns1.
$n
77 grep "^\"$HOSTNAME\"$" dig.out.ns1.
$n > /dev
/null || ret
=1
78 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
82 echo "I:Checking that custom hostname works for query ($n)"
83 $DIG +short hostname.
bind txt ch @
10.53.0.3 -p 5300 > dig.out.ns3.
$n
84 grep "^\"this.is.a.test.of.hostname\"$" dig.out.ns3.
$n > /dev
/null || ret
=1
85 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
89 echo "I:Checking that default server-id is none for query ($n)"
90 $DIG id.server txt ch @
10.53.0.1 -p 5300 > dig.out.ns1.
$n
91 grep "status: NOERROR" dig.out.ns1.
$n > /dev
/null || ret
=1
92 grep "ANSWER: 0" dig.out.ns1.
$n > /dev
/null || ret
=1
93 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
97 echo "I:Checking that server-id hostname works for query ($n)"
98 $DIG +short id.server txt ch @
10.53.0.2 -p 5300 > dig.out.ns2.
$n
99 grep "^\"$HOSTNAME\"$" dig.out.ns2.
$n > /dev
/null || ret
=1
100 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
104 echo "I:Checking that server-id hostname works for EDNS name server ID request ($n)"
105 $DIG +norec
+nsid foo @
10.53.0.2 -p 5300 > dig.out.ns2.
$n
106 grep "^; NSID: .* (\"$HOSTNAME\")$" dig.out.ns2.
$n > /dev
/null || ret
=1
107 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
111 echo "I:Checking that custom server-id works for query ($n)"
112 $DIG +short id.server txt ch @
10.53.0.3 -p 5300 > dig.out.ns3.
$n
113 grep "^\"this.is.a.test.of.server-id\"$" dig.out.ns3.
$n > /dev
/null || ret
=1
114 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi
118 echo "I:Checking that custom server-id works for EDNS name server ID request ($n)"
119 $DIG +norec
+nsid foo @
10.53.0.3 -p 5300 > dig.out.ns3.
$n
120 grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" dig.out.ns3.
$n > /dev
/null || ret
=1
121 if [ $ret != 0 ] ; then echo I
:failed
; status
=`expr $status + $ret`; fi