tests.sh revision 3aaa526a94c80c31c16d44f0f6482984725860f1
#
# Copyright (C) 2004, 2005, 2007, 2011-2013 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
# 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 it
# 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"
status=1
}
echo "I:unsigned transfer"
sleep 1
sleep 2
echo "I:failed"
status=1
}
echo "I:bad keydata"
sleep 1
sleep 2
echo "I:failed"
status=1
}
echo "I:partially-signed transfer"
sleep 1
sleep 2
echo "I:failed"
status=1
}
echo "I:unknown key"
sleep 1
sleep 2
echo "I:failed"
status=1
}
echo "I:incorrect key"
sleep 1
sleep 2
echo "I:failed"
status=1
}
echo "I:exit status: $status"
exit $status