]>
Commit | Line | Data |
---|---|---|
20e9e54b PD |
1 | #!/usr/bin/env bash |
2 | set -e | |
9091cf89 PL |
3 | if [ "${PDNS_DEBUG}" = "YES" ]; then |
4 | set -x | |
5 | fi | |
20e9e54b PD |
6 | |
7 | bindwait () | |
8 | { | |
9 | configname=$1 | |
10 | domcount=1 | |
11 | loopcount=0 | |
12 | while [ $loopcount -lt 20 ]; do | |
13 | sleep 1 | |
d9c6538e | 14 | done=$( ($PDNSCONTROL --config-name=$configname --socket-dir=. --no-config bind-domain-status || true) | grep -c 'parsed into memory' || true ) |
20e9e54b PD |
15 | if [ $done = $domcount ] |
16 | then | |
17 | return | |
18 | fi | |
19 | let loopcount=loopcount+1 | |
20 | done | |
21 | if [ $done != $domcount ]; then | |
22 | echo "Domain parsing failed" >> failed_tests | |
23 | fi | |
24 | } | |
25 | ||
26 | port=5502 | |
27 | rm -f pdns*.pid | |
28 | ||
29 | rm -f soa-edit/bind-dnssec.db | |
30 | ||
31 | now=$(date +%s) | |
32 | delta=$((now-1418860790)) # Wed Dec 17 23:59:50 2014 UTC | |
33 | ||
fd5076c8 PL |
34 | $PDNSUTIL --config-dir=soa-edit create-bind-db soa-edit/bind-dnssec.db |
35 | $PDNSUTIL --config-dir soa-edit/ set-meta minimal.com SOA-EDIT INCREMENT-WEEKS | |
d9c6538e | 36 | faketime -m -f -$delta $PDNS --config-dir=soa-edit & |
20e9e54b PD |
37 | bindwait |
38 | ||
d9c6538e | 39 | $SDIG 127.0.0.1 $port minimal.com SOA | LC_ALL=C sort |
cd0822b9 KM |
40 | $SDIG 127.0.0.1 $port minimal.com MX | LC_ALL=C sort |
41 | $SDIG 127.0.0.1 $port nx.minimal.com MX | LC_ALL=C sort | |
20e9e54b | 42 | sleep 15 |
cd0822b9 | 43 | echo midnight has passed |
d9c6538e | 44 | $SDIG 127.0.0.1 $port minimal.com SOA | LC_ALL=C sort |
cd0822b9 KM |
45 | $SDIG 127.0.0.1 $port minimal.com MX | LC_ALL=C sort |
46 | $SDIG 127.0.0.1 $port nx.minimal.com MX | LC_ALL=C sort | |
47 | ||
20e9e54b PD |
48 | kill $(cat pdns*.pid) |
49 | rm pdns*.pid |