1# #-- stub_udp.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 @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile 11echo "> cat logfiles" 12cat fwd.log 13cat unbound.log 14echo "> check answer" 15if grep "10.20.30.40" outfile; then 16 echo "OK" 17else 18 echo "Not OK" 19 exit 1 20fi 21 22 23# check delegations from cache by doing second test 24echo "> dig mail.example.com." 25dig @127.0.0.1 -p $UNBOUND_PORT mail.example.com. | tee outfile 26echo "> cat logfiles" 27cat fwd.log 28cat unbound.log 29echo "> check answer" 30if grep "10.20.30.66" outfile; then 31 echo "OK" 32else 33 echo "Not OK" 34 exit 1 35fi 36 37exit 0 38