]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Improve the rec bulk test script 10668/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 25 Aug 2021 09:32:02 +0000 (09:32 +0000)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 25 Aug 2021 09:41:09 +0000 (09:41 +0000)
- Exit if rec did not start up
- Status requesting commands (rec_control and kill -USR1) failures are non-fatal
  except for the last 'ping' command.
- Increase timeout of rec_control command (to help investigating issues on buildbot)

The script is run with -e, so failure will lead to exit without killing
the running recursor atm.

regression-tests/recursor-test

index 5c2c4df68987491343a38f90c876d9daf06015a3..5b7d1a628da4b7adc52d9bf2d637bb8ae36e17d8 100755 (executable)
@@ -33,31 +33,42 @@ rm -f recursor.pid pdns_recursor.pid
 <measurement><name>%% CPU used</name><value>%P</value></measurement>
 '         ${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 --record-cache-shards=$shards --disable-packetcache --refresh-on-ttl-perc=10 --dnssec=validate > recursor.log 2>&1 &
 sleep 3
+if [ ! -e pdns_recursor.pid ]; then
+       echo Recursor did not start or did not write pdns_recursor.pid, exiting
+       exit 1
+fi
+
 
 # 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
 echo
-kill -USR1 $(cat pdns_recursor.pid)
-${RECCONTROL} --socket-dir=. --config-dir=. get-all
+kill -USR1 $(cat pdns_recursor.pid) || true
+${RECCONTROL} --timeout=20 --socket-dir=. --config-dir=. get-all || true
+
 # 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 -USR1 $(cat pdns_recursor.pid)
-${RECCONTROL} --socket-dir=. --config-dir=. get-all
+kill -USR1 $(cat pdns_recursor.pid) || true
+${RECCONTROL} --timeout=20 --socket-dir=. --config-dir=. get-all || true
+
 # 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) || true
+${RECCONTROL} --timeout=20 --socket-dir=. --config-dir=. get-all || true
+
+# give it a chance to write the log requested by the kill
+sleep 1
 echo
 echo "=== RECURSOR LOG ==="
 cat recursor.log
 echo "=== END RECURSOR LOG ==="
-kill -USR1 $(cat pdns_recursor.pid)
-${RECCONTROL} --socket-dir=. --config-dir=. get-all
 sleep 1
+${RECCONTROL} --timeout=20 --socket-dir=. --config-dir=. ping
 kill $(cat pdns_recursor.pid) 
 sleep 5