]> granicus.if.org Git - pdns/commitdiff
make tests skippable on specific predicates; prepare for nsec3 testing
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 27 Feb 2012 11:52:15 +0000 (11:52 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 27 Feb 2012 11:52:15 +0000 (11:52 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2432 d19b8d6e-7fed-0310-83ef-9ca221ded41b

regression-tests/runtests
regression-tests/start-test-stop

index d356d17194abb32541fb3fdd549a649ec58ab970..4620aa59f26cdde6d99900a547d8e688baa5f535 100755 (executable)
@@ -11,7 +11,7 @@ skipped=0
 
 touch passed_tests failed_tests skipped_tests
 
-for a in $(find . -type d | grep -v ^.$ | sed s:^./:: | grep -v .svn | grep -v ^confdir | grep -v ^dnssec-only | LC_ALL=C sort) 
+for a in $(find . -type d | grep -v ^.$ | sed s:^./:: | grep -v .svn | grep -v ^confdir | LC_ALL=C sort) 
 do
        echo  "$a: "
        cat $a/description 
@@ -19,15 +19,35 @@ do
        echo  "$a: " >> test-results
        cat $a/description >> test-results
        
+       SKIPIT=0
        if [ -e $a/skip ] 
        then
+               SKIPIT=1
                result="        Skipped test $a"
+       else
+               for reason in "$skipreasons"
+               do
+                       if [ -e $a/skip.$reason ]
+                       then
+                               SKIPIT=1
+                               result="        Skipped test $a for reason $reason"
+                               break
+                       fi
+               done
+       fi
+                               
+       if [ $SKIPIT = 1 ]
+       then
                echo $a >> skipped_tests
                skipped=$[$skipped+1]
        else    
                $a/command > /dev/null
                $a/command > $a/real_result
                expected=$a/expected_result
+               for extracontext in "$extracontexts"
+               do
+                       [ -e "$a/expected_result.$extracontext" ] && expected=$a/expected_result.$extracontext
+               done
                [ -n "$context" ] && [ -e "$a/expected_result.$context" ] && expected=$a/expected_result.$context
                diff -u $expected $a/real_result > $a/diff
                if [ -s $a/diff ] 
index 3358ac4b1be1e4a2942dc22d6890ad06cec39728..84e2546ae155ff5fa159e40fee4fb81c8c8e1dc5 100755 (executable)
@@ -18,6 +18,7 @@ case $context in
                                --no-shuffle --launch=bind --bind-config=./named.conf                \
                                --fancy-records --query-logging --send-root-referral --loglevel=9    \
                                --cache-ttl=0 --no-config &
+                       skipreasons=nodnssec
                        ;;
                bind-gsqlite3)
                        ./bind-gsqlite3-setup
@@ -50,8 +51,9 @@ case $context in
                                --gmysql-user="$GMYSQLUSER" \
                                --gmysql-host="$GMYSQLHOST" \
                                --gmysql-password="$GMYSQLPASS" &
+                       skipreasons=nodnssec
                        ;;
-               gmysql)
+               gmysql | gmysql-nsec3)
                        [ -z "$GMYSQLDB" ] && GMYSQLDB=pdnstest
                        [ -z "$GMYSQLUSER" ] && GMYSQLUSER=root
                        [ -z "$GMYSQLHOST" ] && GMYSQLHOST=localhost
@@ -79,6 +81,11 @@ __EOF__
                        for zone in $(grep zone named.conf  | cut -f2 -d\")
                        do
                                ../pdns/pdnssec --config-dir=. --config-name=gmysql     secure-zone $zone 2>&1
+                               if [ $context = gmysql-nsec3 ]
+                               then
+                                       ../pdns/pdnssec --config-dir=. --config-name=gmysql set-nsec3 $zone '1 1 1 abcd' 2>&1
+                                       ../pdns/pdnssec --config-dir=. --config-name=gmysql rectify-zone $zone 2>&1
+                               fi
                        done
 
                        ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./  \
@@ -89,6 +96,10 @@ __EOF__
                                --gmysql-user="$GMYSQLUSER" \
                                --gmysql-host="$GMYSQLHOST" \
                                --gmysql-password="$GMYSQLPASS" &
+                       if [ $context = gmysql-nsec3 ]
+                       then
+                               subcontexts=nsec3
+                       fi
                        ;;                      
                *)
                        echo unknown context $context
@@ -100,6 +111,8 @@ esac
                
 export port
 export context
+export extracontexts
+export skipreasons
 
 ## TODO: give pdns a few seconds to startup or fail, then check if it did not fail
 ## TODO: give sdig a timeout