mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-01 11:19:27 -05:00
29 lines
800 B
Text
29 lines
800 B
Text
# #-- ede_caching_subnetcache.test --#
|
|
# 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 +subnet=127.0.0.0/17 > 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 +subnet=127.0.0.0/17 > 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
|