]> git.ipfire.org Git - thirdparty/pdns.git/blob - build-scripts/test-recursor
auth: Wrap pthread_ objects
[thirdparty/pdns.git] / build-scripts / test-recursor
1 #!/bin/sh
2
3 export PDNSRECURSOR=${PDNSRECURSOR:-"/usr/sbin/pdns_recursor"}
4 export RECCONTROL=${RECCONTROL:-"/usr/bin/rec_control"}
5 export PDNS=${PDNS:-"/usr/sbin/pdns_server"}
6 export PDNSUTIL=${PDNSUTIL:-"/usr/bin/pdnsutil"}
7 export SDIG=${SDIG:-"/usr/bin/sdig"}
8 export NSEC3DIG=${NSEC3DIG:-"/usr/bin/nsec3dig"}
9 export NOTIFY=${NOTIFY:-"/usr/bin/notify"}
10 export SAXFR=${SAXFR:-"/usr/bin/saxfr"}
11
12 if [ "$0" != "./build-scripts/test-recursor" ]; then
13 echo "Please run me from the root checkout dir"
14 exit 1
15 fi
16
17 set -x
18
19 cd regression-tests/modules
20
21 MODULES=""
22
23 for dir in /usr/lib/x86_64-linux-gnu/pdns /usr/lib64/pdns; do
24 if [ -d $dir ]; then
25 MODULES=$dir
26 break
27 fi
28 done
29 [ -z $MODULES ] && echo "No module directory found" >&2 && exit 1
30
31 # Symlink the modules on the system
32 cd regression-tests/modules
33 for backend in *.so; do
34 ln -sf $MODULES/$backend $backend
35 done
36
37 cd ../../regression-tests.recursor
38 cp vars.sample vars
39 sed -i 's!PREFIX=.*!PREFIX=127.0.0!' vars
40
41 EXIT=0
42
43 ./config.sh
44 ./start.sh
45 sleep 3
46 svstat configs/*
47 ## prints the logs of supervised processes reported as running for less than 3 secs
48 for config in configs/* ; do
49 secs=$(svstat ${config} | perl -pe 's!.* (\d+) seconds!\1!')
50 if [ -n "${secs}" ] && [ ${secs} -lt 3 ] ; then
51 echo "-----------------"
52 echo "Logs of ${config}"
53 echo "-----------------"
54 cat ${config}/logfile
55 fi
56 done
57 ./runtests || EXIT=1
58 ./stop.sh
59 sleep 3
60 ./clean.sh
61
62 cd ../regression-tests.recursor-dnssec
63 ./runtests -e SNMP || EXIT=1
64 ./printlogs.py || true
65
66 exit $EXIT