dce54b9b5cfa450570fe9c11644450aeb3ee89f3Tinderbox User# Copyright (C) 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
1479200aa05414b2acf33607dbd1682c16f58c51Evan HuntRNDCCMD="$RNDC -p 9953 -s 10.53.0.3 -c ../common/rndc.conf"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt while [ $num -gt 0 ]; do
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt echo "${num}${1}${2}.lamesub.example A" >> burst.input.$$
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt $PERL ../ditch.pl -p 5300 -s 10.53.0.3 burst.input.$$
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt clients=`$RNDCCMD status | grep "recursive clients" |
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: checking recursing clients are dropped at the per-server limit"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt# make the server lame and restart
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntfor try in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt # fetches-per-server is at 400, but at 20qps against a lame server,
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt # we'll reach 200 at the tenth second, and the quota should have been
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt # tuned to less than that by then
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: dumping ADB data"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntinfo=`grep '10.53.0.4' ns3/named_dump.db | sed 's/.*\(atr [.0-9]*\).*\(quota [0-9]*\).*/I: \1 \2/'`
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: checking servfail statistics"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntsspill=`grep 'spilled due to server' ns3/named.stats | sed 's/\([0-9][0-9]*\) spilled.*/\1/'`
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntfails=`grep 'queries resulted in SERVFAIL' ns3/named.stats | sed 's/\([0-9][0-9]*\) queries.*/\1/'`
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: checking lame server recovery"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: dumping ADB data"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntinfo=`grep '10.53.0.4' ns3/named_dump.db | sed 's/.*\(atr [.0-9]*\).*\(quota [0-9]*\).*/I: \1 \2/'`
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: dumping ADB data"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntinfo=`grep '10.53.0.4' ns3/named_dump.db | sed 's/.*\(atr [.0-9]*\).*\(quota [0-9]*\).*/I: \1 \2/'`
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: checking lame server clients are dropped at the per-domain limit"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt grep "status: NOERROR" dig.out.ns3.$try > /dev/null 2>&1 && \
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt grep "status: SERVFAIL" dig.out.ns3.$try > /dev/null 2>&1 && \
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: $success successful valid queries, $fail SERVFAIL"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: checking drop statistics"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntzspill=`grep 'spilled due to zone' ns3/named.stats | sed 's/\([0-9][0-9]*\) spilled.*/\1/'`
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntdrops=`grep 'queries dropped' ns3/named.stats | sed 's/\([0-9][0-9]*\) queries.*/\1/'`
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: checking lame server clients are dropped at the soft limit"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt $DIG @10.53.0.3 -p 5300 a ${try}.example > dig.out.ns3.$try
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt grep "status: NOERROR" dig.out.ns3.$try > /dev/null 2>&1 && \
1479200aa05414b2acf33607dbd1682c16f58c51Evan Hunt grep "status: SERVFAIL" dig.out.ns3.$try > /dev/null 2>&1 && \
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I: $success successful valid queries, $fail SERVFAIL"
1479200aa05414b2acf33607dbd1682c16f58c51Evan Huntecho "I:exit status: $status"