3 # Copyright (C) 2009 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: tests.sh,v 1.4 2009/12/02 05:42:15 each Exp
20 .
$SYSTEMTESTTOP/conf.sh
26 DIGOPTS
="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"
28 echo "I:converting zones from nsec to nsec3"
29 $NSUPDATE > /dev
/null
<<END || status=1
31 zone nsec3.nsec3.example.
32 update add nsec3.nsec3.example. 3600 NSEC3PARAM 1 0 10 BEEF
34 zone optout.nsec3.example.
35 update add optout.nsec3.example. 3600 NSEC3PARAM 1 1 10 BEEF
38 update add nsec3.example. 3600 NSEC3PARAM 1 0 10 BEEF
40 zone nsec3.optout.example.
41 update add nsec3.optout.example. 3600 NSEC3PARAM 1 0 10 BEEF
43 zone optout.optout.example.
44 update add optout.optout.example. 3600 NSEC3PARAM 1 1 10 BEEF
47 update add optout.example. 3600 NSEC3PARAM 1 1 10 BEEF
51 echo "I:waiting 30 seconds for key changes to take effect"
54 # Send rndc freeze command to ns1, ns2 and ns3, to force the dynamically
55 # signed zones to be dumped to their zone files
56 echo "I:dumping zone files"
57 $RNDC -c ..
/common
/rndc.conf
-s 10.53.0.1 -p 9953 freeze
2>&1 |
sed 's/^/I:ns1 /'
58 $RNDC -c ..
/common
/rndc.conf
-s 10.53.0.2 -p 9953 freeze
2>&1 |
sed 's/^/I:ns2 /'
59 $RNDC -c ..
/common
/rndc.conf
-s 10.53.0.3 -p 9953 freeze
2>&1 |
sed 's/^/I:ns3 /'
61 # Check the example. domain
63 echo "I:checking that zone transfer worked ($n)"
65 $DIG $DIGOPTS a.example. @
10.53.0.2 a
> dig.out.ns2.
test$n || ret
=1
66 $DIG $DIGOPTS a.example. @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
67 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns3.
test$n || ret
=1
69 if [ $ret != 0 ]; then echo "I:failed"; fi
70 status
=`expr $status + $ret`
72 echo "I:checking positive validation NSEC ($n)"
74 $DIG $DIGOPTS +noauth a.example. @
10.53.0.2 a
> dig.out.ns2.
test$n || ret
=1
75 $DIG $DIGOPTS +noauth a.example. @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
76 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
77 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
79 if [ $ret != 0 ]; then echo "I:failed"; fi
80 status
=`expr $status + $ret`
82 echo "I:checking positive validation NSEC3 ($n)"
84 $DIG $DIGOPTS +noauth a.nsec3.example. \
85 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
86 $DIG $DIGOPTS +noauth a.nsec3.example. \
87 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
88 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
89 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
91 if [ $ret != 0 ]; then echo "I:failed"; fi
92 status
=`expr $status + $ret`
94 echo "I:checking positive validation OPTOUT ($n)"
96 $DIG $DIGOPTS +noauth a.optout.example. \
97 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
98 $DIG $DIGOPTS +noauth a.optout.example. \
99 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
100 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
101 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
103 if [ $ret != 0 ]; then echo "I:failed"; fi
104 status
=`expr $status + $ret`
106 echo "I:checking negative validation NXDOMAIN NSEC ($n)"
108 $DIG $DIGOPTS +noauth q.example. @
10.53.0.2 a
> dig.out.ns2.
test$n || ret
=1
109 $DIG $DIGOPTS +noauth q.example. @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
110 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
111 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
112 grep "status: NXDOMAIN" dig.out.ns4.
test$n > /dev
/null || ret
=1
114 if [ $ret != 0 ]; then echo "I:failed"; fi
115 status
=`expr $status + $ret`
117 echo "I:checking negative validation NXDOMAIN NSEC3 ($n)"
119 $DIG $DIGOPTS +noauth q.nsec3.example. \
120 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
121 $DIG $DIGOPTS +noauth q.nsec3.example. \
122 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
123 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
124 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
125 grep "status: NXDOMAIN" dig.out.ns4.
test$n > /dev
/null || ret
=1
127 if [ $ret != 0 ]; then echo "I:failed"; fi
128 status
=`expr $status + $ret`
130 echo "I:checking negative validation NXDOMAIN OPTOUT ($n)"
132 $DIG $DIGOPTS +noauth q.optout.example. \
133 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
134 $DIG $DIGOPTS +noauth q.optout.example. \
135 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
136 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
137 grep "status: NXDOMAIN" dig.out.ns4.
test$n > /dev
/null || ret
=1
138 # Note - this is looking for failure, hence the &&
139 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
141 if [ $ret != 0 ]; then echo "I:failed"; fi
142 status
=`expr $status + $ret`
144 echo "I:checking negative validation NODATA NSEC ($n)"
146 $DIG $DIGOPTS +noauth a.example. @
10.53.0.2 txt
> dig.out.ns2.
test$n || ret
=1
147 $DIG $DIGOPTS +noauth a.example. @
10.53.0.4 txt
> dig.out.ns4.
test$n || ret
=1
148 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
149 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
150 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
151 grep "ANSWER: 0" dig.out.ns4.
test$n > /dev
/null || ret
=1
153 if [ $ret != 0 ]; then echo "I:failed"; fi
154 status
=`expr $status + $ret`
156 echo "I:checking negative validation NODATA NSEC3 ($n)"
158 $DIG $DIGOPTS +noauth a.nsec3.example. \
159 @
10.53.0.3 txt
> dig.out.ns3.
test$n || ret
=1
160 $DIG $DIGOPTS +noauth a.nsec3.example. \
161 @
10.53.0.4 txt
> dig.out.ns4.
test$n || ret
=1
162 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
163 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
164 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
165 grep "ANSWER: 0" dig.out.ns4.
test$n > /dev
/null || ret
=1
167 if [ $ret != 0 ]; then echo "I:failed"; fi
168 status
=`expr $status + $ret`
170 echo "I:checking negative validation NODATA OPTOUT ($n)"
172 $DIG $DIGOPTS +noauth a.optout.example. \
173 @
10.53.0.3 txt
> dig.out.ns3.
test$n || ret
=1
174 $DIG $DIGOPTS +noauth a.optout.example. \
175 @
10.53.0.4 txt
> dig.out.ns4.
test$n || ret
=1
176 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
177 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
178 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
179 grep "ANSWER: 0" dig.out.ns4.
test$n > /dev
/null || ret
=1
181 if [ $ret != 0 ]; then echo "I:failed"; fi
182 status
=`expr $status + $ret`
184 # Check the insecure.example domain
186 echo "I:checking 1-server insecurity proof NSEC ($n)"
188 $DIG $DIGOPTS +noauth a.insecure.example. @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
189 $DIG $DIGOPTS +noauth a.insecure.example. @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
190 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
191 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
192 # Note - this is looking for failure, hence the &&
193 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
195 if [ $ret != 0 ]; then echo "I:failed"; fi
196 status
=`expr $status + $ret`
198 echo "I:checking 1-server negative insecurity proof NSEC ($n)"
200 $DIG $DIGOPTS q.insecure.example. a @
10.53.0.3 \
201 > dig.out.ns3.
test$n || ret
=1
202 $DIG $DIGOPTS q.insecure.example. a @
10.53.0.4 \
203 > dig.out.ns4.
test$n || ret
=1
204 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
205 grep "status: NXDOMAIN" dig.out.ns4.
test$n > /dev
/null || ret
=1
206 # Note - this is looking for failure, hence the &&
207 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
209 if [ $ret != 0 ]; then echo "I:failed"; fi
210 status
=`expr $status + $ret`
212 # Check the secure.example domain
214 echo "I:checking multi-stage positive validation NSEC/NSEC ($n)"
216 $DIG $DIGOPTS +noauth a.secure.example. \
217 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
218 $DIG $DIGOPTS +noauth a.secure.example. \
219 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
220 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
221 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
222 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
224 if [ $ret != 0 ]; then echo "I:failed"; fi
225 status
=`expr $status + $ret`
227 echo "I:checking multi-stage positive validation NSEC/NSEC3 ($n)"
229 $DIG $DIGOPTS +noauth a.nsec3.example. \
230 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
231 $DIG $DIGOPTS +noauth a.nsec3.example. \
232 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
233 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
234 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
235 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
237 if [ $ret != 0 ]; then echo "I:failed"; fi
238 status
=`expr $status + $ret`
240 echo "I:checking multi-stage positive validation NSEC/OPTOUT ($n)"
242 $DIG $DIGOPTS +noauth a.optout.example. \
243 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
244 $DIG $DIGOPTS +noauth a.optout.example. \
245 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
246 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
247 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
248 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
250 if [ $ret != 0 ]; then echo "I:failed"; fi
251 status
=`expr $status + $ret`
253 echo "I:checking multi-stage positive validation NSEC3/NSEC ($n)"
255 $DIG $DIGOPTS +noauth a.secure.nsec3.example. \
256 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
257 $DIG $DIGOPTS +noauth a.secure.nsec3.example. \
258 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
259 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
260 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
261 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
263 if [ $ret != 0 ]; then echo "I:failed"; fi
264 status
=`expr $status + $ret`
266 echo "I:checking multi-stage positive validation NSEC3/NSEC3 ($n)"
268 $DIG $DIGOPTS +noauth a.nsec3.nsec3.example. \
269 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
270 $DIG $DIGOPTS +noauth a.nsec3.nsec3.example. \
271 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
272 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
273 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
274 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
276 if [ $ret != 0 ]; then echo "I:failed"; fi
277 status
=`expr $status + $ret`
279 echo "I:checking multi-stage positive validation NSEC3/OPTOUT ($n)"
281 $DIG $DIGOPTS +noauth a.optout.nsec3.example. \
282 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
283 $DIG $DIGOPTS +noauth a.optout.nsec3.example. \
284 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
285 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
286 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
287 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
289 if [ $ret != 0 ]; then echo "I:failed"; fi
290 status
=`expr $status + $ret`
292 echo "I:checking multi-stage positive validation OPTOUT/NSEC ($n)"
294 $DIG $DIGOPTS +noauth a.secure.optout.example. \
295 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
296 $DIG $DIGOPTS +noauth a.secure.optout.example. \
297 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
298 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
299 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
300 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
302 if [ $ret != 0 ]; then echo "I:failed"; fi
303 status
=`expr $status + $ret`
305 echo "I:checking multi-stage positive validation OPTOUT/NSEC3 ($n)"
307 $DIG $DIGOPTS +noauth a.nsec3.optout.example. \
308 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
309 $DIG $DIGOPTS +noauth a.nsec3.optout.example. \
310 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
311 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
312 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
313 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
315 if [ $ret != 0 ]; then echo "I:failed"; fi
316 status
=`expr $status + $ret`
318 echo "I:checking multi-stage positive validation OPTOUT/OPTOUT ($n)"
320 $DIG $DIGOPTS +noauth a.optout.optout.example. \
321 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
322 $DIG $DIGOPTS +noauth a.optout.optout.example. \
323 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
324 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
325 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
326 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
328 if [ $ret != 0 ]; then echo "I:failed"; fi
329 status
=`expr $status + $ret`
331 echo "I:checking empty NODATA OPTOUT ($n)"
333 $DIG $DIGOPTS +noauth empty.optout.example. \
334 @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
335 $DIG $DIGOPTS +noauth empty.optout.example. \
336 @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
337 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
338 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
339 #grep "flags:.*ad.*QUERY" dig.out.ns4.test$n > /dev/null || ret=1
341 if [ $ret != 0 ]; then echo "I:failed"; fi
342 status
=`expr $status + $ret`
344 # Check the insecure.secure.example domain (insecurity proof)
346 echo "I:checking 2-server insecurity proof ($n)"
348 $DIG $DIGOPTS +noauth a.insecure.secure.example. @
10.53.0.2 a \
349 > dig.out.ns2.
test$n || ret
=1
350 $DIG $DIGOPTS +noauth a.insecure.secure.example. @
10.53.0.4 a \
351 > dig.out.ns4.
test$n || ret
=1
352 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
353 grep "status: NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
354 # Note - this is looking for failure, hence the &&
355 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
357 if [ $ret != 0 ]; then echo "I:failed"; fi
358 status
=`expr $status + $ret`
360 # Check a negative response in insecure.secure.example
362 echo "I:checking 2-server insecurity proof with a negative answer ($n)"
364 $DIG $DIGOPTS q.insecure.secure.example. @
10.53.0.2 a
> dig.out.ns2.
test$n \
366 $DIG $DIGOPTS q.insecure.secure.example. @
10.53.0.4 a
> dig.out.ns4.
test$n \
368 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
369 grep "status: NXDOMAIN" dig.out.ns4.
test$n > /dev
/null || ret
=1
370 # Note - this is looking for failure, hence the &&
371 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
373 if [ $ret != 0 ]; then echo "I:failed"; fi
374 status
=`expr $status + $ret`
376 echo "I:checking security root query ($n)"
378 $DIG $DIGOPTS . @
10.53.0.4 key
> dig.out.ns4.
test$n || ret
=1
379 grep "NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
380 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
382 if [ $ret != 0 ]; then echo "I:failed"; fi
383 status
=`expr $status + $ret`
385 echo "I:checking positive validation RSASHA256 NSEC ($n)"
387 $DIG $DIGOPTS +noauth a.rsasha256.example. @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
388 $DIG $DIGOPTS +noauth a.rsasha256.example. @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
389 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
390 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
392 if [ $ret != 0 ]; then echo "I:failed"; fi
393 status
=`expr $status + $ret`
395 echo "I:checking positive validation RSASHA512 NSEC ($n)"
397 $DIG $DIGOPTS +noauth a.rsasha512.example. @
10.53.0.3 a
> dig.out.ns3.
test$n || ret
=1
398 $DIG $DIGOPTS +noauth a.rsasha512.example. @
10.53.0.4 a
> dig.out.ns4.
test$n || ret
=1
399 $PERL ..
/digcomp.pl
dig.out.ns3.
test$n dig.out.ns4.
test$n || ret
=1
400 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null || ret
=1
402 if [ $ret != 0 ]; then echo "I:failed"; fi
403 status
=`expr $status + $ret`
405 echo "I:checking that positive validation in a privately secure zone works ($n)"
407 $DIG $DIGOPTS +noauth a.private.secure.example. a @
10.53.0.2 \
408 > dig.out.ns2.
test$n || ret
=1
409 $DIG $DIGOPTS +noauth a.private.secure.example. a @
10.53.0.4 \
410 > dig.out.ns4.
test$n || ret
=1
411 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
412 grep "NOERROR" dig.out.ns4.
test$n > /dev
/null || ret
=1
413 # Note - this is looking for failure, hence the &&
414 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
416 if [ $ret != 0 ]; then echo "I:failed"; fi
417 status
=`expr $status + $ret`
419 echo "I:checking that negative validation in a privately secure zone works ($n)"
421 $DIG $DIGOPTS +noauth q.private.secure.example. a @
10.53.0.2 \
422 > dig.out.ns2.
test$n || ret
=1
423 $DIG $DIGOPTS +noauth q.private.secure.example. a @
10.53.0.4 \
424 > dig.out.ns4.
test$n || ret
=1
425 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
426 grep "NXDOMAIN" dig.out.ns4.
test$n > /dev
/null || ret
=1
427 # Note - this is looking for failure, hence the &&
428 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
430 if [ $ret != 0 ]; then echo "I:failed"; fi
431 status
=`expr $status + $ret`
433 echo "I:checking privately secure to nxdomain works ($n)"
435 $DIG $DIGOPTS +noauth private2secure-nxdomain.private.secure.example. SOA @
10.53.0.2 \
436 > dig.out.ns2.
test$n || ret
=1
437 $DIG $DIGOPTS +noauth private2secure-nxdomain.private.secure.example. SOA @
10.53.0.4 \
438 > dig.out.ns4.
test$n || ret
=1
439 $PERL ..
/digcomp.pl
dig.out.ns2.
test$n dig.out.ns4.
test$n || ret
=1
440 # Note - this is looking for failure, hence the &&
441 grep "flags:.*ad.*QUERY" dig.out.ns4.
test$n > /dev
/null
&& ret
=1
443 if [ $ret != 0 ]; then echo "I:failed"; fi
444 status
=`expr $status + $ret`
446 # Try validating with a revoked trusted key.
449 echo "I:checking that validation fails due to revoked trusted key ($n)"
451 $DIG $DIGOPTS example. soa @
10.53.0.5 > dig.out.ns5.
test$n || ret
=1
452 grep "SERVFAIL" dig.out.ns5.
test$n > /dev
/null || ret
=1
454 if [ $ret != 0 ]; then echo "I:failed"; fi
455 status
=`expr $status + $ret`
457 echo "I:checking that revoked key is present ($n)"
459 id
=`sed 's/^K.+005+0*//' < rev.key`
460 id
=`expr $id + 128 % 65536`
461 $DIG $DIGOPTS +multi dnskey . @
10.53.0.1 > dig.out.ns1.
test$n || ret
=1
462 grep '; key id = '"$id"'$' dig.out.ns1.
test$n > /dev
/null || ret
=1
464 if [ $ret != 0 ]; then echo "I:failed"; fi
465 status
=`expr $status + $ret`
467 echo "I:checking that revoked key self-signs ($n)"
469 id
=`sed 's/^K.+005+0*//' < rev.key`
470 id
=`expr $id + 128 % 65536`
471 $DIG $DIGOPTS dnskey . @
10.53.0.1 > dig.out.ns1.
test$n || ret
=1
472 grep 'RRSIG.*'" $id "'\. ' dig.out.ns1.
test$n > /dev
/null || ret
=1
474 if [ $ret != 0 ]; then echo "I:failed"; fi
475 status
=`expr $status + $ret`
477 echo "I:checking for unpublished key ($n)"
479 id
=`sed 's/^K.+005+0*//' < unpub.key`
480 $DIG $DIGOPTS +multi dnskey . @
10.53.0.1 > dig.out.ns1.
test$n || ret
=1
481 grep '; key id = '"$id"'$' dig.out.ns1.
test$n > /dev
/null
&& ret
=1
483 if [ $ret != 0 ]; then echo "I:failed"; fi
484 status
=`expr $status + $ret`
486 echo "I:checking that standby key does not sign records ($n)"
488 id
=`sed 's/^K.+005+0*//' < standby.key`
489 $DIG $DIGOPTS dnskey . @
10.53.0.1 > dig.out.ns1.
test$n || ret
=1
490 grep 'RRSIG.*'" $id "'\. ' dig.out.ns1.
test$n > /dev
/null
&& ret
=1
492 if [ $ret != 0 ]; then echo "I:failed"; fi
493 status
=`expr $status + $ret`
495 echo "I:checking that deactivated key does not sign records ($n)"
497 id
=`sed 's/^K.+005+0*//' < inact.key`
498 $DIG $DIGOPTS dnskey . @
10.53.0.1 > dig.out.ns1.
test$n || ret
=1
499 grep 'RRSIG.*'" $id "'\. ' dig.out.ns1.
test$n > /dev
/null
&& ret
=1
501 if [ $ret != 0 ]; then echo "I:failed"; fi
502 status
=`expr $status + $ret`
504 echo "I:checking key deletion ($n)"
506 id
=`sed 's/^K.+005+0*//' < del.key`
507 $DIG $DIGOPTS +multi dnskey . @
10.53.0.1 > dig.out.ns1.
test$n || ret
=1
508 grep '; key id = '"$id"'$' dig.out.ns1.
test$n > /dev
/null
&& ret
=1
510 if [ $ret != 0 ]; then echo "I:failed"; fi
511 status
=`expr $status + $ret`
513 echo "I:exit status: $status"