]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - build-scripts/test-recursor
Merge pull request #9053 from rgacogne/devpoll-no-naked-pointer
[thirdparty/pdns.git] / build-scripts / test-recursor
index c02f34550c88618ba9ffa4a40193c2a2b8e6de0e..9f7b35a672a15f25f18f7e9586bd8f7716fd7ea4 100755 (executable)
@@ -1,5 +1,14 @@
 #!/bin/sh
 
+export PDNSRECURSOR=${PDNSRECURSOR:-"/usr/sbin/pdns_recursor"}
+export RECCONTROL=${RECCONTROL:-"/usr/bin/rec_control"}
+export PDNS=${PDNS:-"/usr/sbin/pdns_server"}
+export PDNSUTIL=${PDNSUTIL:-"/usr/bin/pdnsutil"}
+export SDIG=${SDIG:-"/usr/bin/sdig"}
+export NSEC3DIG=${NSEC3DIG:-"/usr/bin/nsec3dig"}
+export NOTIFY=${NOTIFY:-"/usr/bin/notify"}
+export SAXFR=${SAXFR:-"/usr/bin/saxfr"}
+
 if [ "$0" != "./build-scripts/test-recursor" ]; then
   echo "Please run me from the root checkout dir"
   exit 1
@@ -7,6 +16,51 @@ fi
 
 set -x
 
-cd regression-tests
+cd regression-tests/modules
+
+MODULES=""
+
+for dir in /usr/lib/x86_64-linux-gnu/pdns /usr/lib64/pdns; do
+  if [ -d $dir ]; then
+    MODULES=$dir
+    break
+  fi
+done
+[ -z $MODULES ] && echo "No module directory found" >&2 && exit 1
+
+# Symlink the modules on the system
+cd regression-tests/modules
+for backend in *.so; do
+  ln -sf $MODULES/$backend $backend
+done
+
+cd ../../regression-tests.recursor
+cp vars.sample vars
+sed -i 's!PREFIX=.*!PREFIX=127.0.0!' vars
+
+EXIT=0
+
+./config.sh
+./start.sh
+sleep 3
+svstat configs/*
+## prints the logs of supervised processes reported as running for less than 3 secs
+for config in configs/* ; do
+    secs=$(svstat ${config} | perl -pe 's!.* (\d+) seconds!\1!')
+    if [ -n "${secs}" ] && [ ${secs} -lt 3 ] ; then
+        echo "-----------------"
+        echo "Logs of ${config}"
+        echo "-----------------"
+        cat ${config}/logfile
+    fi
+done
+./runtests || EXIT=1
+./stop.sh
+sleep 3
+./clean.sh
+
+cd ../regression-tests.recursor-dnssec
+./runtests -e SNMP || EXIT=1
+./printlogs.py || true
 
-./runtests recursor
+exit $EXIT