summaryrefslogtreecommitdiffstats
path: root/src/test/test5.sh
blob: 4831eb4d7cc929de7c2b5493fa1a4ff149cf997b (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh -xe

test "$TEST_DNSPERF_WITH_NETWORK" = "1" || exit 0

dumdumd=`which dumdumd`
dumdohd=`which dumdohd`

pkill -9 dumdumd || true
pkill -9 dumdohd || true

if [ -n "$dumdumd" ]; then
    $dumdumd 127.0.0.1 5353 -r -D 100 &
    pid="$!"
    sleep 2
    ../dnsperf -s 127.0.0.1 -p 5353 -d "$srcdir/datafile" -t 2 -l 2 -Q 10 -m tcp
    kill "$pid"
    sleep 2

    $dumdumd 127.0.0.1 5353 -r -D 10 &
    pid="$!"
    sleep 2
    ../dnsperf -s 127.0.0.1 -p 5353 -d "$srcdir/datafile" -t 2 -l 10 -Q 100 -m tcp
    kill "$pid"
    sleep 2

    rm -f key.pem cert.pem
    openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd"

    $dumdumd 127.0.0.1 5353 -r -T -D 100 &
    pid="$!"
    sleep 2
    ../dnsperf -s 127.0.0.1 -p 5353 -d "$srcdir/datafile" -t 2 -l 2 -Q 10 -m dot
    kill "$pid"
    sleep 2

    $dumdumd 127.0.0.1 5353 -r -T -D 10 &
    pid="$!"
    sleep 2
    ../dnsperf -s 127.0.0.1 -p 5353 -d "$srcdir/datafile" -t 2 -l 10 -Q 100 -m dot
    kill "$pid"
fi

if [ -n "$dumdohd" ]; then
    rm -f key.pem cert.pem
    openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd"

    $dumdohd 5353 key.pem cert.pem -D 100 &
    pid="$!"
    sleep 2
    ../dnsperf -s 127.0.0.1 -p 5353 -d "$srcdir/datafile" -t 2 -l 2 -Q 10 -m doh
    kill "$pid"
    sleep 2

    $dumdohd 5353 key.pem cert.pem -D 10 &
    pid="$!"
    sleep 2
    ../dnsperf -s 127.0.0.1 -p 5353 -d "$srcdir/datafile" -t 2 -l 10 -Q 100 -m doh
    kill "$pid"
fi