3 # Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
18 .
$SYSTEMTESTTOP/conf.sh
20 COVERAGE
="$COVERAGE -c ./named-compilezone"
27 echo "$2" |
while read matchline
; do
28 grep "$matchline" $file > /dev
/null
2>&1 ||
{
35 echo "I:checking for DNSSEC key coverage issues"
37 for dir
in [0-9][0-9]-*; do
40 args
= warn
= error
= ok
= retcode
= match
=
42 $COVERAGE $args -K $dir example.com
> coverage.
$n 2>&1
44 # check that return code matches expectations
46 if [ $found -ne $retcode ]; then
47 echo "retcode was $found expected $retcode"
51 # check for correct number of errors
52 found
=`grep ERROR coverage.$n | wc -l`
53 if [ $found -ne $error ]; then
54 echo "error count was $found expected $error"
58 # check for correct number of warnings
59 found
=`grep WARNING coverage.$n | wc -l`
60 if [ $found -ne $warn ]; then
61 echo "warning count was $found expected $warn"
65 # check for correct number of OKs
66 found
=`grep "No errors found" coverage.$n | wc -l`
67 if [ $found -ne $ok ]; then
68 echo "good count was $found expected $ok"
72 found
=`matchall coverage.$n "$match"`
73 if [ "$found" = "FAIL" ]; then
74 echo "no match on '$match'"
79 if [ $ret != 0 ]; then echo "I:failed"; fi
80 status
=`expr $status + $ret`
83 echo "I:exit status: $status"