only use a single policy file when testing.
This commit is contained in:
@@ -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
|
||||
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
|
||||
# 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` \
|
||||
$KEYMGR $policy -K $dir -g `cygpath -w $KEYGEN` \
|
||||
-s `cygpath -w $SETTIME` $kargs > keymgr.$n 2>&1
|
||||
else
|
||||
$KEYMGR $policy -K $dir -g $KEYGEN \
|
||||
-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 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
|
||||
# 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
|
||||
# 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 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 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 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
|
||||
# check for matches in coverage output
|
||||
matchall coverage.$n "$cmatch" || ret=1
|
||||
|
||||
if [ -f $dir/extra.sh ]; then
|
||||
cd $dir
|
||||
. ./extra.sh
|
||||
cd ..
|
||||
fi
|
||||
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`
|
||||
n=`expr $n + 1`
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
done
|
||||
|
||||
echo_i "checking domains ending in . ($n)"
|
||||
|
||||
Reference in New Issue
Block a user