1#!/bin/sh 2# 3# Copyright (C) 2010-2014 Internet Systems Consortium, Inc. ("ISC") 4# 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. 8# 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. 16 17# Id: tests.sh,v 1.5 2011/02/03 07:35:55 marka Exp 18 19SYSTEMTESTTOP=.. 20. $SYSTEMTESTTOP/conf.sh 21 22status=0 23n=0 24 25rm -f dig.out.* 26 27DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p 5300" 28 29for conf in conf/good*.conf 30do 31 echo "I:checking that $conf is accepted ($n)" 32 ret=0 33 $CHECKCONF "$conf" || ret=1 34 n=`expr $n + 1` 35 if [ $ret != 0 ]; then echo "I:failed"; fi 36 status=`expr $status + $ret` 37done 38 39for conf in conf/bad*.conf 40do 41 echo "I:checking that $conf is rejected ($n)" 42 ret=0 43 $CHECKCONF "$conf" >/dev/null && ret=1 44 n=`expr $n + 1` 45 if [ $ret != 0 ]; then echo "I:failed"; fi 46 status=`expr $status + $ret` 47done 48 49# Check the example. domain 50 51echo "I: checking non-excluded AAAA lookup works ($n)" 52ret=0 53$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 54grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 55grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 56n=`expr $n + 1` 57if [ $ret != 0 ]; then echo "I:failed"; fi 58status=`expr $status + $ret` 59 60echo "I: checking excluded only AAAA lookup works ($n)" 61ret=0 62$DIG $DIGOPTS excluded-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 63grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 64grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 65n=`expr $n + 1` 66if [ $ret != 0 ]; then echo "I:failed"; fi 67status=`expr $status + $ret` 68 69echo "I: checking excluded AAAA and non-mapped A lookup works ($n)" 70ret=0 71$DIG $DIGOPTS excluded-bad-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 72grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 73grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 74n=`expr $n + 1` 75if [ $ret != 0 ]; then echo "I:failed"; fi 76status=`expr $status + $ret` 77 78echo "I: checking excluded only AAAA and mapped A lookup works ($n)" 79ret=0 80$DIG $DIGOPTS excluded-good-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 81grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 82grep "2001:aaaa::1.2.3.4" dig.out.ns2.test$n > /dev/null || ret=1 83n=`expr $n + 1` 84if [ $ret != 0 ]; then echo "I:failed"; fi 85status=`expr $status + $ret` 86 87echo "I: checking partially excluded only AAAA lookup works ($n)" 88ret=0 89$DIG $DIGOPTS partially-excluded-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 90grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 91grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 92grep "2001::3" dig.out.ns2.test$n > /dev/null || ret=1 93n=`expr $n + 1` 94if [ $ret != 0 ]; then echo "I:failed"; fi 95status=`expr $status + $ret` 96 97echo "I: checking partially-excluded AAAA and non-mapped A lookup works ($n)" 98ret=0 99$DIG $DIGOPTS partially-excluded-bad-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 100grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 101grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 102grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 103n=`expr $n + 1` 104if [ $ret != 0 ]; then echo "I:failed"; fi 105status=`expr $status + $ret` 106 107echo "I: checking partially-excluded only AAAA and mapped A lookup works ($n)" 108ret=0 109$DIG $DIGOPTS partially-excluded-good-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 110grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 111grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 112grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 113n=`expr $n + 1` 114if [ $ret != 0 ]; then echo "I:failed"; fi 115status=`expr $status + $ret` 116 117echo "I: checking AAAA only lookup works ($n)" 118ret=0 119$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 120grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 121grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 122n=`expr $n + 1` 123if [ $ret != 0 ]; then echo "I:failed"; fi 124status=`expr $status + $ret` 125 126echo "I: checking A only lookup works ($n)" 127ret=0 128$DIG $DIGOPTS a-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 129grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 130grep "2001:aaaa::102:305" dig.out.ns2.test$n > /dev/null || ret=1 131n=`expr $n + 1` 132if [ $ret != 0 ]; then echo "I:failed"; fi 133status=`expr $status + $ret` 134 135echo "I: checking A and AAAA lookup works ($n)" 136ret=0 137$DIG $DIGOPTS a-and-aaaa.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 138grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 139grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 140n=`expr $n + 1` 141if [ $ret != 0 ]; then echo "I:failed"; fi 142status=`expr $status + $ret` 143 144echo "I: checking non-mapped A lookup works ($n)" 145ret=0 146$DIG $DIGOPTS a-not-mapped.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 147grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 148grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 149n=`expr $n + 1` 150if [ $ret != 0 ]; then echo "I:failed"; fi 151status=`expr $status + $ret` 152 153echo "I: checking NODATA AAAA lookup works ($n)" 154ret=0 155$DIG $DIGOPTS mx-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 156grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 157grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 158n=`expr $n + 1` 159if [ $ret != 0 ]; then echo "I:failed"; fi 160status=`expr $status + $ret` 161 162echo "I: checking non-existent AAAA lookup works ($n)" 163ret=0 164$DIG $DIGOPTS non-existent.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 165grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 166n=`expr $n + 1` 167if [ $ret != 0 ]; then echo "I:failed"; fi 168status=`expr $status + $ret` 169 170echo "I: checking non-excluded AAAA via CNAME lookup works ($n)" 171ret=0 172$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 173grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 174grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 175n=`expr $n + 1` 176if [ $ret != 0 ]; then echo "I:failed"; fi 177status=`expr $status + $ret` 178 179echo "I: checking excluded only AAAA via CNAME lookup works ($n)" 180ret=0 181$DIG $DIGOPTS cname-excluded-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 182grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 183grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 184n=`expr $n + 1` 185if [ $ret != 0 ]; then echo "I:failed"; fi 186status=`expr $status + $ret` 187 188echo "I: checking excluded AAAA and non-mapped A via CNAME lookup works ($n)" 189ret=0 190$DIG $DIGOPTS cname-excluded-bad-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 191grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 192grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 193n=`expr $n + 1` 194if [ $ret != 0 ]; then echo "I:failed"; fi 195status=`expr $status + $ret` 196 197echo "I: checking excluded only AAAA and mapped A via CNAME lookup works ($n)" 198ret=0 199$DIG $DIGOPTS cname-excluded-good-a.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 200grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 201grep "2001:aaaa::1.2.3.4" dig.out.ns2.test$n > /dev/null || ret=1 202n=`expr $n + 1` 203if [ $ret != 0 ]; then echo "I:failed"; fi 204status=`expr $status + $ret` 205 206echo "I: checking AAAA only via CNAME lookup works ($n)" 207ret=0 208$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 209grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 210grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 211n=`expr $n + 1` 212if [ $ret != 0 ]; then echo "I:failed"; fi 213status=`expr $status + $ret` 214 215echo "I: checking A only via CNAME lookup works ($n)" 216ret=0 217$DIG $DIGOPTS cname-a-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 218grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 219grep "2001:aaaa::102:305" dig.out.ns2.test$n > /dev/null || ret=1 220n=`expr $n + 1` 221if [ $ret != 0 ]; then echo "I:failed"; fi 222status=`expr $status + $ret` 223 224echo "I: checking A and AAAA via CNAME lookup works ($n)" 225ret=0 226$DIG $DIGOPTS cname-a-and-aaaa.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 227grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 228grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 229n=`expr $n + 1` 230if [ $ret != 0 ]; then echo "I:failed"; fi 231status=`expr $status + $ret` 232 233echo "I: checking non-mapped A via CNAME lookup works ($n)" 234ret=0 235$DIG $DIGOPTS cname-a-not-mapped.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 236grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 237grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 238grep "CNAME a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1 239n=`expr $n + 1` 240if [ $ret != 0 ]; then echo "I:failed"; fi 241status=`expr $status + $ret` 242 243echo "I: checking NODATA AAAA via CNAME lookup works ($n)" 244ret=0 245$DIG $DIGOPTS cname-mx-only.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 246grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 247grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 248grep "CNAME mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1 249n=`expr $n + 1` 250if [ $ret != 0 ]; then echo "I:failed"; fi 251status=`expr $status + $ret` 252 253echo "I: checking non-existent AAAA via CNAME lookup works ($n)" 254ret=0 255$DIG $DIGOPTS cname-non-existent.example. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 256grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 257grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 258n=`expr $n + 1` 259if [ $ret != 0 ]; then echo "I:failed"; fi 260status=`expr $status + $ret` 261 262# Check the example. domain recursive only 263 264echo "I: checking non-excluded AAAA lookup works, recursive only ($n)" 265ret=0 266$DIG $DIGOPTS aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 267grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 268grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 269n=`expr $n + 1` 270if [ $ret != 0 ]; then echo "I:failed"; fi 271status=`expr $status + $ret` 272 273echo "I: checking excluded only AAAA lookup works, recursive only ($n)" 274ret=0 275$DIG $DIGOPTS excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 276grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 277grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 278n=`expr $n + 1` 279if [ $ret != 0 ]; then echo "I:failed"; fi 280status=`expr $status + $ret` 281 282echo "I: checking excluded AAAA and non-mapped A lookup works, recursive only ($n)" 283ret=0 284$DIG $DIGOPTS excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 285grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 286grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 287n=`expr $n + 1` 288if [ $ret != 0 ]; then echo "I:failed"; fi 289status=`expr $status + $ret` 290 291echo "I: checking excluded only AAAA and mapped A lookup works, recursive only ($n)" 292ret=0 293$DIG $DIGOPTS excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 294grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 295grep "2001:bbbb::1.2.3.4" dig.out.ns2.test$n > /dev/null || ret=1 296n=`expr $n + 1` 297if [ $ret != 0 ]; then echo "I:failed"; fi 298status=`expr $status + $ret` 299 300echo "I: checking partially excluded only AAAA lookup works, recursive only ($n)" 301ret=0 302$DIG $DIGOPTS partially-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 303grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 304grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 305grep "2001::3" dig.out.ns2.test$n > /dev/null || ret=1 306n=`expr $n + 1` 307if [ $ret != 0 ]; then echo "I:failed"; fi 308status=`expr $status + $ret` 309 310echo "I: checking partially-excluded AAAA and non-mapped A lookup works, recursive only ($n)" 311ret=0 312$DIG $DIGOPTS partially-excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 313grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 314grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 315grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 316n=`expr $n + 1` 317if [ $ret != 0 ]; then echo "I:failed"; fi 318status=`expr $status + $ret` 319 320echo "I: checking partially-excluded only AAAA and mapped A lookup works, recursive only ($n)" 321ret=0 322$DIG $DIGOPTS partially-excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 323grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 324grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 325grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 326n=`expr $n + 1` 327if [ $ret != 0 ]; then echo "I:failed"; fi 328status=`expr $status + $ret` 329 330echo "I: checking AAAA only lookup works, recursive only ($n)" 331ret=0 332$DIG $DIGOPTS aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 333grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 334grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 335n=`expr $n + 1` 336if [ $ret != 0 ]; then echo "I:failed"; fi 337status=`expr $status + $ret` 338 339echo "I: checking A only lookup works, recursive only ($n)" 340ret=0 341$DIG $DIGOPTS a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 342grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 343grep "2001:bbbb::102:305" dig.out.ns2.test$n > /dev/null || ret=1 344n=`expr $n + 1` 345if [ $ret != 0 ]; then echo "I:failed"; fi 346status=`expr $status + $ret` 347 348echo "I: checking A and AAAA lookup works, recursive only ($n)" 349ret=0 350$DIG $DIGOPTS a-and-aaaa.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 351grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 352grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 353n=`expr $n + 1` 354if [ $ret != 0 ]; then echo "I:failed"; fi 355status=`expr $status + $ret` 356 357echo "I: checking non-mapped A lookup works, recursive only ($n)" 358ret=0 359$DIG $DIGOPTS a-not-mapped.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 360grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 361grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 362n=`expr $n + 1` 363if [ $ret != 0 ]; then echo "I:failed"; fi 364status=`expr $status + $ret` 365 366echo "I: checking NODATA AAAA lookup works, recursive only ($n)" 367ret=0 368$DIG $DIGOPTS mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 369grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 370grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 371n=`expr $n + 1` 372if [ $ret != 0 ]; then echo "I:failed"; fi 373status=`expr $status + $ret` 374 375echo "I: checking non-existent AAAA lookup works, recursive only ($n)" 376ret=0 377$DIG $DIGOPTS non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 378grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 379n=`expr $n + 1` 380if [ $ret != 0 ]; then echo "I:failed"; fi 381status=`expr $status + $ret` 382 383echo "I: checking non-excluded AAAA via CNAME lookup works, recursive only ($n)" 384ret=0 385$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 386grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 387grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 388n=`expr $n + 1` 389if [ $ret != 0 ]; then echo "I:failed"; fi 390status=`expr $status + $ret` 391 392echo "I: checking excluded only AAAA via CNAME lookup works, recursive only ($n)" 393ret=0 394$DIG $DIGOPTS cname-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 395grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 396grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 397n=`expr $n + 1` 398if [ $ret != 0 ]; then echo "I:failed"; fi 399status=`expr $status + $ret` 400 401echo "I: checking excluded AAAA and non-mapped A via CNAME lookup works, recursive only ($n)" 402ret=0 403$DIG $DIGOPTS cname-excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 404grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 405grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 406n=`expr $n + 1` 407if [ $ret != 0 ]; then echo "I:failed"; fi 408status=`expr $status + $ret` 409 410echo "I: checking excluded only AAAA and mapped A via CNAME lookup works, recursive only ($n)" 411ret=0 412$DIG $DIGOPTS cname-excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 413grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 414grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 415grep "2001:bbbb::102:304" dig.out.ns2.test$n > /dev/null || ret=1 416n=`expr $n + 1` 417if [ $ret != 0 ]; then echo "I:failed"; fi 418status=`expr $status + $ret` 419 420echo "I: checking AAAA only via CNAME lookup works, recursive only ($n)" 421ret=0 422$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 423grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 424grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 425n=`expr $n + 1` 426if [ $ret != 0 ]; then echo "I:failed"; fi 427status=`expr $status + $ret` 428 429echo "I: checking A only via CNAME lookup works, recursive only ($n)" 430ret=0 431$DIG $DIGOPTS cname-a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 432grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 433grep "2001:bbbb::102:305" dig.out.ns2.test$n > /dev/null || ret=1 434n=`expr $n + 1` 435if [ $ret != 0 ]; then echo "I:failed"; fi 436status=`expr $status + $ret` 437 438echo "I: checking A and AAAA via CNAME lookup works, recursive only ($n)" 439ret=0 440$DIG $DIGOPTS cname-a-and-aaaa.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 441grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 442grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 443n=`expr $n + 1` 444if [ $ret != 0 ]; then echo "I:failed"; fi 445status=`expr $status + $ret` 446 447echo "I: checking non-mapped A via CNAME lookup works, recursive only ($n)" 448ret=0 449$DIG $DIGOPTS cname-a-not-mapped.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 450grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 451grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 452grep "CNAME a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1 453n=`expr $n + 1` 454if [ $ret != 0 ]; then echo "I:failed"; fi 455status=`expr $status + $ret` 456 457echo "I: checking NODATA AAAA via CNAME lookup works, recursive only ($n)" 458ret=0 459$DIG $DIGOPTS cname-mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 460grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 461grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 462grep "CNAME mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1 463n=`expr $n + 1` 464if [ $ret != 0 ]; then echo "I:failed"; fi 465status=`expr $status + $ret` 466 467echo "I: checking non-existent AAAA via CNAME lookup works, recursive only ($n)" 468ret=0 469$DIG $DIGOPTS cname-non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 470grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 471grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 472n=`expr $n + 1` 473if [ $ret != 0 ]; then echo "I:failed"; fi 474status=`expr $status + $ret` 475 476# Check the example. domain recursive only w/o recursion 477 478echo "I: checking non-excluded AAAA lookup works, recursive only +norec ($n)" 479ret=0 480$DIG $DIGOPTS +norec aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 481grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 482grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 483n=`expr $n + 1` 484if [ $ret != 0 ]; then echo "I:failed"; fi 485status=`expr $status + $ret` 486 487echo "I: checking excluded only AAAA lookup works, recursive only +norec ($n)" 488ret=0 489$DIG $DIGOPTS +norec excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 490grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 491grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 492grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1 493n=`expr $n + 1` 494if [ $ret != 0 ]; then echo "I:failed"; fi 495status=`expr $status + $ret` 496 497echo "I: checking excluded AAAA and non-mapped A lookup works, recursive only +norec ($n)" 498ret=0 499$DIG $DIGOPTS +norec excluded-bad-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 500grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 501grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 502grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1 503n=`expr $n + 1` 504if [ $ret != 0 ]; then echo "I:failed"; fi 505status=`expr $status + $ret` 506 507echo "I: checking excluded only AAAA and mapped A lookup works, recursive only +norec ($n)" 508ret=0 509$DIG $DIGOPTS +norec excluded-good-a.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 510grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 511grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1 512n=`expr $n + 1` 513if [ $ret != 0 ]; then echo "I:failed"; fi 514status=`expr $status + $ret` 515 516echo "I: checking partially excluded only AAAA lookup works, recursive only +norec ($n)" 517ret=0 518$DIG $DIGOPTS +norec partially-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 519grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 520grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 521grep "2001:eeee:" dig.out.ns2.test$n > /dev/null || ret=1 522grep "2001::3" dig.out.ns2.test$n > /dev/null || ret=1 523n=`expr $n + 1` 524if [ $ret != 0 ]; then echo "I:failed"; fi 525status=`expr $status + $ret` 526 527echo "I: checking partially-excluded AAAA and non-mapped A lookup works, recursive only +norec ($n)" 528ret=0 529$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 530grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 531grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 532grep "2001:eeee:" dig.out.ns2.test$n > /dev/null || ret=1 533grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 534n=`expr $n + 1` 535if [ $ret != 0 ]; then echo "I:failed"; fi 536status=`expr $status + $ret` 537 538echo "I: checking partially-excluded only AAAA and mapped A lookup works, recursive only +norec ($n)" 539ret=0 540$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 541grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 542grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 543grep "2001:eeee:" dig.out.ns2.test$n > /dev/null || ret=1 544grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 545n=`expr $n + 1` 546if [ $ret != 0 ]; then echo "I:failed"; fi 547status=`expr $status + $ret` 548 549echo "I: checking AAAA only lookup works, recursive only +norec ($n)" 550ret=0 551$DIG $DIGOPTS +norec aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 552grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 553grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 554n=`expr $n + 1` 555if [ $ret != 0 ]; then echo "I:failed"; fi 556status=`expr $status + $ret` 557 558echo "I: checking A only lookup works, recursive only +norec ($n)" 559ret=0 560$DIG $DIGOPTS +norec a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 561grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 562grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 563n=`expr $n + 1` 564if [ $ret != 0 ]; then echo "I:failed"; fi 565status=`expr $status + $ret` 566 567echo "I: checking A and AAAA lookup works, recursive only +norec ($n)" 568ret=0 569$DIG $DIGOPTS +norec a-and-aaaa.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 570grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 571grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 572n=`expr $n + 1` 573if [ $ret != 0 ]; then echo "I:failed"; fi 574status=`expr $status + $ret` 575 576echo "I: checking non-mapped A lookup works, recursive only +norec ($n)" 577ret=0 578$DIG $DIGOPTS +norec a-not-mapped.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 579grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 580grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 581n=`expr $n + 1` 582if [ $ret != 0 ]; then echo "I:failed"; fi 583status=`expr $status + $ret` 584 585echo "I: checking NODATA AAAA lookup works, recursive only +norec ($n)" 586ret=0 587$DIG $DIGOPTS +norec mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 588grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 589grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 590n=`expr $n + 1` 591if [ $ret != 0 ]; then echo "I:failed"; fi 592status=`expr $status + $ret` 593 594echo "I: checking non-existent AAAA lookup works, recursive only +norec ($n)" 595ret=0 596$DIG $DIGOPTS +norec non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 597grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 598n=`expr $n + 1` 599if [ $ret != 0 ]; then echo "I:failed"; fi 600status=`expr $status + $ret` 601 602echo "I: checking non-excluded AAAA via CNAME lookup works, recursive only +norec ($n)" 603ret=0 604$DIG $DIGOPTS +norec cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 605grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 606grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 607n=`expr $n + 1` 608if [ $ret != 0 ]; then echo "I:failed"; fi 609status=`expr $status + $ret` 610 611echo "I: checking excluded only AAAA via CNAME lookup works, recursive only +norec ($n)" 612ret=0 613$DIG $DIGOPTS +norec cname-excluded-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 614grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 615grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 616grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1 617n=`expr $n + 1` 618if [ $ret != 0 ]; then echo "I:failed"; fi 619status=`expr $status + $ret` 620 621echo "I: checking excluded AAAA and non-mapped A via CNAME lookup works, recursive only +norec ($n)" 622ret=0 623$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 624grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 625grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 626grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1 627n=`expr $n + 1` 628if [ $ret != 0 ]; then echo "I:failed"; fi 629status=`expr $status + $ret` 630 631echo "I: checking excluded only AAAA and mapped A via CNAME lookup works, recursive only +norec ($n)" 632ret=0 633$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 634grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 635grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 636grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1 637n=`expr $n + 1` 638if [ $ret != 0 ]; then echo "I:failed"; fi 639status=`expr $status + $ret` 640 641echo "I: checking AAAA only via CNAME lookup works, recursive only +norec ($n)" 642ret=0 643$DIG $DIGOPTS +norec cname-aaaa-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 644grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 645grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 646n=`expr $n + 1` 647if [ $ret != 0 ]; then echo "I:failed"; fi 648status=`expr $status + $ret` 649 650echo "I: checking A only via CNAME lookup works, recursive only +norec ($n)" 651ret=0 652$DIG $DIGOPTS +norec cname-a-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 653grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 654grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 655grep "CNAME a-only.example." dig.out.ns2.test$n > /dev/null || ret=1 656n=`expr $n + 1` 657if [ $ret != 0 ]; then echo "I:failed"; fi 658status=`expr $status + $ret` 659 660echo "I: checking A and AAAA via CNAME lookup works, recursive only +norec ($n)" 661ret=0 662$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 663grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 664grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 665n=`expr $n + 1` 666if [ $ret != 0 ]; then echo "I:failed"; fi 667status=`expr $status + $ret` 668 669echo "I: checking non-mapped A via CNAME lookup works, recursive only +norec ($n)" 670ret=0 671$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 672grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 673grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 674grep "CNAME a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1 675n=`expr $n + 1` 676if [ $ret != 0 ]; then echo "I:failed"; fi 677status=`expr $status + $ret` 678 679echo "I: checking NODATA AAAA via CNAME lookup works, recursive only +norec ($n)" 680ret=0 681$DIG $DIGOPTS +norec cname-mx-only.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 682grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 683grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 684grep "CNAME mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1 685n=`expr $n + 1` 686if [ $ret != 0 ]; then echo "I:failed"; fi 687status=`expr $status + $ret` 688 689echo "I: checking non-existent AAAA via CNAME lookup works, recursive only +norec ($n)" 690ret=0 691$DIG $DIGOPTS +norec cname-non-existent.example. @10.53.0.1 -b 10.53.0.1 aaaa > dig.out.ns2.test$n || ret=1 692grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 693grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 694n=`expr $n + 1` 695if [ $ret != 0 ]; then echo "I:failed"; fi 696status=`expr $status + $ret` 697 698# Check the example. domain from non client 699 700echo "I: checking non-excluded AAAA from non-client lookup works ($n)" 701ret=0 702$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 703grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 704grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 705n=`expr $n + 1` 706if [ $ret != 0 ]; then echo "I:failed"; fi 707status=`expr $status + $ret` 708 709echo "I: checking excluded only AAAA from non-client lookup works ($n)" 710ret=0 711$DIG $DIGOPTS excluded-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 712grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 713grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1 714n=`expr $n + 1` 715if [ $ret != 0 ]; then echo "I:failed"; fi 716status=`expr $status + $ret` 717 718echo "I: checking excluded AAAA and non-mapped A from non-client lookup works ($n)" 719ret=0 720$DIG $DIGOPTS excluded-bad-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 721grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 722grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1 723n=`expr $n + 1` 724if [ $ret != 0 ]; then echo "I:failed"; fi 725status=`expr $status + $ret` 726 727echo "I: checking excluded only AAAA and mapped A from non-client lookup works ($n)" 728ret=0 729$DIG $DIGOPTS excluded-good-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 730grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 731grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1 732n=`expr $n + 1` 733if [ $ret != 0 ]; then echo "I:failed"; fi 734status=`expr $status + $ret` 735 736echo "I: checking AAAA only from non-client lookup works ($n)" 737ret=0 738$DIG $DIGOPTS aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 739grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 740grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 741n=`expr $n + 1` 742if [ $ret != 0 ]; then echo "I:failed"; fi 743status=`expr $status + $ret` 744 745echo "I: checking A only from non-client lookup works ($n)" 746ret=0 747$DIG $DIGOPTS a-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 748grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 749grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 750n=`expr $n + 1` 751if [ $ret != 0 ]; then echo "I:failed"; fi 752status=`expr $status + $ret` 753 754echo "I: checking A and AAAA from non-client lookup works ($n)" 755ret=0 756$DIG $DIGOPTS a-and-aaaa.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 757grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 758grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 759n=`expr $n + 1` 760if [ $ret != 0 ]; then echo "I:failed"; fi 761status=`expr $status + $ret` 762 763echo "I: checking non-mapped A from non-client lookup works ($n)" 764ret=0 765$DIG $DIGOPTS a-not-mapped.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 766grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 767grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 768n=`expr $n + 1` 769if [ $ret != 0 ]; then echo "I:failed"; fi 770status=`expr $status + $ret` 771 772echo "I: checking NODATA AAAA from non-client lookup works ($n)" 773ret=0 774$DIG $DIGOPTS mx-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 775grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 776grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 777n=`expr $n + 1` 778if [ $ret != 0 ]; then echo "I:failed"; fi 779status=`expr $status + $ret` 780 781echo "I: checking non-existent AAAA from non-client lookup works ($n)" 782ret=0 783$DIG $DIGOPTS non-existent.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 784grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 785n=`expr $n + 1` 786if [ $ret != 0 ]; then echo "I:failed"; fi 787status=`expr $status + $ret` 788 789echo "I: checking non-excluded AAAA via CNAME from non-client lookup works ($n)" 790ret=0 791$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 792grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 793grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 794n=`expr $n + 1` 795if [ $ret != 0 ]; then echo "I:failed"; fi 796status=`expr $status + $ret` 797 798echo "I: checking excluded only AAAA via CNAME from non-client lookup works ($n)" 799ret=0 800$DIG $DIGOPTS cname-excluded-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 801grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 802grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1 803n=`expr $n + 1` 804if [ $ret != 0 ]; then echo "I:failed"; fi 805status=`expr $status + $ret` 806 807echo "I: checking excluded AAAA and non-mapped A via CNAME from non-client lookup works ($n)" 808ret=0 809$DIG $DIGOPTS cname-excluded-bad-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 810grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 811grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1 812n=`expr $n + 1` 813if [ $ret != 0 ]; then echo "I:failed"; fi 814status=`expr $status + $ret` 815 816echo "I: checking excluded only AAAA and mapped A via CNAME from non-client lookup works ($n)" 817ret=0 818$DIG $DIGOPTS cname-excluded-good-a.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 819grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 820grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1 821n=`expr $n + 1` 822if [ $ret != 0 ]; then echo "I:failed"; fi 823status=`expr $status + $ret` 824 825echo "I: checking AAAA only via CNAME from non-client lookup works ($n)" 826ret=0 827$DIG $DIGOPTS cname-aaaa-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 828grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 829grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 830n=`expr $n + 1` 831if [ $ret != 0 ]; then echo "I:failed"; fi 832status=`expr $status + $ret` 833 834echo "I: checking A only via CNAME from non-client lookup works ($n)" 835ret=0 836$DIG $DIGOPTS cname-a-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 837grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 838grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 839n=`expr $n + 1` 840if [ $ret != 0 ]; then echo "I:failed"; fi 841status=`expr $status + $ret` 842 843echo "I: checking A and AAAA via CNAME from non-client lookup works ($n)" 844ret=0 845$DIG $DIGOPTS cname-a-and-aaaa.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 846grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 847grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 848n=`expr $n + 1` 849if [ $ret != 0 ]; then echo "I:failed"; fi 850status=`expr $status + $ret` 851 852echo "I: checking non-mapped A via CNAME from non-client lookup works ($n)" 853ret=0 854$DIG $DIGOPTS cname-a-not-mapped.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 855grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 856grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 857grep "CNAME a-not-mapped.example." dig.out.ns2.test$n > /dev/null || ret=1 858n=`expr $n + 1` 859if [ $ret != 0 ]; then echo "I:failed"; fi 860status=`expr $status + $ret` 861 862echo "I: checking NODATA AAAA via CNAME from non-client lookup works ($n)" 863ret=0 864$DIG $DIGOPTS cname-mx-only.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 865grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 866grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 867grep "CNAME mx-only.example." dig.out.ns2.test$n > /dev/null || ret=1 868n=`expr $n + 1` 869if [ $ret != 0 ]; then echo "I:failed"; fi 870status=`expr $status + $ret` 871 872echo "I: checking non-existent AAAA via CNAME from non-client lookup works ($n)" 873ret=0 874$DIG $DIGOPTS cname-non-existent.example. @10.53.0.2 -b 10.53.0.3 aaaa > dig.out.ns2.test$n || ret=1 875grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 876grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 877n=`expr $n + 1` 878if [ $ret != 0 ]; then echo "I:failed"; fi 879status=`expr $status + $ret` 880 881# Check the signed. domain 882 883echo "I: checking non-excluded AAAA lookup is signed zone works ($n)" 884ret=0 885$DIG $DIGOPTS aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 886grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 887grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 888n=`expr $n + 1` 889if [ $ret != 0 ]; then echo "I:failed"; fi 890status=`expr $status + $ret` 891 892echo "I: checking excluded only AAAA lookup is signed zone works ($n)" 893ret=0 894$DIG $DIGOPTS excluded-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 895grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 896grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 897n=`expr $n + 1` 898if [ $ret != 0 ]; then echo "I:failed"; fi 899status=`expr $status + $ret` 900 901echo "I: checking excluded AAAA and non-mapped A lookup is signed zone works ($n)" 902ret=0 903$DIG $DIGOPTS excluded-bad-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 904grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 905grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 906n=`expr $n + 1` 907if [ $ret != 0 ]; then echo "I:failed"; fi 908status=`expr $status + $ret` 909 910echo "I: checking excluded only AAAA and mapped A lookup is signed zone works ($n)" 911ret=0 912$DIG $DIGOPTS excluded-good-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 913grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 914grep "2001:aaaa::102:304" dig.out.ns2.test$n > /dev/null || ret=1 915n=`expr $n + 1` 916if [ $ret != 0 ]; then echo "I:failed"; fi 917status=`expr $status + $ret` 918 919echo "I: checking AAAA only lookup is signed zone works ($n)" 920ret=0 921$DIG $DIGOPTS aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 922grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 923grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 924n=`expr $n + 1` 925if [ $ret != 0 ]; then echo "I:failed"; fi 926status=`expr $status + $ret` 927 928echo "I: checking A only lookup is signed zone works ($n)" 929ret=0 930$DIG $DIGOPTS a-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 931grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 932grep "2001:aaaa::102:305" dig.out.ns2.test$n > /dev/null || ret=1 933n=`expr $n + 1` 934if [ $ret != 0 ]; then echo "I:failed"; fi 935status=`expr $status + $ret` 936 937echo "I: checking A and AAAA lookup is signed zone works ($n)" 938ret=0 939$DIG $DIGOPTS a-and-aaaa.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 940grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 941grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 942n=`expr $n + 1` 943if [ $ret != 0 ]; then echo "I:failed"; fi 944status=`expr $status + $ret` 945 946echo "I: checking non-mapped A lookup is signed zone works ($n)" 947ret=0 948$DIG $DIGOPTS a-not-mapped.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 949grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 950grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 951n=`expr $n + 1` 952if [ $ret != 0 ]; then echo "I:failed"; fi 953status=`expr $status + $ret` 954 955echo "I: checking NODATA AAAA lookup is signed zone works ($n)" 956ret=0 957$DIG $DIGOPTS mx-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 958grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 959grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 960n=`expr $n + 1` 961if [ $ret != 0 ]; then echo "I:failed"; fi 962status=`expr $status + $ret` 963 964echo "I: checking non-existent AAAA lookup is signed zone works ($n)" 965ret=0 966$DIG $DIGOPTS non-existent.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 967grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 968n=`expr $n + 1` 969if [ $ret != 0 ]; then echo "I:failed"; fi 970status=`expr $status + $ret` 971 972echo "I: checking non-excluded AAAA via CNAME lookup is signed zone works ($n)" 973ret=0 974$DIG $DIGOPTS cname-aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 975grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 976grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 977n=`expr $n + 1` 978if [ $ret != 0 ]; then echo "I:failed"; fi 979status=`expr $status + $ret` 980 981echo "I: checking excluded only AAAA via CNAME lookup is signed zone works ($n)" 982ret=0 983$DIG $DIGOPTS cname-excluded-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 984grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 985grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 986n=`expr $n + 1` 987if [ $ret != 0 ]; then echo "I:failed"; fi 988status=`expr $status + $ret` 989 990echo "I: checking excluded AAAA and non-mapped A via CNAME lookup is signed zone works ($n)" 991ret=0 992$DIG $DIGOPTS cname-excluded-bad-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 993grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 994grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 995n=`expr $n + 1` 996if [ $ret != 0 ]; then echo "I:failed"; fi 997status=`expr $status + $ret` 998 999echo "I: checking excluded only AAAA and mapped A via CNAME lookup is signed zone works ($n)" 1000ret=0 1001$DIG $DIGOPTS cname-excluded-good-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1002grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1003grep "2001:aaaa::102:304" dig.out.ns2.test$n > /dev/null || ret=1 1004n=`expr $n + 1` 1005if [ $ret != 0 ]; then echo "I:failed"; fi 1006status=`expr $status + $ret` 1007 1008echo "I: checking AAAA only via CNAME lookup is signed zone works ($n)" 1009ret=0 1010$DIG $DIGOPTS cname-aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1011grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1012grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 1013n=`expr $n + 1` 1014if [ $ret != 0 ]; then echo "I:failed"; fi 1015status=`expr $status + $ret` 1016 1017echo "I: checking A only via CNAME lookup is signed zone works ($n)" 1018ret=0 1019$DIG $DIGOPTS cname-a-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1020grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1021grep "2001:aaaa::102:305" dig.out.ns2.test$n > /dev/null || ret=1 1022n=`expr $n + 1` 1023if [ $ret != 0 ]; then echo "I:failed"; fi 1024status=`expr $status + $ret` 1025 1026echo "I: checking A and AAAA via CNAME lookup is signed zone works ($n)" 1027ret=0 1028$DIG $DIGOPTS cname-a-and-aaaa.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1029grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1030grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 1031n=`expr $n + 1` 1032if [ $ret != 0 ]; then echo "I:failed"; fi 1033status=`expr $status + $ret` 1034 1035echo "I: checking non-mapped A via CNAME lookup is signed zone works ($n)" 1036ret=0 1037$DIG $DIGOPTS cname-a-not-mapped.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1038grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1039grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 1040grep "CNAME a-not-mapped.signed." dig.out.ns2.test$n > /dev/null || ret=1 1041n=`expr $n + 1` 1042if [ $ret != 0 ]; then echo "I:failed"; fi 1043status=`expr $status + $ret` 1044 1045echo "I: checking NODATA AAAA via CNAME lookup is signed zone works ($n)" 1046ret=0 1047$DIG $DIGOPTS cname-mx-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1048grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1049grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 1050grep "CNAME mx-only.signed." dig.out.ns2.test$n > /dev/null || ret=1 1051n=`expr $n + 1` 1052if [ $ret != 0 ]; then echo "I:failed"; fi 1053status=`expr $status + $ret` 1054 1055echo "I: checking non-existent AAAA via CNAME lookup is signed zone works ($n)" 1056ret=0 1057$DIG $DIGOPTS cname-non-existent.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1058grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 1059grep "ANSWER: 1," dig.out.ns2.test$n > /dev/null || ret=1 1060n=`expr $n + 1` 1061if [ $ret != 0 ]; then echo "I:failed"; fi 1062status=`expr $status + $ret` 1063 1064# Check the signed. domain 1065echo "I: checking non-excluded AAAA lookup is signed zone works with +dnssec ($n)" 1066ret=0 1067$DIG $DIGOPTS +dnssec aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1068grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1069grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 1070n=`expr $n + 1` 1071if [ $ret != 0 ]; then echo "I:failed"; fi 1072status=`expr $status + $ret` 1073 1074echo "I: checking excluded only AAAA lookup is signed zone works with +dnssec ($n)" 1075ret=0 1076$DIG $DIGOPTS +dnssec excluded-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1077grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1078grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1 1079n=`expr $n + 1` 1080if [ $ret != 0 ]; then echo "I:failed"; fi 1081status=`expr $status + $ret` 1082 1083echo "I: checking excluded AAAA and non-mapped A lookup is signed zone works with +dnssec ($n)" 1084ret=0 1085$DIG $DIGOPTS +dnssec excluded-bad-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1086grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1087grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1 1088n=`expr $n + 1` 1089if [ $ret != 0 ]; then echo "I:failed"; fi 1090status=`expr $status + $ret` 1091 1092echo "I: checking excluded only AAAA and mapped A lookup is signed zone works with +dnssec ($n)" 1093ret=0 1094$DIG $DIGOPTS +dnssec excluded-good-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1095grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1096grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1 1097n=`expr $n + 1` 1098if [ $ret != 0 ]; then echo "I:failed"; fi 1099status=`expr $status + $ret` 1100 1101echo "I: checking AAAA only lookup is signed zone works with +dnssec ($n)" 1102ret=0 1103$DIG $DIGOPTS +dnssec aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1104grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1105grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 1106n=`expr $n + 1` 1107if [ $ret != 0 ]; then echo "I:failed"; fi 1108status=`expr $status + $ret` 1109 1110echo "I: checking A only lookup is signed zone works with +dnssec ($n)" 1111ret=0 1112$DIG $DIGOPTS +dnssec a-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1113grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1114grep "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 1115n=`expr $n + 1` 1116if [ $ret != 0 ]; then echo "I:failed"; fi 1117status=`expr $status + $ret` 1118 1119echo "I: checking A and AAAA lookup is signed zone works with +dnssec ($n)" 1120ret=0 1121$DIG $DIGOPTS +dnssec a-and-aaaa.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1122grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1123grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 1124n=`expr $n + 1` 1125if [ $ret != 0 ]; then echo "I:failed"; fi 1126status=`expr $status + $ret` 1127 1128echo "I: checking non-mapped A lookup is signed zone works with +dnssec ($n)" 1129ret=0 1130$DIG $DIGOPTS +dnssec a-not-mapped.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1131grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1132grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 1133n=`expr $n + 1` 1134if [ $ret != 0 ]; then echo "I:failed"; fi 1135status=`expr $status + $ret` 1136 1137echo "I: checking NODATA AAAA lookup is signed zone works with +dnssec ($n)" 1138ret=0 1139$DIG $DIGOPTS +dnssec mx-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1140grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1141grep "ANSWER: 0" dig.out.ns2.test$n > /dev/null || ret=1 1142n=`expr $n + 1` 1143if [ $ret != 0 ]; then echo "I:failed"; fi 1144status=`expr $status + $ret` 1145 1146echo "I: checking non-existent AAAA lookup is signed zone works with +dnssec ($n)" 1147ret=0 1148$DIG $DIGOPTS +dnssec non-existent.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1149grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 1150n=`expr $n + 1` 1151if [ $ret != 0 ]; then echo "I:failed"; fi 1152status=`expr $status + $ret` 1153 1154echo "I: checking non-excluded AAAA via CNAME lookup is signed zone works with +dnssec ($n)" 1155ret=0 1156$DIG $DIGOPTS +dnssec cname-aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1157grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1158grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 1159n=`expr $n + 1` 1160if [ $ret != 0 ]; then echo "I:failed"; fi 1161status=`expr $status + $ret` 1162 1163echo "I: checking excluded only AAAA via CNAME lookup is signed zone works with +dnssec ($n)" 1164ret=0 1165$DIG $DIGOPTS +dnssec cname-excluded-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1166grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1167grep "2001:eeee::3" dig.out.ns2.test$n > /dev/null || ret=1 1168n=`expr $n + 1` 1169if [ $ret != 0 ]; then echo "I:failed"; fi 1170status=`expr $status + $ret` 1171 1172echo "I: checking excluded AAAA and non-mapped A via CNAME lookup is signed zone works with +dnssec ($n)" 1173ret=0 1174$DIG $DIGOPTS +dnssec cname-excluded-bad-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1175grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1176grep "2001:eeee::2" dig.out.ns2.test$n > /dev/null || ret=1 1177n=`expr $n + 1` 1178if [ $ret != 0 ]; then echo "I:failed"; fi 1179status=`expr $status + $ret` 1180 1181echo "I: checking excluded only AAAA and mapped A via CNAME lookup is signed zone works with +dnssec ($n)" 1182ret=0 1183$DIG $DIGOPTS +dnssec cname-excluded-good-a.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1184grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1185grep "2001:eeee::1" dig.out.ns2.test$n > /dev/null || ret=1 1186n=`expr $n + 1` 1187if [ $ret != 0 ]; then echo "I:failed"; fi 1188status=`expr $status + $ret` 1189 1190echo "I: checking AAAA only via CNAME lookup is signed zone works with +dnssec ($n)" 1191ret=0 1192$DIG $DIGOPTS +dnssec cname-aaaa-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1193grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1194grep "2001::2" dig.out.ns2.test$n > /dev/null || ret=1 1195n=`expr $n + 1` 1196if [ $ret != 0 ]; then echo "I:failed"; fi 1197status=`expr $status + $ret` 1198 1199echo "I: checking A only via CNAME lookup is signed zone works with +dnssec ($n)" 1200ret=0 1201$DIG $DIGOPTS +dnssec cname-a-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1202grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1203grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 1204grep "2001:aaaa::102:305" dig.out.ns2.test$n > /dev/null && ret=1 1205n=`expr $n + 1` 1206if [ $ret != 0 ]; then echo "I:failed"; fi 1207status=`expr $status + $ret` 1208 1209echo "I: checking A and AAAA via CNAME lookup is signed zone works with +dnssec ($n)" 1210ret=0 1211$DIG $DIGOPTS +dnssec cname-a-and-aaaa.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1212grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1213grep "2001::1" dig.out.ns2.test$n > /dev/null || ret=1 1214n=`expr $n + 1` 1215if [ $ret != 0 ]; then echo "I:failed"; fi 1216status=`expr $status + $ret` 1217 1218echo "I: checking non-mapped A via CNAME lookup is signed zone works with +dnssec ($n)" 1219ret=0 1220$DIG $DIGOPTS +dnssec cname-a-not-mapped.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1221grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1222grep "ANSWER: 2" dig.out.ns2.test$n > /dev/null || ret=1 1223grep "CNAME a-not-mapped.signed." dig.out.ns2.test$n > /dev/null || ret=1 1224n=`expr $n + 1` 1225if [ $ret != 0 ]; then echo "I:failed"; fi 1226status=`expr $status + $ret` 1227 1228echo "I: checking NODATA AAAA via CNAME lookup is signed zone works with +dnssec ($n)" 1229ret=0 1230$DIG $DIGOPTS +dnssec cname-mx-only.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1231grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1232grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 1233grep "CNAME mx-only.signed." dig.out.ns2.test$n > /dev/null || ret=1 1234n=`expr $n + 1` 1235if [ $ret != 0 ]; then echo "I:failed"; fi 1236status=`expr $status + $ret` 1237 1238echo "I: checking non-existent AAAA via CNAME lookup is signed zone works with +dnssec ($n)" 1239ret=0 1240$DIG $DIGOPTS +dnssec cname-non-existent.signed. @10.53.0.2 -b 10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1 1241grep "status: NXDOMAIN" dig.out.ns2.test$n > /dev/null || ret=1 1242grep "ANSWER: 2," dig.out.ns2.test$n > /dev/null || ret=1 1243n=`expr $n + 1` 1244if [ $ret != 0 ]; then echo "I:failed"; fi 1245status=`expr $status + $ret` 1246 1247echo "I: checking reverse mapping ($n)" 1248ret=0 1249$DIG $DIGOPTS -x 2001:aaaa::10.0.0.1 @10.53.0.2 > dig.out.ns2.test$n || ret=1 1250grep -i "CNAME.1.0.0.10.IN-ADDR.ARPA.$" dig.out.ns2.test$n > /dev/null || ret=1 1251n=`expr $n + 1` 1252if [ $ret != 0 ]; then echo "I:failed"; fi 1253status=`expr $status + $ret` 1254 1255list=`$DIG $DIGOPTS -b 10.53.0.6 @10.53.0.2 +short aaaa a-only.example | sort` 1256for a in $list 1257do 1258 ret=0 1259 echo "I: checking reverse mapping of $a ($n)" 1260 $DIG $DIGOPTS -x $a @10.53.0.2 > dig.out.ns2.test$n || ret=1 1261 grep -i "CNAME.5.3.2.1.IN-ADDR.ARPA." dig.out.ns2.test$n > /dev/null || ret=1 1262 n=`expr $n + 1` 1263 if [ $ret != 0 ]; then echo "I:failed"; fi 1264 status=`expr $status + $ret` 1265done 1266 1267rev=`$ARPANAME 2001:aaaa::10.0.0.1` 1268regex='..\(.*.IP6.ARPA\)' 1269rev=`expr "${rev}" : "${regex}"` 1270fin=`expr "${rev}" : "............${regex}"` 1271while test "${rev}" != "${fin}" 1272do 1273 ret=0 1274 echo "I: checking $rev ($n)" 1275 $DIG $DIGOPTS $rev ptr @10.53.0.2 > dig.out.ns2.test$n || ret=1 1276 grep -i "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1 1277 grep -i "ANSWER: 0," dig.out.ns2.test$n > /dev/null || ret=1 1278 n=`expr $n + 1` 1279 if [ $ret != 0 ]; then echo "I:failed"; fi 1280 status=`expr $status + $ret` 1281 rev=`expr "${rev}" : "${regex}"` 1282done 1283 1284echo "I: checking dns64-server and dns64-contact ($n)" 1285ret=0 1286$DIG $DIGOPTS soa 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.a.a.a.a.1.0.0.2.ip6.arpa @10.53.0.2 > dig.out.ns2.test$n || ret=1 1287grep "SOA.dns64.example.net..hostmaster.example.net." dig.out.ns2.test$n > /dev/null || ret=1 1288n=`expr $n + 1` 1289if [ $ret != 0 ]; then echo "I:failed"; fi 1290status=`expr $status + $ret` 1291 1292echo "I: checking TTL less than 600 from zone ($n)" 1293ret=0 1294#expect 500 1295$DIG $DIGOPTS aaaa ttl-less-than-600.example +rec @10.53.0.1 > dig.out.ns1.test$n || ret=1 1296grep -i "ttl-less-than-600.example..500.IN.AAAA" dig.out.ns1.test$n >/dev/null || ret=1 1297n=`expr $n + 1` 1298if [ $ret != 0 ]; then echo "I:failed"; fi 1299status=`expr $status + $ret` 1300 1301echo "I: checking TTL more than 600 from zone ($n)" 1302ret=0 1303#expect 700 1304$DIG $DIGOPTS aaaa ttl-more-than-600.example +rec @10.53.0.1 > dig.out.ns1.test$n || ret=1 1305grep -i "ttl-more-than-600.example..700.IN.AAAA" dig.out.ns1.test$n >/dev/null || ret=1 1306n=`expr $n + 1` 1307if [ $ret != 0 ]; then echo "I:failed"; fi 1308status=`expr $status + $ret` 1309 1310echo "I: checking TTL less than minimum from zone ($n)" 1311ret=0 1312#expect 1100 1313$DIG $DIGOPTS aaaa ttl-less-than-minimum.example +rec @10.53.0.1 > dig.out.ns1.test$n || ret=1 1314grep -i "ttl-less-than-minimum.example..1100.IN.AAAA" dig.out.ns1.test$n >/dev/null || ret=1 1315n=`expr $n + 1` 1316if [ $ret != 0 ]; then echo "I:failed"; fi 1317status=`expr $status + $ret` 1318 1319echo "I: checking TTL limited to minimum from zone ($n)" 1320ret=0 1321#expect 1200 1322$DIG $DIGOPTS aaaa ttl-more-than-minimum.example +rec @10.53.0.1 > dig.out.ns1.test$n || ret=1 1323grep -i "ttl-more-than-minimum.example..1200.IN.AAAA" dig.out.ns1.test$n >/dev/null || ret=1 1324n=`expr $n + 1` 1325if [ $ret != 0 ]; then echo "I:failed"; fi 1326status=`expr $status + $ret` 1327 1328echo "I: checking TTL less than 600 via cache ($n)" 1329ret=0 1330#expect 500 1331$DIG $DIGOPTS aaaa ttl-less-than-600.example +rec -b 10.53.0.2 @10.53.0.2 > dig.out.ns1.test$n || ret=1 1332grep -i "ttl-less-than-600.example..500.IN.AAAA" dig.out.ns1.test$n >/dev/null || ret=1 1333n=`expr $n + 1` 1334if [ $ret != 0 ]; then echo "I:failed"; fi 1335status=`expr $status + $ret` 1336 1337echo "I: checking TTL more than 600 via cache ($n)" 1338ret=0 1339#expect 700 1340$DIG $DIGOPTS aaaa ttl-more-than-600.example +rec -b 10.53.0.2 @10.53.0.2 > dig.out.ns2.test$n || ret=1 1341grep -i "ttl-more-than-600.example..700.IN.AAAA" dig.out.ns2.test$n >/dev/null || ret=1 1342n=`expr $n + 1` 1343if [ $ret != 0 ]; then echo "I:failed"; fi 1344status=`expr $status + $ret` 1345 1346echo "I: checking TTL less than minimum via cache ($n)" 1347ret=0 1348#expect 1100 1349$DIG $DIGOPTS aaaa ttl-less-than-minimum.example +rec -b 10.53.0.2 @10.53.0.2 > dig.out.ns2.test$n || ret=1 1350grep -i "ttl-less-than-minimum.example..1100.IN.AAAA" dig.out.ns2.test$n >/dev/null || ret=1 1351n=`expr $n + 1` 1352if [ $ret != 0 ]; then echo "I:failed"; fi 1353status=`expr $status + $ret` 1354 1355echo "I: checking TTL limited to minimum via cache ($n)" 1356ret=0 1357#expect 1200 1358$DIG $DIGOPTS aaaa ttl-more-than-minimum.example +rec -b 10.53.0.2 @10.53.0.2 > dig.out.ns2.test$n || ret=1 1359grep -i "ttl-more-than-minimum.example..1200.IN.AAAA" dig.out.ns2.test$n >/dev/null || ret=1 1360n=`expr $n + 1` 1361if [ $ret != 0 ]; then echo "I:failed"; fi 1362status=`expr $status + $ret` 1363 1364echo "I: checking synthesis of AAAA from RPZ-remapped A ($n)" 1365ret=0 1366$DIG $DIGOPTS aaaa rpz.example +rec -b 10.53.0.7 @10.53.0.2 > dig.out.ns2.test$n || ret=1 1367grep -i 'rpz.example.*IN.AAAA.2001:96::a0a:a0a' dig.out.ns2.test$n >/dev/null || ret=1 1368n=`expr $n + 1` 1369if [ $ret != 0 ]; then echo "I:failed"; fi 1370status=`expr $status + $ret` 1371 1372echo "I:exit status: $status" 1373exit $status 1374