tests.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
#
# Copyright (C) 2000, 2001, 2004, 2005, 2007, 2011-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/.
# $Id: tests.sh,v 1.37 2012/02/22 23:47:35 tbox Exp $
DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd"
status=0
n=0
n=`expr $n + 1`
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
n=`expr $n + 1`
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"
n=`expr $n + 1`
echo "I:testing ixfr-from-differences yes;"
tmp=0
do
sleep 1
done
# ns3 has a journal iff it received an IXFR.
n=`expr $n + 1`
echo "I:testing ixfr-from-differences master; (master zone)"
tmp=0
# ns3 has a journal iff it received an IXFR.
n=`expr $n + 1`
echo "I:testing ixfr-from-differences master; (slave zone)"
tmp=0
# ns6 has a journal iff it received an IXFR.
n=`expr $n + 1`
echo "I:testing ixfr-from-differences slave; (master zone)"
tmp=0
# ns7 has a journal iff it generates an IXFR.
n=`expr $n + 1`
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
sed -n "$cur,\$p" < 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
sed -n "$cur,\$p" < 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
sed -n "$cur,\$p" < 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
sed -n "$cur,\$p" < 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
}
n=`expr $n + 1`
echo "I:check that we ask for and get a EDNS EXPIRE response ($n)"
# 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
}
n=`expr $n + 1`
echo "I:test smaller transfer TCP message size ($n)"
bytes=`wc -c < dig.out.msgsize`
echo "I:failed axfr size check"
status=1
fi
echo "I:failed transfer message count check"
status=1
fi
n=`expr $n + 1`
echo "I:test mapped zone with out of zone data ($n)"
tmp=0
echo "I:exit status: $status"