summaryrefslogtreecommitdiffstats
path: root/src/test/test_dnstap_tcp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_dnstap_tcp.sh')
-rwxr-xr-xsrc/test/test_dnstap_tcp.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/test_dnstap_tcp.sh b/src/test/test_dnstap_tcp.sh
new file mode 100755
index 0000000..8c02bd7
--- /dev/null
+++ b/src/test/test_dnstap_tcp.sh
@@ -0,0 +1,30 @@
+#!/bin/sh -x
+
+# Special test for coverage using dnswire example
+
+if [ -x ~/workspace/dnswire/examples/reader_sender ]; then
+ mkdir -p dnstap
+ (cd dnstap && rm -f *.xml)
+ ../dsc -f "$srcdir/dnstap_tcp.conf" &
+ sleep 2
+ ~/workspace/dnswire/examples/reader_sender "$srcdir/test.dnstap" 127.0.0.1 6666
+ sleep 1
+ ~/workspace/dnswire/examples/reader_sender "$srcdir/test.dnstap" 127.0.0.1 6666
+ sleep 1
+ ~/workspace/dnswire/examples/reader_sender "$srcdir/test.dnstap" 127.0.0.1 6666
+ sleep 1
+ ~/workspace/dnswire/examples/reader_sender "$srcdir/test.dnstap" 127.0.0.1 6666
+ sleep 1
+ ~/workspace/dnswire/examples/reader_sender "$srcdir/test.dnstap" 127.0.0.1 6666
+ sleep 1
+ ~/workspace/dnswire/examples/reader_sender "$srcdir/test.dnstap" 127.0.0.1 6666
+ sleep 5
+ pkill -ou `id -un` dsc
+ sleep 5
+ pgrep -ou `id -un` dsc || exit 0
+ pkill -ou `id -un` dsc
+ sleep 5
+ pgrep -ou `id -un` dsc || exit 0
+ pkill -KILL -ou `id -un` dsc
+ exit 1
+fi