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}
20 [ -z $spectest ] && spectest
=""
22 for prog
in $SDIG $SAXFR $NOTIFY $NSEC3DIG; do
23 if `echo $prog | grep -q '../pdns'`; then
24 ${MAKE} -C ..
/pdns
${prog##*../pdns/} ||
exit
28 export SDIG
="timeout 5 $SDIG"
29 export NSEC3DIG
="timeout 5 $NSEC3DIG"
30 export SAXFR
="timeout 30 $SAXFR"
31 export PDNSCONTROL
="timeout 5 $PDNSCONTROL"
33 rm -f test-results failed_tests passed_tests skipped_tests
${testsdir}/*/real_result ${testsdir}/*/diff ${testsdir}/*/*.out ${testsdir}/*/start ${testsdir}/*/step.
*
39 touch passed_tests failed_tests skipped_tests
41 for a
in $
(find $testsdir -type d |
grep -v ^.$ |
grep -v .svn |
grep -v ^confdir | LC_ALL
=C
sort)
43 if [ ! -x $a/command ]
47 testname
=$
(basename $a)
52 echo "$testname: " >> test-results
53 cat $a/description
>> test-results
59 result
=" Skipped test $a"
61 for reason
in $skipreasons $context
63 if [ -e $a/skip.
$reason ]
66 result
=" Skipped test $a for reason $reason"
73 for reason
in $skipreasons $context
75 if [ -e $a/fail.
$reason ]
82 if [ "$spectest" != "" ] && [ "$spectest" != "$testname" ] && [ "$testname" != "00dnssec-grabkeys" ]
85 result
=" Skipped test $a because it's not the specified single test"
91 echo $testname >> skipped_tests
94 $a/command > $a/real_result
95 expected
=$a/expected_result
98 if [ -e $a/expected_result.i
]; then
99 expected
=$a/expected_result.i
100 diffopts
="${diffopts} -i"
103 for extracontext
in $extracontexts
105 [ -e "$a/expected_result.$extracontext" ] && expected
=$a/expected_result.
$extracontext
107 [ -n "$context" ] && [ -e "$a/expected_result.$context" ] && expected
=$a/expected_result.
$context
108 diff ${diffopts} $expected $a/real_result
> $a/diff 2>&1
113 result
=" Failed test $a"
114 echo $testname >> failed_tests
117 result
=" Expected failure for reason $reason, test passed $a"
118 echo $testname >> passed_tests
124 result
=" Passed test $a"
125 echo $testname >> passed_tests
128 result
=" Unexpected pass for reason $reason, test failed $a"
129 echo $testname >> failed_tests
136 echo "$result" >> test-results
140 echo -n $passed out of $
[$passed+$failed]
142 res
=$
((echo scale
=2; echo 100*$passed/\
($passed+$failed\
)) |
bc )
144 echo tests passed
, $skipped were skipped