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