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