summaryrefslogtreecommitdiffstats
path: root/src/test/test_dnstap_tcp.sh
blob: 8c02bd74853dcef37798d269596e208c9526fb09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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