tests.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
#
# Copyright (C) 2001, 2004, 2007, 2011-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/.
# $Id: tests.sh,v 1.10 2011/09/01 05:28:14 marka Exp $
status=0
DIGOPTS="+nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm \
+nostat @10.53.0.2 -p 5300"
# fill the cache with nodes from flushtest.example zone
# empty all existing cache data
# load the positive cache entries
txt top1.flushtest.example
txt second1.top1.flushtest.example
txt third1.second1.top1.flushtest.example
txt third2.second1.top1.flushtest.example
txt second2.top1.flushtest.example
txt second3.top1.flushtest.example
txt second1.top2.flushtest.example
txt second2.top2.flushtest.example
txt second3.top2.flushtest.example
txt top3.flushtest.example
txt second1.top3.flushtest.example
txt third1.second1.top3.flushtest.example
txt third2.second1.top3.flushtest.example
txt third1.second2.top3.flushtest.example
txt third2.second2.top3.flushtest.example
txt second3.top3.flushtest.example
EOF
# load the negative cache entries
# nxrrset:
# nxdomain:
# empty nonterminal:
# sleep 2 seconds ensure the TTLs will be lower on cached data
sleep 2
}
rm -f ns2/named_dump.db
sleep 1
}
}
return 0
}
return 0
}
echo "I:check correctness of routine cache cleaning"
echo "I:only one tcp socket was used"
tcpclients=`grep "client 10.53.0.7#[0-9]*:" ns2/named.run | awk '{print $4}' | sort | uniq -c | wc -l`
echo "I:reset and check that records are correctly cached initially"
ret=0
echo "I:check flushing of the full cache"
ret=0
echo "I:check flushing of individual nodes (interior node)"
ret=0
# interior node
echo "I:check flushing of individual nodes (leaf node, under the interior node)"
ret=0
# leaf node, under the interior node (should still exist)
echo "I:check flushing of individual nodes (another leaf node, with both positive and negative cache entries)"
ret=0
# another leaf node, with both positive and negative cache entries
echo "I:check flushing a nonexistent name"
ret=0
echo "I:check flushing of namespaces"
ret=0
# flushing leaf node should leave the interior node:
# flushing from an empty node should still remove all its children
echo "I:check flushing a nonexistent namespace"
ret=0
echo "I:check the number of cached records remaining"
ret=0
echo "I:check the check that flushname of a partial match works."
ret=0
echo "I:check the number of cached records remaining"
ret=0
echo "I:check flushtree clears adb correctly"
ret=0
awk '/plain success\/timeout/ {getline; getline; if ($2 == "ns.flushtest.example") exit(0); exit(1); }' ns2/named_dump.db || ret=1
awk '/plain success\/timeout/ {getline; getline; if ($2 == "ns.flushtest.example") exit(1); exit(0); }' ns2/named_dump.db || ret=1
echo "I:check expire option returned from slave zone"
ret=0
echo "I:exit status: $status"