1# #-- fwd_ttlexpire.test --# 2# source the master var file when it's there 3[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master 4# use .tpkg.var.test for in test variable passing 5[ -f .tpkg.var.test ] && source .tpkg.var.test 6 7PRE="../.." 8# do the test 9echo "> dig www.example.com." 10dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile 11echo "> check answer" 12if grep "10.20.30.40" outfile; then 13 echo "OK" 14else 15 echo "Not OK" 16 exit 1 17fi 18# wait for query to expire. 19sleep 4 20# query again 21rm outfile 22echo "> dig www.example.com." 23dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile 24echo "> check answer" 25if grep "10.20.30.40" outfile; then 26 echo "OK" 27else 28 echo "Not OK" 29 exit 1 30fi 31echo "> cat logfiles" 32cat fwd.log 33cat unbound.log 34 35exit 0 36