]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests/recursor-test-freebsd
Make sure we can install unsigned packages.
[thirdparty/pdns.git] / regression-tests / recursor-test-freebsd
1 #!/bin/sh -ex
2 chmod +x dnsbulktest toxml
3 port=$1
4 [ -z "$port" ] && port=5300
5 limit=$2
6 [ -z "$limit" ] && limit=100000
7
8 : ${RECURSOR:=pdns-recursor-*/pdns_recursor}
9 : ${CSV:="top-1m.csv"}
10 : ${IPv6:="1"}
11 : ${TRACE:="fail"}
12
13 if [ $IPv6 = 1 ]
14 then
15 QLA6=" ::"
16 else
17 QLA6=""
18 fi
19
20 rm -f recursor.pid pdns_recursor.pid
21 ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --local-address=0.0.0.0 --allow-from=0.0.0.0/0 --query-local-address="0.0.0.0${QLA6}" > recursor.log 2>&1 &
22 sleep 3
23 ./dnsbulktest -qe 37.252.127.190 $port $limit < ${CSV} > bulktest.results
24 kill $(cat pdns_recursor.pid)
25 sleep 5
26
27 . ./bulktest.results
28
29 mkdir -p recursor-bulktest
30 rm -f failed_tests passed_tests
31 touch failed_tests passed_tests
32 : ${THRESHOLD:="95"}
33 if [ "$DBT_OKPERCENTAGEINT" -ge $THRESHOLD ]
34 then
35 echo recursor-bulktest >> passed_tests
36 RETVAL=0
37 else
38 echo recursor-bulktest >> failed_tests
39 RETVAL=1
40 fi
41
42 echo "$DBT_OKPERCENTAGE% of domains resolved" > recursor-bulktest/diff
43 egrep 'PowerDNS.COM|^<measurement' recursor.log > recursor-bulktest/stdout
44 echo "<measurement><name>% domains resolved</name><value>$DBT_OKPERCENTAGE</value></measurement>" >> recursor-bulktest/stdout
45
46 : ${context:="recursor-bulktest"}
47
48 export context
49 testsdir=. ./toxml
50
51 exit $RETVAL