5 export PDNS
=${PDNS:-${PWD}/../pdns/pdns_server}
6 export PDNS2
=${PDNS2:-${PWD}/../pdns/pdns_server}
7 export PDNSRECURSOR
=${PDNSRECURSOR:-${PWD}/../pdns/recursordist/pdns_recursor}
8 export RECCONTROL
=${RECCONTROL:-${PWD}/../pdns/recursordist/rec_control}
9 export SDIG
=${SDIG:-${PWD}/../pdns/sdig}
10 export NOTIFY
=${NOTIFY:-${PWD}/../pdns/pdns_notify}
11 export NSEC3DIG
=${NSEC3DIG:-${PWD}/../pdns/nsec3dig}
12 export SAXFR
=${SAXFR:-${PWD}/../pdns/saxfr}
13 export ZONE2SQL
=${ZONE2SQL:-${PWD}/../pdns/zone2sql}
14 export ZONE2JSON
=${ZONE2JSON:-${PWD}/../pdns/zone2json}
15 export ZONE2LDAP
=${ZONE2LDAP:-${PWD}/../pdns/zone2ldap}
16 export PDNSUTIL
=${PDNSUTIL:-${PWD}/../pdns/pdnsutil}
17 export PDNSCONTROL
=${PDNSCONTROL:-${PWD}/../pdns/pdns_control}
22 [ -z $spectest ] && spectest
=""
24 for prog
in $SDIG $SAXFR $NOTIFY $NSEC3DIG; do
25 if `echo $prog | grep -q '\.\./pdns'`; then
26 ${MAKE} -C ..
/pdns
${prog##*../pdns/} ||
exit
30 export SDIG
="timeout 5 $SDIG"
31 export NSEC3DIG
="timeout 5 $NSEC3DIG"
32 export SAXFR
="timeout 30 $SAXFR"
33 export PDNSCONTROL
="timeout 5 $PDNSCONTROL"
35 rm -f test-results failed_tests passed_tests skipped_tests
${testsdir}/*/real_result ${testsdir}/*/diff ${testsdir}/*/*.out ${testsdir}/*/start ${testsdir}/*/step.
*
41 touch passed_tests failed_tests skipped_tests
43 for a
in $
(find $testsdir -type d |
grep -v ^.$ |
grep -v .svn |
grep -v ^confdir | LC_ALL
=C
sort)
45 if [ ! -x $a/command ]
49 testname
=$
(basename $a)
54 echo "$testname: " >> test-results
55 cat $a/description
>> test-results
61 result
=" Skipped test $a"
63 for reason
in $skipreasons $context
65 if [ -e $a/skip.
$reason ]
68 result
=" Skipped test $a for reason $reason"
75 for reason
in $skipreasons $context
77 if [ -e $a/fail.
$reason ]
84 if [ "$spectest" != "" ] && [ "$spectest" != "$testname" ] && [ "$testname" != "00dnssec-grabkeys" ]
87 result
=" Skipped test $a because it's not the specified single test"
93 echo $testname >> skipped_tests
96 $a/command > $a/real_result
97 expected
=$a/expected_result
100 if [ -e $a/expected_result.i
]; then
101 expected
=$a/expected_result.i
102 diffopts
="${diffopts} -i"
105 for extracontext
in $extracontexts
107 [ -e "$a/expected_result.$extracontext" ] && expected
=$a/expected_result.
$extracontext
109 [ -n "$context" ] && [ -e "$a/expected_result.$context" ] && expected
=$a/expected_result.
$context
110 diff ${diffopts} $expected $a/real_result
> $a/diff 2>&1
115 result
=" Failed test $a"
116 echo $testname >> failed_tests
119 result
=" Expected failure for reason $reason, test passed $a"
120 echo $testname >> passed_tests
126 result
=" Passed test $a"
127 echo $testname >> passed_tests
130 result
=" Unexpected pass for reason $reason, test failed $a"
131 echo $testname >> failed_tests
138 echo "$result" >> test-results
142 echo -n $passed out of $
[$passed+$failed]
144 res
=$
((echo scale
=2; echo 100*$passed/\
($passed+$failed\
)) |
bc )
146 echo tests passed
, $skipped were skipped