tests.sh revision b947e1a521c6931f787d6d1b3604d5b138170c3d
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# Permission to use, copy, modify, and/or distribute this software for any
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# purpose with or without fee is hereby granted, provided that the above
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# copyright notice and this permission notice appear in all copies.
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley# PERFORMANCE OF THIS SOFTWARE.
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews# test response policy zones (RPZ)
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrewsns2=$ns.2 # authoritative server whose records are rewritten
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrewsns4=$ns.4 # another authoritative server that is rewritten
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrewswhile getopts "x" c; do
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graffshift `expr $OPTIND - 1 || true`
8d6024e7cffbd84fa8d06ce50c60307d7b3b49c2Michael Graff# really quit on control-C
3ff55a3111fe09f517218905248974b8319b2c59Mark AndrewsRNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p 9953 -s"
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews # Also default to -bX where X is the @value so that OS X will choose
0c67279acb4a6ac356879498b220645755d77cc9Mark Andrews digcmd_args=`echo "+noadd +time=2 +tries=1 -p 5300 $*" | \
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews# set DIGNM=file name for dig output
3ff55a3111fe09f517218905248974b8319b2c59Mark Andrews while test -f $DIGNM; do
27ffc5a69779c3c7224580a89aa2bf0a3ff8c16dBob Halley# (re)load the reponse policy zones with the rules in the file $TEST_FILE
0c67279acb4a6ac356879498b220645755d77cc9Mark Andrews echo "I:failed to update policy zone with $TEST_FILE"
sleep 1
kill -9 $PID
eval CKALIVE_IP=\$ns$CKALIVE_NS
$RNDCCMD $CKALIVE_IP status >/dev/null 2>&1 && return 0
HOST=$1
$NSDIR/named.stats | tail -1`
HOST=$1
$NSDIR/named.stats | tail -1`
ret=0
TEST_FILE=$2
TEST_NUM=0
rm -f $*
if $PERL $SYSTEMTESTTOP/digcomp.pl $DIGNM $2 >/dev/null; then
clean_result ${DIGNM}*
digcmd $* \
digcmd $* \
ADDR=$1
clean_result ${DIGNM}*
clean_result ${DIGNM}*
# policies in ./test5 overridden by response-policy{} in ns3/named.conf
# and in ns5/named.conf
# This is not a bug, because any data leaked by writing 24.4.3.2.10.rpz-ip
# nxdomain 32.3.2.1.127.rpz-ip
if test -n "$QPERF"; then
echo "I:$RPZ qps with rpz or $PERCENT% is below $MIN_PERCENT% of $NORPZ qps"
if test -z "$HAVE_CORE"; then
if test -n "$EMSGS"; then
$NSUPDATE -p 5300 << EOF
sleep 2
echo "I:exit status: $status"
exit $status