tests.sh revision 2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681
#
# Copyright (C) 2014-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/.
DIGOPTS="-p 5300"
status=0
n=0
cp $1 ns3/named.conf
}
return 0
else
return 1
fi
}
# Check whether the number of queries ans2 received from ns3 (this value is
# read from dig output stored in file $1) is as expected. The expected query
# count is variable:
# - if ns3 sends AAAA queries, the query count should equal $2,
# - if ns3 does not send AAAA queries, the query count should equal $3.
if ns3_sends_aaaa_queries; then
else
fi
if [ $count -ne $expected_count ]; then
echo "I: count ($count) != $expected_count"
ret=1
fi
}
echo "I: set max-recursion-depth=12"
n=`expr $n + 1`
echo "I: attempt excessive-depth lookup ($n)"
ret=0
n=`expr $n + 1`
echo "I: attempt permissible lookup ($n)"
ret=0
echo "I: set max-recursion-depth=5"
n=`expr $n + 1`
echo "I: attempt excessive-depth lookup ($n)"
ret=0
n=`expr $n + 1`
echo "I: attempt permissible lookup ($n)"
ret=0
echo "I: set max-recursion-depth=100, max-recursion-queries=50"
n=`expr $n + 1`
echo "I: attempt excessive-queries lookup ($n)"
ret=0
if ns3_sends_aaaa_queries; then
fi
eval count=`cat dig.out.2.test$n`
n=`expr $n + 1`
echo "I: attempt permissible lookup ($n)"
ret=0
eval count=`cat dig.out.2.test$n`
echo "I: set max-recursion-depth=100, max-recursion-queries=40"
n=`expr $n + 1`
echo "I: attempt excessive-queries lookup ($n)"
ret=0
if ns3_sends_aaaa_queries; then
fi
eval count=`cat dig.out.2.test$n`
n=`expr $n + 1`
echo "I: attempt permissible lookup ($n)"
ret=0
eval count=`cat dig.out.2.test$n`
n=`expr $n + 1`
echo "I: attempting NS explosion ($n)"
ret=0
eval count=`cat dig.out.2.test$n`
eval count=`cat dig.out.3.test$n`
echo "I:exit status: $status"