tests.sh revision cd49e1ec2f22e4fea9ce5f356c26037d98f95f38
#
# Copyright (C) 2004, 2007, 2011 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001 Internet Software Consortium.
#
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $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: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:exit status: $status"
exit $status