]>
Commit | Line | Data |
---|---|---|
cf4d037d PD |
1 | #!/usr/bin/env bash |
2 | set -e | |
3 | set -x | |
17d0b1e6 PD |
4 | |
5 | bindwait () | |
6 | { | |
7 | configname=$1 | |
8 | domcount=1 | |
2ede4134 | 9 | loopcount=0 |
7a47bdee | 10 | while [ $loopcount -lt 20 ]; do |
2ede4134 | 11 | sleep 1 |
17d0b1e6 PD |
12 | done=$( (../pdns/pdns_control --config-name=$configname --socket-dir=. --no-config bind-domain-status || true) | grep -c 'parsed into memory' || true ) |
13 | if [ $done = $domcount ] | |
2ede4134 | 14 | then |
17d0b1e6 PD |
15 | return |
16 | fi | |
5837ffbc | 17 | let loopcount=loopcount+1 |
2ede4134 PD |
18 | done |
19 | if [ $done != $domcount ]; then | |
20 | echo "Domain parsing failed" >> failed_tests | |
21 | fi | |
17d0b1e6 PD |
22 | } |
23 | ||
24 | port=5501 | |
25 | rm -f pdns*.pid | |
26 | ||
27 | ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \ | |
28 | --no-shuffle --launch=bind --bind-config=edns-packet-cache/named.conf \ | |
b6cab82e | 29 | --send-root-referral --cache-ttl=60 --no-config & |
17d0b1e6 PD |
30 | bindwait |
31 | ||
32 | # prime cache without EDNS | |
33 | ../pdns/sdig 127.0.0.1 5501 minimal.com SOA | LC_ALL=C sort | |
34 | # expect EDNS in identical query with EDNS | |
35 | SDIGBUFSIZE=512 ../pdns/sdig 127.0.0.1 5501 minimal.com SOA | LC_ALL=C sort | |
36 | ||
37 | # prime cache with EDNS | |
38 | SDIGBUFSIZE=512 ../pdns/sdig 127.0.0.1 5501 minimal.com NS | LC_ALL=C sort | |
39 | # expect no EDNS in identical query without EDNS | |
40 | ../pdns/sdig 127.0.0.1 5501 minimal.com NS | LC_ALL=C sort | |
41 | ||
42 | kill $(cat pdns*.pid) | |
43 | rm pdns*.pid |