tests.sh 58.4 KB
Newer Older
1 2
#!/bin/sh
#
3
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
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
. ../conf.sh
13 14 15 16 17 18

status=0
n=0

rm -f dig.out.*

Evan Hunt's avatar
Evan Hunt committed
19
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p ${PORT}"
20 21 22

for conf in conf/good*.conf
do
Evan Hunt's avatar
Evan Hunt committed
23
        echo_i "checking that $conf is accepted ($n)"
24 25 26
        ret=0
        $CHECKCONF "$conf" || ret=1
        n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
27
        if [ $ret != 0 ]; then echo_i "failed"; fi
28 29 30 31 32
        status=`expr $status + $ret`
done

for conf in conf/bad*.conf
do
Evan Hunt's avatar
Evan Hunt committed
33
        echo_i "checking that $conf is rejected ($n)"
34 35 36
        ret=0
        $CHECKCONF "$conf" >/dev/null && ret=1
	n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
37
        if [ $ret != 0 ]; then echo_i "failed"; fi
38 39 40 41 42
        status=`expr $status + $ret`
done

# Check the example. domain

Evan Hunt's avatar
Evan Hunt committed
43
echo_i "checking non-excluded AAAA lookup works ($n)"
44 45 46 47 48
ret=0
$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
49
if [ $ret != 0 ]; then echo_i "failed"; fi
50 51
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
52
echo_i "checking excluded only AAAA lookup works ($n)"
53 54 55 56 57
ret=0
$DIG $DIGOPTS excluded-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
58
if [ $ret != 0 ]; then echo_i "failed"; fi
59 60
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
61
echo_i "checking excluded AAAA and non-mapped A lookup works ($n)"
62 63 64 65 66
ret=0
$DIG $DIGOPTS excluded-bad-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
67
if [ $ret != 0 ]; then echo_i "failed"; fi
68 69
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
70
echo_i "checking excluded only AAAA and mapped A lookup works ($n)"
71 72 73 74 75
ret=0
$DIG $DIGOPTS excluded-good-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:aaaa::1.2.3.4" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
76
if [ $ret != 0 ]; then echo_i "failed"; fi
77 78
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
79
echo_i "checking default exclude acl ignores mapped A records (all mapped) ($n)"
80 81 82 83 84
ret=0
$DIG $DIGOPTS a-and-mapped.example. @10.53.0.2 -b 10.53.0.4 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:bbbb::1.2.3.5" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
85
if [ $ret != 0 ]; then echo_i "failed"; fi
86 87
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
88
echo_i "checking default exclude acl ignores mapped A records (some mapped) ($n)"
89 90 91 92 93 94 95
ret=0
$DIG $DIGOPTS a-and-aaaa-and-mapped.example. @10.53.0.2 -b 10.53.0.4 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::4" dig.out.ns2.test$n > /dev/null || ret=1
grep "::ffff:1.2.3.4" dig.out.ns2.test$n > /dev/null && ret=1
grep "::ffff:1.2.3.5" dig.out.ns2.test$n > /dev/null && ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
96
if [ $ret != 0 ]; then echo_i "failed"; fi
97 98
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
99
echo_i "checking default exclude acl works with AAAA only ($n)"
100 101 102 103 104
ret=0
$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.4 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
105
if [ $ret != 0 ]; then echo_i "failed"; fi
106 107
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
108
echo_i "checking default exclude acl A only lookup works ($n)"
109 110 111 112 113
ret=0
$DIG $DIGOPTS a-only.example. @10.53.0.2 -b 10.53.0.4 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:bbbb::102:305" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
114
if [ $ret != 0 ]; then echo_i "failed"; fi
115 116
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
117
echo_i "checking partially excluded only AAAA lookup works ($n)"
118 119 120 121 122 123
ret=0
$DIG $DIGOPTS partially-excluded-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::3" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
124
if [ $ret != 0 ]; then echo_i "failed"; fi
125 126
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
127
echo_i "checking partially-excluded AAAA and non-mapped A lookup works ($n)"
128 129 130 131 132 133
ret=0
$DIG $DIGOPTS partially-excluded-bad-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
134
if [ $ret != 0 ]; then echo_i "failed"; fi
135 136
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
137
echo_i "checking partially-excluded only AAAA and mapped A lookup works ($n)"
138 139 140 141 142 143
ret=0
$DIG $DIGOPTS partially-excluded-good-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
144
if [ $ret != 0 ]; then echo_i "failed"; fi
145 146
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
147
echo_i "checking AAAA only lookup works ($n)"
148 149 150 151 152
ret=0
$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
153
if [ $ret != 0 ]; then echo_i "failed"; fi
154 155
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
156
echo_i "checking A only lookup works ($n)"
157 158 159 160 161
ret=0
$DIG $DIGOPTS a-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:aaaa::102:305" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
162
if [ $ret != 0 ]; then echo_i "failed"; fi
163 164
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
165
echo_i "checking A and AAAA lookup works ($n)"
166 167 168 169 170
ret=0
$DIG $DIGOPTS a-and-aaaa.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
171
if [ $ret != 0 ]; then echo_i "failed"; fi
172 173
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
174
echo_i "checking non-mapped A lookup works ($n)"
175 176 177 178 179
ret=0
$DIG $DIGOPTS a-not-mapped.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
180
if [ $ret != 0 ]; then echo_i "failed"; fi
181 182
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
183
echo_i "checking NODATA AAAA lookup works ($n)"
184 185 186 187 188
ret=0
$DIG $DIGOPTS mx-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
189
if [ $ret != 0 ]; then echo_i "failed"; fi
190 191
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
192
echo_i "checking non-existent AAAA lookup works ($n)"
193 194 195 196
ret=0
$DIG $DIGOPTS non-existent.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
197
if [ $ret != 0 ]; then echo_i "failed"; fi
198 199
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
200
echo_i "checking non-excluded AAAA via CNAME lookup works ($n)"
201 202 203 204 205
ret=0
$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
206
if [ $ret != 0 ]; then echo_i "failed"; fi
207 208
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
209
echo_i "checking excluded only AAAA via CNAME lookup works ($n)"
210 211 212 213 214
ret=0
$DIG $DIGOPTS cname-excluded-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
215
if [ $ret != 0 ]; then echo_i "failed"; fi
216 217
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
218
echo_i "checking excluded AAAA and non-mapped A via CNAME lookup works ($n)"
219 220 221 222 223
ret=0
$DIG $DIGOPTS cname-excluded-bad-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
224
if [ $ret != 0 ]; then echo_i "failed"; fi
225 226
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
227
echo_i "checking excluded only AAAA and mapped A via CNAME lookup works ($n)"
228 229 230 231 232
ret=0
$DIG $DIGOPTS cname-excluded-good-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:aaaa::1.2.3.4" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
233
if [ $ret != 0 ]; then echo_i "failed"; fi
234 235
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
236
echo_i "checking AAAA only via CNAME lookup works ($n)"
237 238 239 240 241
ret=0
$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
242
if [ $ret != 0 ]; then echo_i "failed"; fi
243 244
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
245
echo_i "checking A only via CNAME lookup works ($n)"
246 247 248 249 250
ret=0
$DIG $DIGOPTS cname-a-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:aaaa::102:305" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
251
if [ $ret != 0 ]; then echo_i "failed"; fi
252 253
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
254
echo_i "checking A and AAAA via CNAME lookup works ($n)"
255 256 257 258 259
ret=0
$DIG $DIGOPTS cname-a-and-aaaa.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
260
if [ $ret != 0 ]; then echo_i "failed"; fi
261 262
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
263
echo_i "checking non-mapped A via CNAME lookup works ($n)"
264 265 266 267 268 269
ret=0
$DIG $DIGOPTS cname-a-not-mapped.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
270
if [ $ret != 0 ]; then echo_i "failed"; fi
271 272
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
273
echo_i "checking NODATA AAAA via CNAME lookup works ($n)"
274 275 276 277 278 279
ret=0
$DIG $DIGOPTS cname-mx-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
280
if [ $ret != 0 ]; then echo_i "failed"; fi
281 282
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
283
echo_i "checking non-existent AAAA via CNAME lookup works ($n)"
284 285 286 287 288
ret=0
$DIG $DIGOPTS cname-non-existent.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
289
if [ $ret != 0 ]; then echo_i "failed"; fi
290 291 292 293
status=`expr $status + $ret`

# Check the example. domain recursive only

Evan Hunt's avatar
Evan Hunt committed
294
echo_i "checking non-excluded AAAA lookup works, recursive only ($n)"
295 296 297 298 299
ret=0
$DIG $DIGOPTS aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
300
if [ $ret != 0 ]; then echo_i "failed"; fi
301 302
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
303
echo_i "checking excluded only AAAA lookup works, recursive only ($n)"
304 305 306 307 308
ret=0
$DIG $DIGOPTS excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
309
if [ $ret != 0 ]; then echo_i "failed"; fi
310 311
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
312
echo_i "checking excluded AAAA and non-mapped A lookup works, recursive only ($n)"
313 314 315 316 317
ret=0
$DIG $DIGOPTS excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
318
if [ $ret != 0 ]; then echo_i "failed"; fi
319 320
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
321
echo_i "checking excluded only AAAA and mapped A lookup works, recursive only ($n)"
322 323 324 325 326
ret=0
$DIG $DIGOPTS excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:bbbb::1.2.3.4" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
327
if [ $ret != 0 ]; then echo_i "failed"; fi
328 329
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
330
echo_i "checking partially excluded only AAAA lookup works, recursive only ($n)"
331 332 333 334 335 336
ret=0
$DIG $DIGOPTS partially-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::3" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
337
if [ $ret != 0 ]; then echo_i "failed"; fi
338 339
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
340
echo_i "checking partially-excluded AAAA and non-mapped A lookup works, recursive only ($n)"
341 342 343 344 345 346
ret=0
$DIG $DIGOPTS partially-excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
347
if [ $ret != 0 ]; then echo_i "failed"; fi
348 349
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
350
echo_i "checking partially-excluded only AAAA and mapped A lookup works, recursive only ($n)"
351 352 353 354 355 356
ret=0
$DIG $DIGOPTS partially-excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
357
if [ $ret != 0 ]; then echo_i "failed"; fi
358 359
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
360
echo_i "checking AAAA only lookup works, recursive only ($n)"
361 362 363 364 365
ret=0
$DIG $DIGOPTS aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
366
if [ $ret != 0 ]; then echo_i "failed"; fi
367 368
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
369
echo_i "checking A only lookup works, recursive only ($n)"
370 371 372 373 374
ret=0
$DIG $DIGOPTS a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:bbbb::102:305" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
375
if [ $ret != 0 ]; then echo_i "failed"; fi
376 377
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
378
echo_i "checking A and AAAA lookup works, recursive only ($n)"
379 380 381 382 383
ret=0
$DIG $DIGOPTS a-and-aaaa.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
384
if [ $ret != 0 ]; then echo_i "failed"; fi
385 386
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
387
echo_i "checking non-mapped A lookup works, recursive only ($n)"
388 389 390 391 392
ret=0
$DIG $DIGOPTS a-not-mapped.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
393
if [ $ret != 0 ]; then echo_i "failed"; fi
394 395
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
396
echo_i "checking NODATA AAAA lookup works, recursive only ($n)"
397 398 399 400 401
ret=0
$DIG $DIGOPTS mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
402
if [ $ret != 0 ]; then echo_i "failed"; fi
403 404
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
405
echo_i "checking non-existent AAAA lookup works, recursive only ($n)"
406 407 408 409
ret=0
$DIG $DIGOPTS non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
410
if [ $ret != 0 ]; then echo_i "failed"; fi
411 412
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
413
echo_i "checking non-excluded AAAA via CNAME lookup works, recursive only ($n)"
414 415 416 417 418
ret=0
$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
419
if [ $ret != 0 ]; then echo_i "failed"; fi
420 421
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
422
echo_i "checking excluded only AAAA via CNAME lookup works, recursive only ($n)"
423 424 425 426 427
ret=0
$DIG $DIGOPTS cname-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
428
if [ $ret != 0 ]; then echo_i "failed"; fi
429 430
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
431
echo_i "checking excluded AAAA and non-mapped A via CNAME lookup works, recursive only ($n)"
432 433 434 435 436
ret=0
$DIG $DIGOPTS cname-excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
437
if [ $ret != 0 ]; then echo_i "failed"; fi
438 439
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
440
echo_i "checking excluded only AAAA and mapped A via CNAME lookup works, recursive only ($n)"
441 442 443 444 445 446
ret=0
$DIG $DIGOPTS cname-excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:bbbb::102:304" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
447
if [ $ret != 0 ]; then echo_i "failed"; fi
448 449
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
450
echo_i "checking AAAA only via CNAME lookup works, recursive only ($n)"
451 452 453 454 455
ret=0
$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
456
if [ $ret != 0 ]; then echo_i "failed"; fi
457 458
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
459
echo_i "checking A only via CNAME lookup works, recursive only ($n)"
460 461 462 463 464
ret=0
$DIG $DIGOPTS cname-a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:bbbb::102:305" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
465
if [ $ret != 0 ]; then echo_i "failed"; fi
466 467
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
468
echo_i "checking A and AAAA via CNAME lookup works, recursive only ($n)"
469 470 471 472 473
ret=0
$DIG $DIGOPTS cname-a-and-aaaa.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
474
if [ $ret != 0 ]; then echo_i "failed"; fi
475 476
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
477
echo_i "checking non-mapped A via CNAME lookup works, recursive only ($n)"
478 479 480 481 482 483
ret=0
$DIG $DIGOPTS cname-a-not-mapped.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
484
if [ $ret != 0 ]; then echo_i "failed"; fi
485 486
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
487
echo_i "checking NODATA AAAA via CNAME lookup works, recursive only ($n)"
488 489 490 491 492 493
ret=0
$DIG $DIGOPTS cname-mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
494
if [ $ret != 0 ]; then echo_i "failed"; fi
495 496
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
497
echo_i "checking non-existent AAAA via CNAME lookup works, recursive only ($n)"
498 499 500 501 502
ret=0
$DIG $DIGOPTS cname-non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
503
if [ $ret != 0 ]; then echo_i "failed"; fi
504 505 506 507
status=`expr $status + $ret`

# Check the example. domain recursive only w/o recursion

Evan Hunt's avatar
Evan Hunt committed
508
echo_i "checking non-excluded AAAA lookup works, recursive only +norec ($n)"
509 510 511 512 513
ret=0
$DIG $DIGOPTS +norec aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
514
if [ $ret != 0 ]; then echo_i "failed"; fi
515 516
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
517
echo_i "checking excluded only AAAA lookup works, recursive only +norec ($n)"
518 519 520 521 522 523
ret=0
$DIG $DIGOPTS +norec excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
524
if [ $ret != 0 ]; then echo_i "failed"; fi
525 526
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
527
echo_i "checking excluded AAAA and non-mapped A lookup works, recursive only +norec ($n)"
528 529 530 531 532 533
ret=0
$DIG $DIGOPTS +norec excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
534
if [ $ret != 0 ]; then echo_i "failed"; fi
535 536
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
537
echo_i "checking excluded only AAAA and mapped A lookup works, recursive only +norec ($n)"
538 539 540 541 542
ret=0
$DIG $DIGOPTS +norec excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
543
if [ $ret != 0 ]; then echo_i "failed"; fi
544 545
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
546
echo_i "checking partially excluded only AAAA lookup works, recursive only +norec ($n)"
547 548 549 550 551 552 553
ret=0
$DIG $DIGOPTS +norec partially-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee:" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::3" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
554
if [ $ret != 0 ]; then echo_i "failed"; fi
555 556
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
557
echo_i "checking partially-excluded AAAA and non-mapped A lookup works, recursive only +norec ($n)"
558 559 560 561 562 563 564
ret=0
$DIG $DIGOPTS +norec partially-excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee:" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
565
if [ $ret != 0 ]; then echo_i "failed"; fi
566 567
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
568
echo_i "checking partially-excluded only AAAA and mapped A lookup works, recursive only +norec ($n)"
569 570 571 572 573 574 575
ret=0
$DIG $DIGOPTS +norec partially-excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee:" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
576
if [ $ret != 0 ]; then echo_i "failed"; fi
577 578
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
579
echo_i "checking AAAA only lookup works, recursive only +norec ($n)"
580 581 582 583 584
ret=0
$DIG $DIGOPTS +norec aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
585
if [ $ret != 0 ]; then echo_i "failed"; fi
586 587
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
588
echo_i "checking A only lookup works, recursive only +norec ($n)"
589 590 591 592 593
ret=0
$DIG $DIGOPTS +norec a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
594
if [ $ret != 0 ]; then echo_i "failed"; fi
595 596
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
597
echo_i "checking A and AAAA lookup works, recursive only +norec ($n)"
598 599 600 601 602
ret=0
$DIG $DIGOPTS +norec a-and-aaaa.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
603
if [ $ret != 0 ]; then echo_i "failed"; fi
604 605
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
606
echo_i "checking non-mapped A lookup works, recursive only +norec ($n)"
607 608 609 610 611
ret=0
$DIG $DIGOPTS +norec a-not-mapped.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
612
if [ $ret != 0 ]; then echo_i "failed"; fi
613 614
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
615
echo_i "checking NODATA AAAA lookup works, recursive only +norec ($n)"
616 617 618 619 620
ret=0
$DIG $DIGOPTS +norec mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
621
if [ $ret != 0 ]; then echo_i "failed"; fi
622 623
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
624
echo_i "checking non-existent AAAA lookup works, recursive only +norec ($n)"
625 626 627 628
ret=0
$DIG $DIGOPTS +norec non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
629
if [ $ret != 0 ]; then echo_i "failed"; fi
630 631
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
632
echo_i "checking non-excluded AAAA via CNAME lookup works, recursive only +norec ($n)"
633 634 635 636 637
ret=0
$DIG $DIGOPTS +norec cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
638
if [ $ret != 0 ]; then echo_i "failed"; fi
639 640
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
641
echo_i "checking excluded only AAAA via CNAME lookup works, recursive only +norec ($n)"
642 643 644 645 646 647
ret=0
$DIG $DIGOPTS +norec cname-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
648
if [ $ret != 0 ]; then echo_i "failed"; fi
649 650
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
651
echo_i "checking excluded AAAA and non-mapped A via CNAME lookup works, recursive only +norec ($n)"
652 653 654 655 656 657
ret=0
$DIG $DIGOPTS +norec cname-excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
658
if [ $ret != 0 ]; then echo_i "failed"; fi
659 660
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
661
echo_i "checking excluded only AAAA and mapped A via CNAME lookup works, recursive only +norec ($n)"
662 663 664 665 666 667
ret=0
$DIG $DIGOPTS +norec cname-excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
668
if [ $ret != 0 ]; then echo_i "failed"; fi
669 670
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
671
echo_i "checking AAAA only via CNAME lookup works, recursive only +norec ($n)"
672 673 674 675 676
ret=0
$DIG $DIGOPTS +norec cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
677
if [ $ret != 0 ]; then echo_i "failed"; fi
678 679
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
680
echo_i "checking A only via CNAME lookup works, recursive only +norec ($n)"
681 682 683 684 685 686
ret=0
$DIG $DIGOPTS +norec cname-a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	a-only.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
687
if [ $ret != 0 ]; then echo_i "failed"; fi
688 689
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
690
echo_i "checking A and AAAA via CNAME lookup works, recursive only +norec ($n)"
691 692 693 694 695
ret=0
$DIG $DIGOPTS +norec cname-a-and-aaaa.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
696
if [ $ret != 0 ]; then echo_i "failed"; fi
697 698
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
699
echo_i "checking non-mapped A via CNAME lookup works, recursive only +norec ($n)"
700 701 702 703 704 705
ret=0
$DIG $DIGOPTS +norec cname-a-not-mapped.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
706
if [ $ret != 0 ]; then echo_i "failed"; fi
707 708
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
709
echo_i "checking NODATA AAAA via CNAME lookup works, recursive only +norec ($n)"
710 711 712 713 714 715
ret=0
$DIG $DIGOPTS +norec cname-mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
716
if [ $ret != 0 ]; then echo_i "failed"; fi
717 718
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
719
echo_i "checking non-existent AAAA via CNAME lookup works, recursive only +norec ($n)"
720 721 722 723 724
ret=0
$DIG $DIGOPTS +norec cname-non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
725
if [ $ret != 0 ]; then echo_i "failed"; fi
726 727 728 729
status=`expr $status + $ret`

# Check the example. domain from non client

Evan Hunt's avatar
Evan Hunt committed
730
echo_i "checking non-excluded AAAA from non-client lookup works ($n)"
731 732 733 734 735
ret=0
$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
736
if [ $ret != 0 ]; then echo_i "failed"; fi
737 738
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
739
echo_i "checking excluded only AAAA from non-client lookup works ($n)"
740 741 742 743 744
ret=0
$DIG $DIGOPTS excluded-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
745
if [ $ret != 0 ]; then echo_i "failed"; fi
746 747
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
748
echo_i "checking excluded AAAA and non-mapped A from non-client lookup works ($n)"
749 750 751 752 753
ret=0
$DIG $DIGOPTS excluded-bad-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
754
if [ $ret != 0 ]; then echo_i "failed"; fi
755 756
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
757
echo_i "checking excluded only AAAA and mapped A from non-client lookup works ($n)"
758 759 760 761 762
ret=0
$DIG $DIGOPTS excluded-good-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
763
if [ $ret != 0 ]; then echo_i "failed"; fi
764 765
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
766
echo_i "checking AAAA only from non-client lookup works ($n)"
767 768 769 770 771
ret=0
$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
772
if [ $ret != 0 ]; then echo_i "failed"; fi
773 774
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
775
echo_i "checking A only from non-client lookup works ($n)"
776 777 778 779 780
ret=0
$DIG $DIGOPTS a-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
781
if [ $ret != 0 ]; then echo_i "failed"; fi
782 783
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
784
echo_i "checking A and AAAA from non-client lookup works ($n)"
785 786 787 788 789
ret=0
$DIG $DIGOPTS a-and-aaaa.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
790
if [ $ret != 0 ]; then echo_i "failed"; fi
791 792
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
793
echo_i "checking non-mapped A from non-client lookup works ($n)"
794 795 796 797 798
ret=0
$DIG $DIGOPTS a-not-mapped.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
799
if [ $ret != 0 ]; then echo_i "failed"; fi
800 801
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
802
echo_i "checking NODATA AAAA from non-client lookup works ($n)"
803 804 805 806 807
ret=0
$DIG $DIGOPTS mx-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
808
if [ $ret != 0 ]; then echo_i "failed"; fi
809 810
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
811
echo_i "checking non-existent AAAA from non-client lookup works ($n)"
812 813 814 815
ret=0
$DIG $DIGOPTS non-existent.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
816
if [ $ret != 0 ]; then echo_i "failed"; fi
817 818
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
819
echo_i "checking non-excluded AAAA via CNAME from non-client lookup works ($n)"
820 821 822 823 824
ret=0
$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
825
if [ $ret != 0 ]; then echo_i "failed"; fi
826 827
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
828
echo_i "checking excluded only AAAA via CNAME from non-client lookup works ($n)"
829 830 831 832 833
ret=0
$DIG $DIGOPTS cname-excluded-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
834
if [ $ret != 0 ]; then echo_i "failed"; fi
835 836
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
837
echo_i "checking excluded AAAA and non-mapped A via CNAME from non-client lookup works ($n)"
838 839 840 841 842
ret=0
$DIG $DIGOPTS cname-excluded-bad-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
843
if [ $ret != 0 ]; then echo_i "failed"; fi
844 845
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
846
echo_i "checking excluded only AAAA and mapped A via CNAME from non-client lookup works ($n)"
847 848 849 850 851
ret=0
$DIG $DIGOPTS cname-excluded-good-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
852
if [ $ret != 0 ]; then echo_i "failed"; fi
853 854
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
855
echo_i "checking AAAA only via CNAME from non-client lookup works ($n)"
856 857 858 859 860
ret=0
$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
861
if [ $ret != 0 ]; then echo_i "failed"; fi
862 863
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
864
echo_i "checking A only via CNAME from non-client lookup works ($n)"
865 866 867 868 869
ret=0
$DIG $DIGOPTS cname-a-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
870
if [ $ret != 0 ]; then echo_i "failed"; fi
871 872
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
873
echo_i "checking A and AAAA via CNAME from non-client lookup works ($n)"
874 875 876 877 878
ret=0
$DIG $DIGOPTS cname-a-and-aaaa.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
879
if [ $ret != 0 ]; then echo_i "failed"; fi
880 881
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
882
echo_i "checking non-mapped A via CNAME from non-client lookup works ($n)"
883 884 885 886 887 888
ret=0
$DIG $DIGOPTS cname-a-not-mapped.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
889
if [ $ret != 0 ]; then echo_i "failed"; fi
890 891
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
892
echo_i "checking NODATA AAAA via CNAME from non-client lookup works ($n)"
893 894 895 896 897 898
ret=0
$DIG $DIGOPTS cname-mx-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
grep "CNAME	mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
899
if [ $ret != 0 ]; then echo_i "failed"; fi
900 901
status=`expr $status + $ret`

Evan Hunt's avatar
Evan Hunt committed
902
echo_i "checking non-existent AAAA via CNAME from non-client lookup works ($n)"
903 904 905 906 907
ret=0
$DIG $DIGOPTS cname-non-existent.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
908
if [ $ret != 0 ]; then echo_i "failed"; fi
909 910 911 912
status=`expr $status + $ret`

# Check the signed. domain

Evan Hunt's avatar
Evan Hunt committed
913
echo_i "checking non-excluded AAAA lookup is signed zone works ($n)"
914 915 916 917 918
ret=0
$DIG $DIGOPTS aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
Evan Hunt's avatar
Evan Hunt committed
919
if [ $ret != 0 ]; then echo_i "failed"; fi
920 921
status=`expr $status + $ret`