]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - regression-tests/recursor-test
Make sure we can install unsigned packages.
[thirdparty/pdns.git] / regression-tests / recursor-test
index e0cfddc18e5de5bcdc83866afa391de2e833c1d4..e65bbc257c8517a14fe98b1f6da96d16d39e0cea 100755 (executable)
@@ -1,10 +1,17 @@
-#!/bin/bash -ex
+#!/bin/bash -e
 port=$1
 [ -z "$port" ] && port=5300
 limit=$2
 [ -z "$limit" ] && limit=100000
+threads=$3
+[ -z "$threads" ] && threads=2
+mthreads=$4
+[ -z "$mthreads" ] && mthreads=100
+shards=$5
+[ -z "$shards" ] && shards=1024
 
 : ${RECURSOR:="../pdns/recursordist/pdns_recursor"}
+: ${RECCONTROL:="../pdns/recursordist/rec_control"}
 : ${CSV:="top-1m.csv"}
 : ${IPv6:="0"}
 : ${TRACE:="fail"}
@@ -12,7 +19,7 @@ limit=$2
 
 if [ $IPv6 = 1 ]
 then
-       QLA6="::"
+       QLA6=" ::"
 else
        QLA6=""
 fi
@@ -24,10 +31,34 @@ rm -f recursor.pid pdns_recursor.pid
 <measurement><name>system CPU seconds</name><value>%S</value></measurement>
 <measurement><name>wallclock seconds</name><value>%e</value></measurement>
 <measurement><name>%% CPU used</name><value>%P</value></measurement>
-'         ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --max-mthreads=100 --query-local-address6="${QLA6}" > recursor.log 2>&1 &
+'         ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --max-mthreads=$mthreads --query-local-address="0.0.0.0${QLA6}" --threads=$threads --cache-shards=$shards --disable-packetcache > recursor.log 2>&1 &
 sleep 3
+
+# warm up the cache
+echo
+echo === First run with limit=$limit threads=$threads mthreads=$mthreads shards=$shards ===
+${DNSBULKTEST} --www=false -qe 127.0.0.1 $port $limit < ${CSV} > bulktest.results
+kill -USR1 $(cat pdns_recursor.pid)
+${RECCONTROL} --socket-dir=. --config-dir=. get-all
+# rerun 1 with hot cache
+echo
+echo === Second run with limit=$limit threads=$threads mthreads=$mthreads shards=$shards ===
 ${DNSBULKTEST} --www=false -qe 127.0.0.1 $port $limit < ${CSV} > bulktest.results
-kill $(cat pdns_recursor.pid)
+kill -USR1 $(cat pdns_recursor.pid)
+${RECCONTROL} --socket-dir=. --config-dir=. get-all
+# rerun 2 with hot cache
+echo
+echo === Third run with limit=$limit threads=$threads mthreads=$mthreads shards=$shards ===
+${DNSBULKTEST} --www=false -qe 127.0.0.1 $port $limit < ${CSV} > bulktest.results
+kill -USR1 $(cat pdns_recursor.pid)
+${RECCONTROL} --socket-dir=. --config-dir=. get-all
+
+sleep 1
+echo
+echo "=== RECURSOR LOG ==="
+cat recursor.log
+echo "=== END RECURSOR LOG ==="
+kill $(cat pdns_recursor.pid) 
 sleep 5
 
 . ./bulktest.results