]> git.ipfire.org Git - thirdparty/pdns.git/blame - build-scripts/test-recursor
Merge pull request #13453 from omoerbeek/rec-yaml-transition-docs
[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
607d24f9
OM
19EXTRA_ARG=""
20if [ $PWD = /srv/buildbot-worker/test-rec-debian-buster/build ]; then
21 EXTRA_ARG=--ignore=test_SNMP.py
22fi
23
cd82fe94
PL
24cd regression-tests/modules
25
26MODULES=""
27
28for dir in /usr/lib/x86_64-linux-gnu/pdns /usr/lib64/pdns; do
29 if [ -d $dir ]; then
30 MODULES=$dir
31 break
32 fi
33done
34[ -z $MODULES ] && echo "No module directory found" >&2 && exit 1
35
36# Symlink the modules on the system
cd82fe94
PL
37for backend in *.so; do
38 ln -sf $MODULES/$backend $backend
39done
40
41cd ../../regression-tests.recursor
ffb198de
PL
42cp vars.sample vars
43sed -i 's!PREFIX=.*!PREFIX=127.0.0!' vars
44
45EXIT=0
46
47./config.sh
48./start.sh
49sleep 3
50svstat configs/*
fc3c2d2e
CHB
51## prints the logs of supervised processes reported as running for less than 3 secs
52for config in configs/* ; do
86bb687c 53 secs=$(svstat ${config} | perl -pe 's!.* (\d+) seconds!\1!')
fc3c2d2e
CHB
54 if [ -n "${secs}" ] && [ ${secs} -lt 3 ] ; then
55 echo "-----------------"
56 echo "Logs of ${config}"
57 echo "-----------------"
58 cat ${config}/logfile
59 fi
60done
ffb198de
PL
61./runtests || EXIT=1
62./stop.sh
63sleep 3
64./clean.sh
434e4760 65
7568b07d 66cd ../regression-tests.recursor-dnssec
607d24f9
OM
67
68./runtests $EXTRA_ARG $@ || EXIT=1
a002923f 69./printlogs.py || true
7568b07d 70
ffb198de 71exit $EXIT