1# Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
2#
3# Permission to use, copy, modify, and/or distribute this software for any
4# purpose with or without fee is hereby granted, provided that the above
5# copyright notice and this permission notice appear in all copies.
6#
7# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13# PERFORMANCE OF THIS SOFTWARE.
14
15SYSTEMTESTTOP=..
16. $SYSTEMTESTTOP/conf.sh
17
18status=0
19echo "I:check lookups against zero TTL records"
20i=0
21passes=10
22$DIG -p 5300 @10.53.0.2 axfr example |
23awk '$2 == "0" { print "-q", $1, $4; print "-q", "zzz"$1, $4;}' > query.list
24while [ $i -lt $passes ]
25do
26	ret=0
27	$DIG -p 5300 @10.53.0.3 -f query.list > dig.out$i.1 &
28	$DIG -p 5300 @10.53.0.3 -f query.list > dig.out$i.2 &
29	$DIG -p 5300 @10.53.0.3 -f query.list > dig.out$i.3 &
30	$DIG -p 5300 @10.53.0.3 -f query.list > dig.out$i.4 &
31	$DIG -p 5300 @10.53.0.3 -f query.list > dig.out$i.5 &
32	$DIG -p 5300 @10.53.0.3 -f query.list > dig.out$i.6 &
33	wait
34	grep "status: SERVFAIL" dig.out$i.1 && ret=1
35	grep "status: SERVFAIL" dig.out$i.2 && ret=1
36	grep "status: SERVFAIL" dig.out$i.3 && ret=1
37	grep "status: SERVFAIL" dig.out$i.5 && ret=1
38	grep "status: SERVFAIL" dig.out$i.6 && ret=1
39	grep "status: SERVFAIL" dig.out$i.6 && ret=1
40	[ $ret = 1 ] && break
41	i=`expr $i + 1`
42	echo "I: successfully completed pass $i of $passes"
43done
44if [ $ret != 0 ]; then echo "I:failed"; fi
45status=`expr $status + $ret`
46
47echo "I:exit status: $status"
48exit $status
49