]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
only use a single policy file when testing.
authorMark Andrews <marka@isc.org>
Wed, 30 Jan 2019 01:12:47 +0000 (12:12 +1100)
committerMark Andrews <marka@isc.org>
Wed, 30 Jan 2019 05:00:14 +0000 (16:00 +1100)
(cherry picked from commit 36ea9b81816835b92888ffca4c74cbc255e2ac4b)

20 files changed:
bin/tests/system/keymgr/01-ksk-inactive/expect
bin/tests/system/keymgr/02-zsk-inactive/expect
bin/tests/system/keymgr/03-ksk-unpublished/expect
bin/tests/system/keymgr/04-zsk-unpublished/expect
bin/tests/system/keymgr/05-ksk-unpub-active/expect
bin/tests/system/keymgr/06-zsk-unpub-active/expect
bin/tests/system/keymgr/07-ksk-ttl/expect
bin/tests/system/keymgr/08-zsk-ttl/expect
bin/tests/system/keymgr/09-no-keys/expect
bin/tests/system/keymgr/10-change-roll/expect
bin/tests/system/keymgr/11-many-simul/expect
bin/tests/system/keymgr/12-many-active/expect
bin/tests/system/keymgr/13-noroll/expect
bin/tests/system/keymgr/14-wrongalg/expect
bin/tests/system/keymgr/15-unspec/expect
bin/tests/system/keymgr/16-wrongalg-unspec/expect
bin/tests/system/keymgr/17-noforce/expect
bin/tests/system/keymgr/18-nonstd-prepub/expect
bin/tests/system/keymgr/19-old-keys/expect
bin/tests/system/keymgr/tests.sh

index b076310d4497e6badb26b86a5342b2014d8ac46c..bf908e7c21218a5b8dbf7cf73ee12c6d73de01ec 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1h -m 2h example.com"
index b076310d4497e6badb26b86a5342b2014d8ac46c..bf908e7c21218a5b8dbf7cf73ee12c6d73de01ec 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1h -m 2h example.com"
index b076310d4497e6badb26b86a5342b2014d8ac46c..bf908e7c21218a5b8dbf7cf73ee12c6d73de01ec 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1h -m 2h example.com"
index b076310d4497e6badb26b86a5342b2014d8ac46c..bf908e7c21218a5b8dbf7cf73ee12c6d73de01ec 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1h -m 2h example.com"
index b076310d4497e6badb26b86a5342b2014d8ac46c..bf908e7c21218a5b8dbf7cf73ee12c6d73de01ec 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1h -m 2h example.com"
index b076310d4497e6badb26b86a5342b2014d8ac46c..bf908e7c21218a5b8dbf7cf73ee12c6d73de01ec 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1h -m 2h example.com"
index de792a9d5ea9df85b08b1c017b59711850104abf..03d719c3f4c4596dcb948d4295d2458341a7b1bd 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index de792a9d5ea9df85b08b1c017b59711850104abf..03d719c3f4c4596dcb948d4295d2458341a7b1bd 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index de792a9d5ea9df85b08b1c017b59711850104abf..03d719c3f4c4596dcb948d4295d2458341a7b1bd 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index de792a9d5ea9df85b08b1c017b59711850104abf..03d719c3f4c4596dcb948d4295d2458341a7b1bd 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index de792a9d5ea9df85b08b1c017b59711850104abf..03d719c3f4c4596dcb948d4295d2458341a7b1bd 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index f990a7a0270a4f37681531bc5f3376f061d7c21b..67fc4e912c4e52d5e565cabfc93d7a58be91e05b 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf -f example.com"
+kargs="-f example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index 40616e1a9375bf460bdc468df928efdd85c7ddb1..67fc4e912c4e52d5e565cabfc93d7a58be91e05b 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-f -c policy.conf example.com"
+kargs="-f example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index 436f05fbc9f8dedefbffd94d7fc272558e286264..bd5eadbf7afc2d2344462dd69792db1e46d64d86 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index b1ff4fc3fe5612bad8259b5188027ba9e9be5f24..ad300c498cb5ffe9553d789424c83e376387a6d8 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf"
+kargs=""
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index 7a21decc0be20436304f3732a2ac21cb5f79dd8a..c836535ce826b85b350473567c34676b6947eb8b 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf"
+kargs=""
 kmatch=""
 kret=0
 cargs="-d 1w -m 2w example.com"
index a5bf1f1ec5c081300c824c81163b4e2f3d60bfa2..029a4e903abc332258be2a44e36e4960a96f4b28 100644 (file)
@@ -1,4 +1,4 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=1
 cargs="-d 1w -m 2w example.com"
index de792a9d5ea9df85b08b1c017b59711850104abf..e8518d8c3a1d40ca6e96bf5497374857a8d747ab 100644 (file)
@@ -1,7 +1,7 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
-cargs="-d 1w -m 2w example.com"
+cargs="-d 1h -m 1d example.com"
 cmatch=""
 cret=0
 warn=0
index f3e49b3d28600e2219ddbdc44b87ea56f24ccdcb..ad73b536c98f7e784be2180e25df1f8bcc706b12 100644 (file)
@@ -1,7 +1,7 @@
-kargs="-c policy.conf example.com"
+kargs="example.com"
 kmatch=""
 kret=0
-cargs="-d 1w -m 2w example.com"
+cargs="-d 1h -m 1w example.com"
 cmatch="4,Publish
 4,Activate
 2,Inactive
index 6ef0a3676820bcfe6623d01305232feb57727de2..66ddf1f0e453ee397621c904f4e8980eb45a1d63 100644 (file)
@@ -19,12 +19,12 @@ matchall () {
     match_result=ok
     file=$1
     while IFS="," read expect matchline; do
-        [ -z "$matchline" ] && continue
-        matches=`grep "$matchline" $file | wc -l`
-        [ "$matches" -ne "$expect" ] && {
-            echo "'$matchline': expected $expect found $matches"
-            return 1
-        }
+       [ -z "$matchline" ] && continue
+       matches=`grep "$matchline" $file | wc -l`
+       [ "$matches" -ne "$expect" ] && {
+           echo "'$matchline': expected $expect found $matches"
+           return 1
+       }
     done << EOF
     $2
 EOF
@@ -34,74 +34,84 @@ EOF
 echo_i "checking for DNSSEC key coverage issues"
 ret=0
 for dir in [0-9][0-9]-*; do
-        ret=0
-        echo_i "$dir ($n)"
-        kargs= cargs= kmatch= cmatch= kret= cret=0 warn= error= ok=
-        . $dir/expect
-
-        # use policy.conf if available
-        policy=""
-        [ -e "$dir/policy.conf" ] && policy="-c $dir/policy.conf"
-        # run keymgr to update keys
+       ret=0
+       echo_i "$dir ($n)"
+       kargs= cargs= kmatch= cmatch= kret= cret=0 warn= error= ok=
+       . $dir/expect
+
+       # use policy.conf if available
+       policy=""
+       if [ -e "$dir/policy.conf" ]; then
+               policy="-c $dir/policy.conf"
+               if grep -e "-c policy.conf" $dir/expect > /dev/null
+               then
+                       echo_i "fix $dir/expect: multiple policy files"
+                       ret=1
+               fi
+       else
+               policy="-c policy.conf"
+       fi
+
+       # run keymgr to update keys
        if [ "$CYGWIN" ]; then
-            $KEYMGR $policy -K $dir -g `cygpath -w $KEYGEN` -r $RANDFILE \
+           $KEYMGR $policy -K $dir -g `cygpath -w $KEYGEN` -r $RANDFILE \
                -s `cygpath -w $SETTIME` $kargs > keymgr.$n 2>&1
        else
            $KEYMGR $policy -K $dir -g $KEYGEN -r $RANDFILE \
                -s $SETTIME $kargs > keymgr.$n 2>&1
        fi
-        # check that return code matches expectations
-        found=$?
-        if [ $found -ne $kret ]; then
-            echo "keymgr retcode was $found expected $kret"
-            ret=1
-        fi
-
-        # check for matches in keymgr output
-        matchall keymgr.$n "$kmatch" || ret=1
-
-        # now check coverage
-        $COVERAGE -K $dir $cargs > coverage.$n 2>&1
-        # check that return code matches expectations
-        found=$?
-        if [ $found -ne $cret ]; then
-            echo "coverage retcode was $found expected $cret"
-            ret=1
-        fi
-
-        # check for correct number of errors
-        found=`grep ERROR coverage.$n | wc -l`
-        if [ $found -ne $error ]; then
-            echo "error count was $found expected $error"
-            ret=1
-        fi
-
-        # check for correct number of warnings
-        found=`grep WARNING coverage.$n | wc -l`
-        if [ $found -ne $warn ]; then
-            echo "warning count was $found expected $warn"
-            ret=1
-        fi
-
-        # check for correct number of OKs
-        found=`grep "No errors found" coverage.$n | wc -l`
-        if [ $found -ne $ok ]; then
-            echo "good count was $found expected $ok"
-            ret=1
-        fi
-
-        # check for matches in coverage output
-        matchall coverage.$n "$cmatch" || ret=1
-
-        if [ -f $dir/extra.sh ]; then
-           cd $dir
-           . ./extra.sh
-           cd ..
-        fi
-
-        n=`expr $n + 1`
-        if [ $ret != 0 ]; then echo_i "failed"; fi
-        status=`expr $status + $ret`
+       # check that return code matches expectations
+       found=$?
+       if [ $found -ne $kret ]; then
+           echo "keymgr retcode was $found expected $kret"
+           ret=1
+       fi
+
+       # check for matches in keymgr output
+       matchall keymgr.$n "$kmatch" || ret=1
+
+       # now check coverage
+       $COVERAGE -K $dir $cargs > coverage.$n 2>&1
+       # check that return code matches expectations
+       found=$?
+       if [ $found -ne $cret ]; then
+           echo "coverage retcode was $found expected $cret"
+           ret=1
+       fi
+
+       # check for correct number of errors
+       found=`grep ERROR coverage.$n | wc -l`
+       if [ $found -ne $error ]; then
+           echo "error count was $found expected $error"
+           ret=1
+       fi
+
+       # check for correct number of warnings
+       found=`grep WARNING coverage.$n | wc -l`
+       if [ $found -ne $warn ]; then
+           echo "warning count was $found expected $warn"
+           ret=1
+       fi
+
+       # check for correct number of OKs
+       found=`grep "No errors found" coverage.$n | wc -l`
+       if [ $found -ne $ok ]; then
+           echo "good count was $found expected $ok"
+           ret=1
+       fi
+
+       # check for matches in coverage output
+       matchall coverage.$n "$cmatch" || ret=1
+
+       if [ -f $dir/extra.sh ]; then
+          cd $dir
+          . ./extra.sh
+          cd ..
+       fi
+
+       n=`expr $n + 1`
+       if [ $ret != 0 ]; then echo_i "failed"; fi
+       status=`expr $status + $ret`
 done
 
 echo_i "checking domains ending in . ($n)"