tests.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
#
# Copyright (C) 2000, 2001, 2004, 2007, 2009-2016 Internet Systems Consortium, Inc. ("ISC")
#
# 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/.
status=0
n=0
echo "I:checking non-cachable NXDOMAIN response handling"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking non-cachable NXDOMAIN response handling using dns_client"
ret=0
fi
if [ -x ${RESOLVE} ] ; then
echo "I:checking that local bound address can be set (Can't query from a denied address)"
ret=0
echo "I:checking that local bound address can be set (Can query from an allowed address)"
ret=0
fi
echo "I:checking non-cachable NODATA response handling"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking non-cachable NODATA response handling using dns_client"
ret=0
fi
echo "I:checking handling of bogus referrals"
# If the server has the "INSIST(!external)" bug, this query will kill it.
if [ -x ${RESOLVE} ] ; then
echo "I:checking handling of bogus referrals using dns_client"
ret=0
fi
echo "I:check handling of cname + other data / 1"
echo "I:check handling of cname + other data / 2"
echo "I:check that server is still running"
echo "I:checking answer IPv4 address filtering (deny)"
ret=0
echo "I:checking answer IPv6 address filtering (deny)"
ret=0
echo "I:checking answer IPv4 address filtering (accept)"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking answer IPv4 address filtering using dns_client (accept)"
ret=0
fi
echo "I:checking answer IPv6 address filtering (accept)"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking answer IPv6 address filtering using dns_client (accept)"
ret=0
fi
echo "I:checking CNAME target filtering (deny)"
ret=0
echo "I:checking CNAME target filtering (accept)"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking CNAME target filtering using dns_client (accept)"
ret=0
fi
echo "I:checking CNAME target filtering (accept due to subdomain)"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking CNAME target filtering using dns_client (accept due to subdomain)"
ret=0
fi
echo "I:checking DNAME target filtering (deny)"
ret=0
echo "I:checking DNAME target filtering (accept)"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking DNAME target filtering using dns_client (accept)"
ret=0
fi
echo "I:checking DNAME target filtering (accept due to subdomain)"
ret=0
if [ -x ${RESOLVE} ] ; then
echo "I:checking DNAME target filtering using dns_client (accept due to subdomain)"
ret=0
fi
n=`expr $n + 1`
echo "I: RT21594 regression test check setup ($n)"
ret=0
# Check that "aa" is not being set by the authoritative server.
n=`expr $n + 1`
echo "I: RT21594 regression test positive answers ($n)"
ret=0
# Check that resolver accepts the non-authoritative positive answers.
n=`expr $n + 1`
echo "I: RT21594 regression test NODATA answers ($n)"
ret=0
# Check that resolver accepts the non-authoritative nodata answers.
n=`expr $n + 1`
echo "I: RT21594 regression test NXDOMAIN answers ($n)"
ret=0
# Check that resolver accepts the non-authoritative positive answers.
n=`expr $n + 1`
echo "I:check that replacement of additional data by a negative cache no data entry clears the additional RRSIGs ($n)"
ret=0
$NSUPDATE << EOF
server 10.53.0.6 5300
zone example.net
update delete mail.example.net A
update add mail.example.net 0 AAAA ::1
send
EOF
n=`expr $n + 1`
echo "I:checking that update a nameservers address has immediate effects ($n)"
ret=0
$NSUPDATE << EOF
server 10.53.0.7 5300
zone server
update delete ns.server A
update add ns.server 300 A 10.53.0.4
send
EOF
sleep 1
n=`expr $n + 1`
echo "I:checking that update a nameservers glue has immediate effects ($n)"
ret=0
$NSUPDATE << EOF
server 10.53.0.7 5300
zone server
update delete ns.child.server A
update add ns.child.server 300 A 10.53.0.4
send
EOF
sleep 1
n=`expr $n + 1`
echo "I:checking empty RFC 1918 reverse zones ($n)"
ret=0
# Check that "aa" is being set by the resolver for RFC 1918 zones
# except the one that has been deliberately disabled
# but this one should NOT be authoritative
n=`expr $n + 1`
echo "I:checking that removal of a delegation is honoured ($n)"
ret=0
old=
do
foo=0
[ $foo = 0 ] && break
$NSUPDATE << EOF
server 10.53.0.6 5300
zone to-be-removed.tld
update add to-be-removed.tld 100 NS ns${i}.to-be-removed.tld
update delete to-be-removed.tld NS ns${old}.to-be-removed.tld
send
EOF
old=$i
sleep 1
done
n=`expr $n + 1`
echo "I:check for improved error message with SOA mismatch ($n)"
ret=0
n=`expr $n + 1`
echo "I:check resolution on the listening port ($n)"
ret=0
n=`expr $n + 1`
echo "I:check prefetch (${n})"
ret=0
# sleep so we are in prefetch range
# trigger prefetch
sleep 1
# check that prefetch occured
n=`expr $n + 1`
echo "I:check prefetch disabled (${n})"
ret=0
# sleep so we are in expire range
# look for ttl = 1, allow for one miss at getting zero ttl
zerotonine="0 1 2 3 4 5 6 7 8 9"
do
$PERL -e 'select(undef, undef, undef, 0.05);'
done
# delay so that any prefetched record will have a lower ttl than expected
sleep 3
# check that prefetch has not occured
n=`expr $n + 1`
echo "I:check prefetch qtype * (${n})"
ret=0
# sleep so we are in prefetch range
# trigger prefetch
sleep 1
# check that the nameserver is still alive
n=`expr $n + 1`
echo "I:check that E was logged on EDNS queries in the query log (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that '-t aaaa' in .digrc does not have unexpected side effects ($n)"
ret=0
echo "-t aaaa" > .digrc
n=`expr $n + 1`
echo "I:check that EDNS version is logged (${n})"
ret=0
fi
n=`expr $n + 1`
echo "I:check that edns-version is honoured (${n})"
ret=0
fi
n=`expr $n + 1`
echo "I:check that CNAME nameserver is logged correctly (${n})"
ret=0
grep "skipping nameserver 'cname.tld' because it is a CNAME, while resolving 'all-cnames/SOA'" ns5/named.run > /dev/null || ret=1
n=`expr $n + 1`
echo "I:check that unexpected opcodes are handled correctly (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that EDNS client subnet with non-zeroed bits is handled correctly (${n})"
ret=0
# 0001 (IPv4) 1f (31 significant bits) 00 (0) ffffffff (255.255.255.255)
n=`expr $n + 1`
echo "I:check that dig +subnet zeros address bits correctly (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that SOA query returns data for delegation-only apex (${n})"
ret=0
n=`expr $n + 1`
n=`expr $n + 1`
echo "I:check that NS query returns data for delegation-only apex (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that A query returns data for delegation-only A apex (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that CDS query returns data for delegation-only apex (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that AAAA query returns data for delegation-only AAAA apex (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that DNSKEY query returns data for delegation-only apex (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that CDNSKEY query returns data for delegation-only apex (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that NXDOMAIN is returned for delegation-only non-apex A data (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that NXDOMAIN is returned for delegation-only non-apex CDS data (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that NXDOMAIN is returned for delegation-only non-apex AAAA data (${n})"
ret=0
n=`expr $n + 1`
echo "I:check that NXDOMAIN is returned for delegation-only non-apex CDNSKEY data (${n})"
ret=0
n=`expr $n + 1`
echo "I:check zero ttl not returned for learnt non zero ttl records (${n})"
ret=0
# use prefetch disabled server
# sleep so we are in expire range
# look for ttl = 1, allow for one miss at getting zero ttl
zerotonine="0 1 2 3 4 5 6 7 8 9"
do
$PERL -e 'select(undef, undef, undef, 0.05);'
done
n=`expr $n + 1`
echo "I:check zero ttl is returned for learnt zero ttl records (${n})"
ret=0
echo "I:exit status: $status"