tests.sh 16.9 KB
Newer Older
1
2
#!/bin/sh
#
3
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4
5
6
7
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
10
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
11
12
13

SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
14

15
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
16

17
18
19
status=0
n=0

20
#echo_i "check ans.pl server ($n)"
21
22
23
24
25
26
27
28
29
30
31
32
#$DIG -p ${PORT} @10.53.0.2 example NS
#$DIG -p ${PORT} @10.53.0.2 example SOA
#$DIG -p ${PORT} @10.53.0.2 ns.example A
#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA
#$DIG -p ${PORT} @10.53.0.2 txt enable
#$DIG -p ${PORT} @10.53.0.2 txt disable
#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA
#$DIG -p ${PORT} @10.53.0.2 txt enable
#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA
##$DIG -p ${PORT} @10.53.0.2 data.example TXT
#$DIG -p ${PORT} @10.53.0.2 nodata.example TXT
#$DIG -p ${PORT} @10.53.0.2 nxdomain.example TXT
33
34

n=`expr $n + 1`
35
echo_i "prime cache data.example ($n)"
36
ret=0
37
$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
38
39
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
40
if [ $ret != 0 ]; then echo_i "failed"; fi
41
42
43
status=`expr $status + $ret`

n=`expr $n + 1`
44
echo_i "prime cache nodata.example ($n)"
45
ret=0
46
$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
47
48
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
49
if [ $ret != 0 ]; then echo_i "failed"; fi
50
51
52
status=`expr $status + $ret`

n=`expr $n + 1`
53
echo_i "prime cache nxdomain.example ($n)"
54
ret=0
55
$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
56
57
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
58
if [ $ret != 0 ]; then echo_i "failed"; fi
59
60
61
status=`expr $status + $ret`

n=`expr $n + 1`
62
echo_i "disable responses from authoritative server ($n)"
63
ret=0
64
$DIG -p ${PORT} @10.53.0.2 txt disable  > dig.out.test$n
65
66
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1
67
if [ $ret != 0 ]; then echo_i "failed"; fi
68
69
70
71
72
status=`expr $status + $ret`

sleep 1

n=`expr $n + 1`
73
echo_i "check 'rndc serve-stale status' ($n)"
74
75
76
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1
77
if [ $ret != 0 ]; then echo_i "failed"; fi
78
79
80
status=`expr $status + $ret`

n=`expr $n + 1`
81
echo_i "check stale data.example ($n)"
82
ret=0
83
$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
84
85
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
86
if [ $ret != 0 ]; then echo_i "failed"; fi
87
88
89
status=`expr $status + $ret`

n=`expr $n + 1`
90
echo_i "check stale nodata.example ($n)"
91
ret=0
92
$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
93
94
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
95
if [ $ret != 0 ]; then echo_i "failed"; fi
96
97
98
status=`expr $status + $ret`

n=`expr $n + 1`
99
echo_i "check stale nxdomain.example ($n)"
100
ret=0
101
$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
102
103
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
104
if [ $ret != 0 ]; then echo_i "failed"; fi
105
106
107
status=`expr $status + $ret`

n=`expr $n + 1`
108
echo_i "running 'rndc serve-stale off' ($n)"
109
110
ret=0
$RNDCCMD 10.53.0.1 serve-stale off || ret=1
111
if [ $ret != 0 ]; then echo_i "failed"; fi
112
113
114
status=`expr $status + $ret`

n=`expr $n + 1`
115
echo_i "check 'rndc serve-stale status' ($n)"
116
117
118
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1
119
if [ $ret != 0 ]; then echo_i "failed"; fi
120
121
122
status=`expr $status + $ret`

n=`expr $n + 1`
123
echo_i "check stale data.example (serve-stale off) ($n)"
124
ret=0
125
$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
126
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
127
if [ $ret != 0 ]; then echo_i "failed"; fi
128
status=`expr $status + $ret`
129
if [ $ret != 0 ]; then echo_i "failed"; fi
130
131
132
status=`expr $status + $ret`

n=`expr $n + 1`
133
echo_i "check stale nodata.example (serve-stale off) ($n)"
134
ret=0
135
$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
136
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
137
if [ $ret != 0 ]; then echo_i "failed"; fi
138
139
140
status=`expr $status + $ret`

n=`expr $n + 1`
141
echo_i "check stale nxdomain.example (serve-stale off) ($n)"
142
ret=0
143
$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
144
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
145
if [ $ret != 0 ]; then echo_i "failed"; fi
146
147
148
status=`expr $status + $ret`

n=`expr $n + 1`
149
echo_i "running 'rndc serve-stale on' ($n)"
150
151
ret=0
$RNDCCMD 10.53.0.1 serve-stale on || ret=1
152
if [ $ret != 0 ]; then echo_i "failed"; fi
153
154
155
status=`expr $status + $ret`

n=`expr $n + 1`
156
echo_i "check 'rndc serve-stale status' ($n)"
157
158
159
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1
160
if [ $ret != 0 ]; then echo_i "failed"; fi
161
162
163
status=`expr $status + $ret`

n=`expr $n + 1`
164
echo_i "check stale data.example (serve-stale on) ($n)"
165
ret=0
166
$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
167
168
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
169
if [ $ret != 0 ]; then echo_i "failed"; fi
170
171
172
status=`expr $status + $ret`

n=`expr $n + 1`
173
echo_i "check stale nodata.example (serve-stale on) ($n)"
174
ret=0
175
$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
176
177
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
178
if [ $ret != 0 ]; then echo_i "failed"; fi
179
180
181
status=`expr $status + $ret`

n=`expr $n + 1`
182
echo_i "check stale nxdomain.example (serve-stale on) ($n)"
183
ret=0
184
$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
185
186
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
187
if [ $ret != 0 ]; then echo_i "failed"; fi
188
189
190
status=`expr $status + $ret`

n=`expr $n + 1`
191
echo_i "running 'rndc serve-stale no' ($n)"
192
193
ret=0
$RNDCCMD 10.53.0.1 serve-stale no || ret=1
194
if [ $ret != 0 ]; then echo_i "failed"; fi
195
196
197
status=`expr $status + $ret`

n=`expr $n + 1`
198
echo_i "check 'rndc serve-stale status' ($n)"
199
200
201
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1
202
if [ $ret != 0 ]; then echo_i "failed"; fi
203
204
205
status=`expr $status + $ret`

n=`expr $n + 1`
206
echo_i "check stale data.example (serve-stale no) ($n)"
207
ret=0
208
$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
209
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
210
if [ $ret != 0 ]; then echo_i "failed"; fi
211
212
213
status=`expr $status + $ret`

n=`expr $n + 1`
214
echo_i "check stale nodata.example (serve-stale no) ($n)"
215
ret=0
216
$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
217
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
218
if [ $ret != 0 ]; then echo_i "failed"; fi
219
220
221
status=`expr $status + $ret`

n=`expr $n + 1`
222
echo_i "check stale nxdomain.example (serve-stale no) ($n)"
223
ret=0
224
$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
225
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
226
if [ $ret != 0 ]; then echo_i "failed"; fi
227
228
229
status=`expr $status + $ret`

n=`expr $n + 1`
230
echo_i "running 'rndc serve-stale yes' ($n)"
231
232
ret=0
$RNDCCMD 10.53.0.1 serve-stale yes || ret=1
233
if [ $ret != 0 ]; then echo_i "failed"; fi
234
235
236
status=`expr $status + $ret`

n=`expr $n + 1`
237
echo_i "check 'rndc serve-stale status' ($n)"
238
239
240
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1
241
if [ $ret != 0 ]; then echo_i "failed"; fi
242
243
244
status=`expr $status + $ret`

n=`expr $n + 1`
245
echo_i "check stale data.example (serve-stale yes) ($n)"
246
ret=0
247
$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
248
249
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
250
if [ $ret != 0 ]; then echo_i "failed"; fi
251
252
253
status=`expr $status + $ret`

n=`expr $n + 1`
254
echo_i "check stale nodata.example (serve-stale yes) ($n)"
255
ret=0
256
$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
257
258
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
259
if [ $ret != 0 ]; then echo_i "failed"; fi
260
261
262
status=`expr $status + $ret`

n=`expr $n + 1`
263
echo_i "check stale nxdomain.example (serve-stale yes) ($n)"
264
ret=0
265
$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
266
267
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
268
if [ $ret != 0 ]; then echo_i "failed"; fi
269
270
271
status=`expr $status + $ret`

n=`expr $n + 1`
272
echo_i "running 'rndc serve-stale off' ($n)"
273
274
ret=0
$RNDCCMD 10.53.0.1 serve-stale off || ret=1
275
if [ $ret != 0 ]; then echo_i "failed"; fi
276
277
278
status=`expr $status + $ret`

n=`expr $n + 1`
279
echo_i "running 'rndc serve-stale reset' ($n)"
280
281
ret=0
$RNDCCMD 10.53.0.1 serve-stale reset || ret=1
282
if [ $ret != 0 ]; then echo_i "failed"; fi
283
284
285
status=`expr $status + $ret`

n=`expr $n + 1`
286
echo_i "check 'rndc serve-stale status' ($n)"
287
288
289
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1
290
if [ $ret != 0 ]; then echo_i "failed"; fi
291
292
293
status=`expr $status + $ret`

n=`expr $n + 1`
294
echo_i "check stale data.example (serve-stale reset) ($n)"
295
ret=0
296
$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n
297
298
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
299
if [ $ret != 0 ]; then echo_i "failed"; fi
300
301
302
status=`expr $status + $ret`

n=`expr $n + 1`
303
echo_i "check stale nodata.example (serve-stale reset) ($n)"
304
ret=0
305
$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n
306
307
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
308
if [ $ret != 0 ]; then echo_i "failed"; fi
309
310
311
status=`expr $status + $ret`

n=`expr $n + 1`
312
echo_i "check stale nxdomain.example (serve-stale reset) ($n)"
313
ret=0
314
$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n
315
316
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
317
if [ $ret != 0 ]; then echo_i "failed"; fi
318
319
320
status=`expr $status + $ret`

n=`expr $n + 1`
321
echo_i "running 'rndc serve-stale off' ($n)"
322
323
ret=0
$RNDCCMD 10.53.0.1 serve-stale off || ret=1
324
if [ $ret != 0 ]; then echo_i "failed"; fi
325
326
327
status=`expr $status + $ret`

n=`expr $n + 1`
328
echo_i "check 'rndc serve-stale status' ($n)"
329
330
331
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1
332
if [ $ret != 0 ]; then echo_i "failed"; fi
333
334
335
status=`expr $status + $ret`

n=`expr $n + 1`
336
echo_i "updating ns1/named.conf ($n)"
337
ret=0
338
copy_setports ns1/named2.conf.in ns1/named.conf
339
if [ $ret != 0 ]; then echo_i "failed"; fi
340
341
342
status=`expr $status + $ret`

n=`expr $n + 1`
343
echo_i "running 'rndc reload' ($n)"
344
345
346
ret=0
$RNDCCMD 10.53.0.1 reload > rndc.out.test$n 2>&1 || ret=1
grep "server reload successful" rndc.out.test$n > /dev/null || ret=1
347
if [ $ret != 0 ]; then echo_i "failed"; fi
348
349
350
status=`expr $status + $ret`

n=`expr $n + 1`
351
echo_i "check 'rndc serve-stale status' ($n)"
352
353
354
ret=0
$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (rndc) (stale-answer-ttl=2 max-stale-ttl=7200)' rndc.out.test$n > /dev/null || ret=1
355
if [ $ret != 0 ]; then echo_i "failed"; fi
356
357
358
status=`expr $status + $ret`

n=`expr $n + 1`
359
echo_i "check 'rndc serve-stale' ($n)"
360
361
362
ret=0
$RNDCCMD 10.53.0.1 serve-stale > rndc.out.test$n 2>&1 && ret=1
grep "unexpected end of input" rndc.out.test$n > /dev/null || ret=1
363
if [ $ret != 0 ]; then echo_i "failed"; fi
364
365
366
status=`expr $status + $ret`

n=`expr $n + 1`
367
echo_i "check 'rndc serve-stale unknown' ($n)"
368
369
370
ret=0
$RNDCCMD 10.53.0.1 serve-stale unknown > rndc.out.test$n 2>&1 && ret=1
grep "syntax error" rndc.out.test$n > /dev/null || ret=1
371
if [ $ret != 0 ]; then echo_i "failed"; fi
372
373
374
status=`expr $status + $ret`

n=`expr $n + 1`
375
echo_i "enable responses from authoritative server ($n)"
376
ret=0
377
$DIG -p ${PORT} @10.53.0.2 txt enable  > dig.out.test$n
378
379
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
grep "TXT.\"1\"" dig.out.test$n > /dev/null || ret=1
380
if [ $ret != 0 ]; then echo_i "failed"; fi
381
382
383
status=`expr $status + $ret`

n=`expr $n + 1`
384
echo_i "prime cache data.example (max-stale-ttl default) ($n)"
385
ret=0
386
$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n
387
388
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
389
if [ $ret != 0 ]; then echo_i "failed"; fi
390
391
392
status=`expr $status + $ret`

n=`expr $n + 1`
393
echo_i "prime cache nodata.example (max-stale-ttl default) ($n)"
394
ret=0
395
$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n
396
397
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
398
if [ $ret != 0 ]; then echo_i "failed"; fi
399
400
401
status=`expr $status + $ret`

n=`expr $n + 1`
402
echo_i "prime cache nxdomain.example (max-stale-ttl default) ($n)"
403
ret=0
404
$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
405
406
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
407
if [ $ret != 0 ]; then echo_i "failed"; fi
408
409
410
status=`expr $status + $ret`

n=`expr $n + 1`
411
echo_i "disable responses from authoritative server ($n)"
412
ret=0
413
$DIG -p ${PORT} @10.53.0.2 txt disable  > dig.out.test$n
414
415
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1
416
if [ $ret != 0 ]; then echo_i "failed"; fi
417
418
419
420
421
status=`expr $status + $ret`

sleep 1

n=`expr $n + 1`
422
echo_i "check 'rndc serve-stale status' ($n)"
423
424
425
ret=0
$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: off (stale-answer-ttl=1 max-stale-ttl=604800)' rndc.out.test$n > /dev/null || ret=1
426
if [ $ret != 0 ]; then echo_i "failed"; fi
427
428
429
status=`expr $status + $ret`

n=`expr $n + 1`
430
echo_i "check fail of data.example (max-stale-ttl default) ($n)"
431
ret=0
432
$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n
433
434
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
435
if [ $ret != 0 ]; then echo_i "failed"; fi
436
437
438
status=`expr $status + $ret`

n=`expr $n + 1`
439
echo_i "check fail of nodata.example (max-stale-ttl default) ($n)"
440
ret=0
441
$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n
442
443
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
444
if [ $ret != 0 ]; then echo_i "failed"; fi
445
446
447
status=`expr $status + $ret`

n=`expr $n + 1`
448
echo_i "check fail of nxdomain.example (max-stale-ttl default) ($n)"
449
ret=0
450
$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
451
452
grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
453
if [ $ret != 0 ]; then echo_i "failed"; fi
454
455
456
status=`expr $status + $ret`

n=`expr $n + 1`
457
echo_i "check 'rndc serve-stale on' ($n)"
458
459
ret=0
$RNDCCMD 10.53.0.3 serve-stale on > rndc.out.test$n 2>&1 || ret=1
460
if [ $ret != 0 ]; then echo_i "failed"; fi
461
462
463
status=`expr $status + $ret`

n=`expr $n + 1`
464
echo_i "check 'rndc serve-stale status' ($n)"
465
466
467
ret=0
$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
grep '_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=604800)' rndc.out.test$n > /dev/null || ret=1
468
if [ $ret != 0 ]; then echo_i "failed"; fi
469
470
471
status=`expr $status + $ret`

n=`expr $n + 1`
472
echo_i "check data.example (max-stale-ttl default) ($n)"
473
ret=0
474
$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n
475
476
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
477
if [ $ret != 0 ]; then echo_i "failed"; fi
478
479
480
status=`expr $status + $ret`

n=`expr $n + 1`
481
echo_i "check nodata.example (max-stale-ttl default) ($n)"
482
ret=0
483
$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n
484
485
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
486
if [ $ret != 0 ]; then echo_i "failed"; fi
487
488
489
status=`expr $status + $ret`

n=`expr $n + 1`
490
echo_i "check nxdomain.example (max-stale-ttl default) ($n)"
491
ret=0
492
$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n
493
494
grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1
495
if [ $ret != 0 ]; then echo_i "failed"; fi
496
497
status=`expr $status + $ret`

498
echo_i "exit status: $status"
499
[ $status -eq 0 ] || exit 1