unbound/testdata/ede_caching_cachedb.tdir/ede_caching_cachedb.test

29 lines
783 B
Text

# #-- ede_caching_cachedbtest --#
# source the master var file when it's there
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test
. ../common.sh
# query with the priming edns opt
dig @127.0.0.1 -p $UNBOUND_PORT example.nl +ednsopt=49152 > query1.txt
if ! grep -q -e "OPT=15: 00 09" -e "EDE: 9" query1.txt
then
echo "Priming query fails"
cat query1.txt
exit 1
fi
# kill the authoritative Unbound instance?
kill_pid $UNBOUND_PID2
# query again to see if we have indeed cached the response
dig @127.0.0.1 -p $UNBOUND_PORT example.nl +ednsopt=49152 > query2.txt
if ! grep -q -e "OPT=15: 00 09" -e "EDE: 9" query2.txt
then
echo "Cached query fails"
cat query2.txt
exit 1
fi