Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / reclimit / tests.sh
blob158ef5948e48b31b317dc6c9671514b0930a3b20
1 #!/bin/sh
3 # Copyright (C) 2014 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 SYSTEMTESTTOP=..
18 . $SYSTEMTESTTOP/conf.sh
20 DIGOPTS="-p 5300"
22 status=0
23 n=0
25 n=`expr $n + 1`
26 echo "I: attempt excessive-depth lookup ($n)"
27 ret=0
28 echo "1000" > ans2/ans.limit
29 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
30 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
31 grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
32 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
33 eval count=`cat dig.out.2.test$n`
34 [ $count -eq 26 ] || ret=1
35 if [ $ret != 0 ]; then echo "I:failed"; fi
36 status=`expr $status + $ret`
38 n=`expr $n + 1`
39 echo "I: attempt permissible lookup ($n)"
40 ret=0
41 echo "12" > ans2/ans.limit
42 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
43 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
44 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
45 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
46 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
47 eval count=`cat dig.out.2.test$n`
48 [ $count -eq 49 ] || ret=1
49 if [ $ret != 0 ]; then echo "I:failed"; fi
50 status=`expr $status + $ret`
52 echo "I:reset max-recursion-depth"
53 cp ns3/named2.conf ns3/named.conf
54 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
55 sleep 2
57 n=`expr $n + 1`
58 echo "I: attempt excessive-depth lookup ($n)"
59 ret=0
60 echo "12" > ans2/ans.limit
61 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
62 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
63 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
64 grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
65 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
66 eval count=`cat dig.out.2.test$n`
67 [ $count -eq 12 ] || ret=1
68 if [ $ret != 0 ]; then echo "I:failed"; fi
69 status=`expr $status + $ret`
71 n=`expr $n + 1`
72 echo "I: attempt permissible lookup ($n)"
73 ret=0
74 echo "5" > ans2/ans.limit
75 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
76 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
77 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
78 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
79 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
80 eval count=`cat dig.out.2.test$n`
81 [ $count -eq 21 ] || ret=1
82 if [ $ret != 0 ]; then echo "I:failed"; fi
83 status=`expr $status + $ret`
85 echo "I:reset max-recursion-depth"
86 cp ns3/named3.conf ns3/named.conf
87 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
88 sleep 2
90 n=`expr $n + 1`
91 echo "I: attempt excessive-queries lookup ($n)"
92 ret=0
93 echo "13" > ans2/ans.limit
94 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
95 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
96 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
97 grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
98 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
99 eval count=`cat dig.out.2.test$n`
100 [ $count -le 50 ] || ret=1
101 if [ $ret != 0 ]; then echo "I:failed"; fi
102 status=`expr $status + $ret`
104 n=`expr $n + 1`
105 echo "I: attempt permissible lookup ($n)"
106 ret=0
107 echo "12" > ans2/ans.limit
108 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
109 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
110 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
111 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
112 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
113 eval count=`cat dig.out.2.test$n`
114 [ $count -le 50 ] || ret=1
115 if [ $ret != 0 ]; then echo "I:failed"; fi
116 status=`expr $status + $ret`
118 echo "I:reset max-recursion-queries"
119 cp ns3/named4.conf ns3/named.conf
120 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
121 sleep 2
123 n=`expr $n + 1`
124 echo "I: attempt excessive-queries lookup ($n)"
125 ret=0
126 echo "10" > ans2/ans.limit
127 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
128 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
129 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
130 grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
131 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
132 eval count=`cat dig.out.2.test$n`
133 [ $count -le 40 ] || ret=1
134 if [ $ret != 0 ]; then echo "I:failed"; fi
135 status=`expr $status + $ret`
137 n=`expr $n + 1`
138 echo "I: attempt permissible lookup ($n)"
139 ret=0
140 echo "9" > ans2/ans.limit
141 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
142 $DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
143 $DIG $DIGOPTS @10.53.0.3 indirect.example.org > dig.out.1.test$n || ret=1
144 grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
145 $DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
146 eval count=`cat dig.out.2.test$n`
147 [ $count -le 40 ] || ret=1
148 if [ $ret != 0 ]; then echo "I:failed"; fi
149 status=`expr $status + $ret`
151 n=`expr $n + 1`
152 echo "I: attempting NS explosion ($n)"
153 ret=0
154 $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
155 $DIG $DIGOPTS +short @10.53.0.3 ns1.1.example.net > dig.out.1.test$n || ret=1
156 sleep 2
157 $DIG $DIGOPTS +short @10.53.0.4 count txt > dig.out.2.test$n || ret=1
158 eval count=`cat dig.out.2.test$n`
159 [ $count -lt 50 ] || ret=1
160 $DIG $DIGOPTS +short @10.53.0.7 count txt > dig.out.3.test$n || ret=1
161 eval count=`cat dig.out.3.test$n`
162 [ $count -lt 50 ] || ret=1
163 if [ $ret != 0 ]; then echo "I:failed"; fi
164 status=`expr $status + $ret`
166 echo "I:exit status: $status"
167 exit $status