tests.sh 2.32 KB
Newer Older
1
# Copyright (C) 2011, 2012, 2014, 2016  Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
2 3 4 5 6 7 8 9 10 11 12 13
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
14 15 16 17 18 19 20 21 22

SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh

DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"

status=0
n=1

23 24 25 26 27 28 29
echo "I:checking that a warning was logged about the ISC DLV service ($n)"
ret=0
warnings=`grep "WARNING: the DLV server at 'dlv.isc.org'" ns2/named.run`
[ -z "$warnings" ] && ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`

30 31 32
#
#  When this was initialy reported there was a REQUIRE failure on restarting.
#
33
n=`expr $n + 1`
34 35 36 37
echo "I:checking dnssec-lookaside "'"auto"'"; with views of multiple classes ($n)" 
if [ -s  ns2/named.pid ]
then
	ret=0
38
	$PERL $SYSTEMTESTTOP/stop.pl . ns2 || ret=1
39
	sleep 1
40
	(cd ns2; $NAMED -g -d 100 -X named.lock -c named.conf >> named.run 2>&1 & )
41 42 43 44 45 46 47 48 49 50
	sleep 2
	$DIG $DIGOPTS soa . @10.53.0.2 > dig.out.ns2.test$n || ret=1
	grep "status: NOERROR" dig.out.ns2.test$n > /dev/null || ret=1
	if [ $ret != 0 ]; then echo "I:failed"; fi
	status=`expr $status + $ret`
else
	echo "I:failed"
	status=1
fi

51 52 53 54 55 56 57 58 59
n=`expr $n + 1`
echo "I:checking that only the DLV key was imported from bind.keys ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 secroots 2>&1 | sed 's/^/I:ns2 /'
linecount=`grep "\./RSAMD5/.* ; managed" ns2/named.secroots | wc -l`
[ "$linecount" -eq 0 ] || ret=1
linecount=`grep "dlv.isc.org/RSAMD5/.* ; managed" ns2/named.secroots | wc -l`
[ "$linecount" -eq 2 ] || ret=1
linecount=`cat ns2/named.secroots | wc -l`
60
[ "$linecount" -eq 25 ] || ret=1
61 62 63 64
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`

65 66
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1