1# #-- dnstap_tls_badname.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 7. ../common.sh 8PRE="../.." 9 10# test if the server is up. 11echo "> dig www.example.com." 12dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile 13echo "> check answer" 14if grep "10.20.30.40" outfile; then 15 echo "OK" 16else 17 echo "> cat logfiles" 18 cat tap.log 19 cat tap.errlog 20 cat fwd.log 21 cat unbound.log 22 echo "Not OK" 23 exit 1 24fi 25 26echo "> check tap.log for dnstap info" 27# see if it logged the information in tap.log 28# wait for a moment for filesystem to catch up. 29if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi 30if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi 31if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi 32if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi 33if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi 34if grep "www.example.com" tap.log; then 35 echo "it is in tap.log"; 36 echo "but there should not be a connection" 37 echo "failed" 38 echo "> cat logfiles" 39 cat tap.log 40 cat tap.errlog 41 cat fwd.log 42 cat unbound.log 43 echo "Not OK" 44 exit 1 45else 46 echo "information not in tap.log" 47fi 48 49echo "> OK" 50exit 0 51