tests.sh revision 05b1684791300b8cb88664d609a3f1adddad80d4
#
# Copyright (C) 2004, 2005, 2007, 2011-2015 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# 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.
# $Id: tests.sh,v 1.37 2012/02/22 23:47:35 tbox Exp $
DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd"
status=0
echo "I:testing basic zone transfer functionality"
#
# Spin to allow the zone to tranfer.
#
do
tmp=0
if test $? -ne 0 ; then break; fi
echo "I: plain zone re-transfer"
sleep 5
done
echo "I:testing TSIG signed zone transfers"
#
# Spin to allow the zone to tranfer.
#
do
tmp=0
if test $? -ne 0 ; then break; fi
echo "I: plain zone re-transfer"
sleep 5
done
echo "I:reload servers for in preparation for ixfr-from-differences tests"
sleep 2
echo "I:updating master zones for ixfr-from-differences tests"
$PERL -i -p -e '
s/0\.0\.0\.0/0.0.0.1/;
s/1397051952/1397051953/
$PERL -i -p -e '
s/0\.0\.0\.0/0.0.0.1/;
s/1397051952/1397051953/
$PERL -i -p -e '
s/0\.0\.0\.0/0.0.0.1/;
s/1397051952/1397051953/
$PERL -i -p -e '
s/0\.0\.0\.0/0.0.0.1/;
s/1397051952/1397051953/
sleep 3
echo "I:testing zone is dumped after successful transfer"
echo "I:testing ixfr-from-differences yes;"
tmp=0
do
sleep 1
done
# ns3 has a journal iff it received an IXFR.
echo "I:testing ixfr-from-differences master; (master zone)"
tmp=0
# ns3 has a journal iff it received an IXFR.
echo "I:testing ixfr-from-differences master; (slave zone)"
tmp=0
# ns6 has a journal iff it received an IXFR.
echo "I:testing ixfr-from-differences slave; (master zone)"
tmp=0
# ns7 has a journal iff it generates an IXFR.
echo "I:testing ixfr-from-differences slave; (slave zone)"
tmp=0
# ns7 has a journal iff it generates an IXFR.
echo "I:check that a multi-message uncompressable zone transfers"
then
echo "I:failed"
fi
# now we test transfers with assorted TSIG glitches
echo "I:testing that incorrectly signed transfers will fail..."
echo "I:initial correctly-signed transfer should succeed"
sleep 1
# Initially, ns4 is not authoritative for anything.
# Now that ans is up and running with the right data, we make ns4
# a slave for nil.
cat <<EOF >>ns4/named.conf
zone "nil" {
type slave;
file "nil.db";
masters { 10.53.0.5 key tsig_key; };
};
EOF
do
sleep 1
done
echo "I: failed: expected status was not logged"
status=1
}
echo "I:failed"
status=1
}
echo "I:unsigned transfer"
sleep 1
sleep 2
tail -n +"$cur" < ns4/named.run | grep "Transfer status: expected a TSIG or SIG(0)" > /dev/null || {
echo "I: failed: expected status was not logged"
status=1
}
echo "I:failed"
status=1
}
echo "I:bad keydata"
sleep 1
sleep 2
echo "I: failed: expected status was not logged"
status=1
}
echo "I:failed"
status=1
}
echo "I:partially-signed transfer"
sleep 1
sleep 2
tail -n +"$cur" < ns4/named.run | grep "Transfer status: expected a TSIG or SIG(0)" > /dev/null || {
echo "I: failed: expected status was not logged"
status=1
}
echo "I:failed"
status=1
}
echo "I:unknown key"
sleep 1
sleep 2
tail -n +"$cur" < ns4/named.run | grep "tsig key 'tsig_key': key name and algorithm do not match" > /dev/null || {
echo "I: failed: expected status was not logged"
status=1
}
echo "I:failed"
status=1
}
echo "I:incorrect key"
sleep 1
sleep 2
tail -n +"$cur" < ns4/named.run | grep "tsig key 'tsig_key': key name and algorithm do not match" > /dev/null || {
echo "I: failed: expected status was not logged"
status=1
}
echo "I:failed"
status=1
}
echo "I:check that we ask for and get a EDNS EXPIRE response"
# force a refresh query
sleep 10
# there may be multiple log entries so get the last one.
echo "I:failed (expire=${expire:-0})"
status=1
}
echo "I:exit status: $status"
exit $status