1# #-- fwd_three.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 www1.example.com." 10dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile 11echo "> cat logfiles" 12cat fwd.log 13cat unbound.log 14echo "> check answer for single query" 15if grep "10.20.30.40" outfile; then 16 echo "OK" 17else 18 echo "Not OK" 19 exit 1 20fi 21 22echo "> do three queries" 23dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www1.example.com. >outfile1 & 24digpid1=$! 25dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www2.example.com. >outfile2 & 26digpid2=$! 27dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www3.example.com. >outfile3 & 28digpid3=$! 29sleep 5 30kill -9 $digpid1 31kill -9 $digpid2 32kill -9 $digpid3 33 34echo "> cat outfile1" 35cat outfile1 36echo "> cat outfile2" 37cat outfile2 38echo "> cat outfile3" 39cat outfile3 40echo "> cat logfiles" 41cat fwd.log 42cat unbound.log 43echo "> check answers for three queries" 44if grep "10.20.30.40" outfile1; then 45 echo "1 is OK" 46else 47 echo "1 is not OK" 48 exit 1 49fi 50if grep "10.20.30.50" outfile2; then 51 echo "2 is OK" 52else 53 echo "2 is not OK" 54 exit 1 55fi 56if grep "10.20.30.60" outfile3; then 57 echo "3 is OK" 58else 59 echo "3 is not OK" 60 exit 1 61fi 62 63exit 0 64