]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests.nobackend/soa-edit/command
Merge pull request #8968 from rgacogne/ddist-doc-proxy-v2
[thirdparty/pdns.git] / regression-tests.nobackend / soa-edit / command
CommitLineData
20e9e54b
PD
1#!/usr/bin/env bash
2set -e
9091cf89
PL
3if [ "${PDNS_DEBUG}" = "YES" ]; then
4 set -x
5fi
20e9e54b
PD
6
7bindwait ()
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
26port=5502
27rm -f pdns*.pid
28
29rm -f soa-edit/bind-dnssec.db
30
31now=$(date +%s)
32delta=$((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 36faketime -m -f -$delta $PDNS --config-dir=soa-edit &
20e9e54b
PD
37bindwait
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 42sleep 15
cd0822b9 43echo 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
48kill $(cat pdns*.pid)
49rm pdns*.pid