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
9 if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi
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
15 if grep "10.20.30.40" outfile; then
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 >/dev/null; then :; else sleep 10; fi
36 if grep "www.example.com" tap.log; then echo "yes it is in tap.log";
38 echo "information not in tap.log"
49 echo "> make 10 queries to spread them over threads"
50 dig @127.0.0.1 -p $UNBOUND_PORT q1.example.net.
51 dig @127.0.0.1 -p $UNBOUND_PORT q2.example.net.
52 dig @127.0.0.1 -p $UNBOUND_PORT q3.example.net.
53 dig @127.0.0.1 -p $UNBOUND_PORT q4.example.net.
54 dig @127.0.0.1 -p $UNBOUND_PORT q5.example.net.
55 dig @127.0.0.1 -p $UNBOUND_PORT q6.example.net.
56 dig @127.0.0.1 -p $UNBOUND_PORT q7.example.net.
57 dig @127.0.0.1 -p $UNBOUND_PORT q8.example.net.
58 dig @127.0.0.1 -p $UNBOUND_PORT q9.example.net.
59 dig @127.0.0.1 -p $UNBOUND_PORT q10.example.net.
60 for x in q1 q2 q3 q4 5 q6 q7 q8 q9 q10; do
61 if grep "$x.example.net" tap.log >/dev/null; then :; else sleep 1; fi
62 if grep "$x.example.net" tap.log >/dev/null; then :; else sleep 1; fi
63 if grep "$x.example.net" tap.log >/dev/null; then :; else sleep 1; fi
64 if grep "$x.example.net" tap.log >/dev/null; then :; else sleep 1; fi
65 if grep "$x.example.net" tap.log >/dev/null; then :; else sleep 1; fi
66 if grep "$x.example.net" tap.log >/dev/null; then :; else sleep 10; fi
67 if grep "$x.example.net" tap.log; then echo "yes it is in tap.log";
69 echo "$x.example.net. information not in tap.log"