1#!/bin/sh
2#
3# Copyright (C) 2004, 2007, 2011, 2012  Internet Systems Consortium, Inc. ("ISC")
4# Copyright (C) 2000, 2001  Internet Software Consortium.
5#
6# Permission to use, copy, modify, and/or distribute this software for any
7# purpose with or without fee is hereby granted, provided that the above
8# copyright notice and this permission notice appear in all copies.
9#
10# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16# PERFORMANCE OF THIS SOFTWARE.
17
18# Id
19
20SYSTEMTESTTOP=..
21. $SYSTEMTESTTOP/conf.sh
22
23status=0
24echo "I:waiting for nameserver to load"
25for i in 0 1 2 3 4 5 6 7 8 9
26do
27	ret=0
28	for zone in . example1 e.example1 example2 10.10.10.in-addr.arpa \
29	    ip6.int ip6.arpa
30	do
31		$DIG +tcp -p 5300 @10.53.0.1 soa $zone > dig.out
32		grep "status: NOERROR" dig.out > /dev/null || ret=1
33		grep "ANSWER: 1," dig.out > /dev/null || ret=1
34	done
35	test $ret = 0 && break
36	sleep 1
37done
38if [ $ret != 0 ]; then echo "I:failed"; fi
39status=`expr $status + $ret`
40
41echo "I:using resolv.conf"
42ret=0
43./lwtest || ret=1
44if [ $ret != 0 ]; then
45	echo "I:failed"
46fi
47status=`expr $status + $ret`
48
49$PERL $SYSTEMTESTTOP/stop.pl . lwresd1
50
51$PERL $SYSTEMTESTTOP/start.pl . lwresd1 -- "-m record,size,mctx -c lwresd.conf -d 99 -g"
52
53echo "I:using lwresd.conf"
54ret=0
55sleep 1 # allow lwresd to finish starting.
56./lwtest || ret=1
57if [ $ret != 0 ]; then
58	echo "I:failed"
59fi
60status=`expr $status + $ret`
61
62echo "I:exit status: $status"
63exit $status
64