Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / builtin / tests.sh
blob3ff344dd7b0ec8b733c1e1116ba98e64fb9fbcd6
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
17 status=0
18 n=0
20 n=`expr $n + 1`
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
23 ret=0
24 grep "automatic empty zone" ns1/named.run > /dev/null || ret=1
25 grep "received control channel command 'reconfig'" ns1/named.run > /dev/null || ret=1
26 grep "reloading configuration succeeded" ns1/named.run > /dev/null || ret=1
27 sleep 1
28 grep "zone serial (0) unchanged." ns1/named.run > /dev/null && ret=1
29 if [ $ret != 0 ] ; then echo I:failed; status=`expr $status + $ret`; fi
31 n=`expr $n + 1`
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
34 ret=0
35 grep "automatic empty zone" ns1/named.run > /dev/null || ret=1
36 grep "received control channel command 'reload'" ns1/named.run > /dev/null || ret=1
37 grep "reloading configuration succeeded" ns1/named.run > /dev/null || ret=1
38 sleep 1
39 grep "zone serial (0) unchanged." ns1/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`
45 n=`expr $n + 1`
46 ret=0
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
52 n=`expr $n + 1`
53 ret=0
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
59 n=`expr $n + 1`
60 ret=0
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
66 n=`expr $n + 1`
67 ret=0
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
73 n=`expr $n + 1`
74 ret=0
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
80 n=`expr $n + 1`
81 ret=0
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
87 n=`expr $n + 1`
88 ret=0
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
95 n=`expr $n + 1`
96 ret=0
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
102 n=`expr $n + 1`
103 ret=0
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
109 n=`expr $n + 1`
110 ret=0
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
116 n=`expr $n + 1`
117 ret=0
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
123 exit $status