summaryrefslogtreecommitdiff
path: root/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test
diff options
context:
space:
mode:
Diffstat (limited to 'testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test')
-rw-r--r--testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test50
1 files changed, 50 insertions, 0 deletions
diff --git a/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test
new file mode 100644
index 000000000000..5b9cce0a4c47
--- /dev/null
+++ b/testdata/dnstap_tls_clientauth.tdir/dnstap_tls_clientauth.test
@@ -0,0 +1,50 @@
+# #-- dnstap_tls_clientauth.test --#
+# source the master var file when it's there
+[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
+# use .tpkg.var.test for in test variable passing
+[ -f .tpkg.var.test ] && source .tpkg.var.test
+
+. ../common.sh
+PRE="../.."
+if grep "define USE_DNSTAP 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi
+
+# test if the server is up.
+echo "> dig www.example.com."
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
+echo "> check answer"
+if grep "10.20.30.40" outfile; then
+ echo "OK"
+else
+ echo "> cat logfiles"
+ cat tap.log
+ cat tap.errlog
+ cat fwd.log
+ cat unbound.log
+ echo "Not OK"
+ exit 1
+fi
+
+echo "> check tap.log for dnstap info"
+# see if it logged the information in tap.log
+# wait for a moment for filesystem to catch up.
+if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
+if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
+if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
+if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
+if grep "www.example.com" tap.log >/dev/null; then :; else sleep 1; fi
+if grep "www.example.com" tap.log >/dev/null; then :; else sleep 10; fi
+if grep "www.example.com" tap.log; then echo "yes it is in tap.log";
+else
+ echo "information not in tap.log"
+ echo "failed"
+ echo "> cat logfiles"
+ cat tap.log
+ cat tap.errlog
+ cat fwd.log
+ cat unbound.log
+ echo "Not OK"
+ exit 1
+fi
+
+echo "> OK"
+exit 0