Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / legacy / tests.sh
blob4911337b9479b1d051990a539414f7fd3faa8182
1 #!/bin/sh
3 # Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
17 # Id
19 SYSTEMTESTTOP=..
20 . $SYSTEMTESTTOP/conf.sh
22 status=0
23 n=0
25 n=`expr $n + 1`
26 echo "I:checking drop edns server setup ($n)"
27 ret=0
28 $DIG +edns @10.53.0.2 -p 5300 dropedns soa > dig.out.1.test$n
29 grep "connection timed out; no servers could be reached" dig.out.1.test$n > /dev/null || ret=1
30 $DIG +noedns @10.53.0.2 -p 5300 dropedns soa > dig.out.2.test$n || ret=1
31 grep "status: NOERROR" dig.out.2.test$n > /dev/null || ret=1
32 grep "EDNS: version:" dig.out.2.test$n > /dev/null && ret=1
33 $DIG +noedns +tcp @10.53.0.2 -p 5300 dropedns soa > dig.out.3.test$n || ret=1
34 grep "status: NOERROR" dig.out.3.test$n > /dev/null || ret=1
35 grep "EDNS: version:" dig.out.3.test$n > /dev/null && ret=1
36 $DIG +edns +tcp @10.53.0.2 -p 5300 dropedns soa > dig.out.4.test$n
37 grep "connection timed out; no servers could be reached" dig.out.4.test$n > /dev/null || ret=1
38 if [ $ret != 0 ]; then echo "I:failed"; fi
39 status=`expr $status + $ret`
41 n=`expr $n + 1`
42 echo "I:checking recursive lookup to drop edns server succeeds ($n)"
43 ret=0
44 $DIG +tcp @10.53.0.1 -p 5300 dropedns soa > dig.out.test$n || ret=1
45 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
46 if [ $ret != 0 ]; then echo "I:failed"; fi
47 status=`expr $status + $ret`
49 n=`expr $n + 1`
50 echo "I:checking drop edns + no tcp server setup ($n)"
51 ret=0
52 $DIG +edns @10.53.0.3 -p 5300 dropedns-notcp soa > dig.out.1.test$n
53 grep "connection timed out; no servers could be reached" dig.out.1.test$n > /dev/null || ret=1
54 $DIG +noedns +tcp @10.53.0.3 -p 5300 dropedns-notcp soa > dig.out.2.test$n
55 grep "connection timed out; no servers could be reached" dig.out.2.test$n > /dev/null
56 $DIG +noedns @10.53.0.3 -p 5300 dropedns-notcp soa > dig.out.3.test$n || ret=1
57 grep "status: NOERROR" dig.out.3.test$n > /dev/null || ret=1
58 grep "EDNS: version:" dig.out.3.test$n > /dev/null && ret=1
59 if [ $ret != 0 ]; then echo "I:failed"; fi
60 status=`expr $status + $ret`
62 n=`expr $n + 1`
63 echo "I:checking recursive lookup to drop edns + no tcp server succeeds ($n)"
64 ret=0
65 $DIG +tcp @10.53.0.1 -p 5300 dropedns-notcp soa > dig.out.test$n || ret=1
66 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
67 if [ $ret != 0 ]; then echo "I:failed"; fi
68 status=`expr $status + $ret`
70 n=`expr $n + 1`
71 echo "I:checking plain dns server setup ($n)"
72 ret=0
73 $DIG +edns @10.53.0.4 -p 5300 plain soa > dig.out.1.test$n || ret=1
74 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
75 grep "EDNS: version:" dig.out.1.test$n > /dev/null && ret=1
76 if [ $ret != 0 ]; then echo "I:failed"; fi
77 status=`expr $status + $ret`
79 n=`expr $n + 1`
80 echo "I:checking recursive lookup to plain dns server succeeds ($n)"
81 ret=0
82 $DIG +tcp @10.53.0.1 -p 5300 plain soa > dig.out.test$n || ret=1
83 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
84 if [ $ret != 0 ]; then echo "I:failed"; fi
85 status=`expr $status + $ret`
87 n=`expr $n + 1`
88 echo "I:checking plain dns + no tcp server setup ($n)"
89 ret=0
90 $DIG +edns @10.53.0.5 -p 5300 plain-notcp soa > dig.out.1.test$n || ret=1
91 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
92 grep "EDNS: version:" dig.out.1.test$n > /dev/null && ret=1
93 $DIG +edns +tcp @10.53.0.5 -p 5300 plain-notcp soa > dig.out.2.test$n
94 grep "connection timed out; no servers could be reached" dig.out.2.test$n > /dev/null
95 if [ $ret != 0 ]; then echo "I:failed"; fi
96 status=`expr $status + $ret`
98 n=`expr $n + 1`
99 echo "I:checking recursive lookup to plain dns + no tcp server succeeds ($n)"
100 ret=0
101 $DIG +tcp @10.53.0.1 -p 5300 plain-notcp soa > dig.out.test$n || ret=1
102 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
103 if [ $ret != 0 ]; then echo "I:failed"; fi
104 status=`expr $status + $ret`
105 n=`expr $n + 1`
107 echo "I:checking edns 512 server setup ($n)"
108 ret=0
109 $DIG +edns @10.53.0.6 -p 5300 edns512 soa > dig.out.1.test$n || ret=1
110 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
111 $DIG +edns +tcp @10.53.0.6 -p 5300 edns512 soa > dig.out.2.test$n || ret=1
112 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
113 $DIG +edns @10.53.0.6 -p 5300 txt500.edns512 txt > dig.out.3.test$n
114 grep "connection timed out; no servers could be reached" dig.out.3.test$n > /dev/null
115 $DIG +edns +bufsize=512 +ignor @10.53.0.6 -p 5300 txt500.edns512 txt > dig.out.4.test$n
116 grep "status: NOERROR" dig.out.4.test$n > /dev/null || ret=1
117 if [ $ret != 0 ]; then echo "I:failed"; fi
118 status=`expr $status + $ret`
120 n=`expr $n + 1`
121 echo "I:checking recursive lookup to edns 512 server succeeds ($n)"
122 ret=0
123 $DIG +tcp @10.53.0.1 -p 5300 txt500.edns512 txt > dig.out.test$n || ret=1
124 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
125 if [ $ret != 0 ]; then echo "I:failed"; fi
126 status=`expr $status + $ret`
128 n=`expr $n + 1`
129 echo "I:checking edns 512 + no tcp server setup ($n)"
130 ret=0
131 $DIG +noedns @10.53.0.7 -p 5300 edns512-notcp soa > dig.out.1.test$n || ret=1
132 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
133 $DIG +noedns +tcp @10.53.0.7 -p 5300 edns512-notcp soa > dig.out.2.test$n
134 grep "connection timed out; no servers could be reached" dig.out.2.test$n > /dev/null
135 $DIG +edns @10.53.0.7 -p 5300 edns512-notcp soa > dig.out.3.test$n
136 grep "connection timed out; no servers could be reached" dig.out.3.test$n > /dev/null
137 $DIG +edns +bufsize=512 +ignor @10.53.0.7 -p 5300 edns512-notcp soa > dig.out.4.test$n
138 grep "status: NOERROR" dig.out.4.test$n > /dev/null || ret=1
139 if [ $ret != 0 ]; then echo "I:failed"; fi
140 status=`expr $status + $ret`
142 n=`expr $n + 1`
143 echo "I:checking recursive lookup to edns 512 + no tcp server succeeds ($n)"
144 ret=0
145 $DIG +tcp @10.53.0.1 -p 5300 edns512-notcp soa > dig.out.test$n || ret=1
146 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
147 if [ $ret != 0 ]; then echo "I:failed"; fi
148 status=`expr $status + $ret`
150 if $SHELL ../testcrypto.sh > /dev/null 2>&1
151 then
152 $PERL $SYSTEMTESTTOP/stop.pl . ns1
154 cp -f ns1/named2.conf ns1/named.conf
156 $PERL $SYSTEMTESTTOP/start.pl --noclean --restart . ns1
158 n=`expr $n + 1`
159 echo "I:checking recursive lookup to edns 512 + no tcp + trust anchor fails ($n)"
160 ret=0
161 $DIG +tcp @10.53.0.1 -p 5300 edns512-notcp soa > dig.out.test$n
162 grep "status: SERVFAIL" dig.out.test$n > /dev/null ||
163 grep "connection timed out;" dig.out.test$n > /dev/null || ret=1
164 if [ $ret != 0 ]; then echo "I:failed"; fi
165 status=`expr $status + $ret`
166 else
167 echo "I:skipping checking recursive lookup to edns 512 + no tcp + trust anchor fails as crypto not enabled"
171 echo "I:exit status: $status"
172 exit $status