5 export PDNS
=${PDNS:-${PWD}/../pdns/pdns_server}
6 export PDNS2
=${PDNS2:-${PWD}/../pdns/pdns_server}
7 export PDNSRECURSOR
=${PDNSRECURSOR:-${PWD}/../pdns_recursor}
8 export RECCONTROL
=${RECCONTROL:-${PWD}/../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 ZONE2LDAP
=${ZONE2LDAP:-${PWD}/../pdns/zone2ldap}
15 export PDNSUTIL
=${PDNSUTIL:-${PWD}/../pdns/pdnsutil}
16 export PDNSCONTROL
=${PDNSCONTROL:-${PWD}/../pdns/pdns_control}
19 [ -z $spectest ] && spectest
=""
21 for prog
in $SDIG $SAXFR $NOTIFY $NSEC3DIG; do
22 if `echo $prog | grep -q '../pdns'`; then
23 ${MAKE} -C ..
/pdns
${prog##*../pdns/} ||
exit
27 export SDIG
="timeout 5 $SDIG"
28 export NSEC3DIG
="timeout 5 $NSEC3DIG"
29 export SAXFR
="timeout 30 $SAXFR"
30 export PDNSCONTROL
="timeout 5 $PDNSCONTROL"
32 rm -f test-results failed_tests passed_tests skipped_tests
${testsdir}/*/real_result ${testsdir}/*/diff ${testsdir}/*/*.out ${testsdir}/*/start ${testsdir}/*/step.
*
38 touch passed_tests failed_tests skipped_tests
40 for a
in $
(find $testsdir -type d |
grep -v ^.$ |
grep -v .svn |
grep -v ^confdir | LC_ALL
=C
sort)
42 if [ ! -x $a/command ]
46 testname
=$
(basename $a)
51 echo "$testname: " >> test-results
52 cat $a/description
>> test-results
58 result
=" Skipped test $a"
60 for reason
in $skipreasons $context
62 if [ -e $a/skip.
$reason ]
65 result
=" Skipped test $a for reason $reason"
72 for reason
in $skipreasons $context
74 if [ -e $a/fail.
$reason ]
81 if [ "$spectest" != "" ] && [ "$spectest" != "$testname" ] && [ "$testname" != "00dnssec-grabkeys" ]
84 result
=" Skipped test $a because it's not the specified single test"
90 echo $testname >> skipped_tests
93 $a/command > $a/real_result
94 expected
=$a/expected_result
97 if [ -e $a/expected_result.i
]; then
98 expected
=$a/expected_result.i
99 diffopts
="${diffopts} -i"
102 for extracontext
in $extracontexts
104 [ -e "$a/expected_result.$extracontext" ] && expected
=$a/expected_result.
$extracontext
106 [ -n "$context" ] && [ -e "$a/expected_result.$context" ] && expected
=$a/expected_result.
$context
107 diff ${diffopts} $expected $a/real_result
> $a/diff 2>&1
112 result
=" Failed test $a"
113 echo $testname >> failed_tests
116 result
=" Expected failure for reason $reason, test passed $a"
117 echo $testname >> passed_tests
123 result
=" Passed test $a"
124 echo $testname >> passed_tests
127 result
=" Unexpected pass for reason $reason, test failed $a"
128 echo $testname >> failed_tests
135 echo "$result" >> test-results
139 echo -n $passed out of $
[$passed+$failed]
141 res
=$
((echo scale
=2; echo 100*$passed/\
($passed+$failed\
)) |
bc )
143 echo tests passed
, $skipped were skipped