[master] Make dnssec-verify suggest using -o when appropriate

4679.	[cleanup]	Suggest using -o when dnssec-verify finds a SOA record
			not at top of zone and -o is not used. [RT #45519]
This commit is contained in:
Michał Kępień
2017-08-04 10:45:30 +02:00
parent 00f067539a
commit 877c264edc
3 changed files with 38 additions and 1 deletions

View File

@@ -86,5 +86,22 @@ do
[ $dumpit = 1 ] && cat verify.out.$n
done
n=`expr $n + 1`
echo "I:checking error message when -o is not used and a SOA record not at top of zone is found ($n)"
ret=0
# When -o is not used, origin is set to zone file name, which should cause an error in this case
$VERIFY zones/ksk+zsk.nsec.good > verify.out.$n 2>&1 && ret=1
grep "not at top of zone" verify.out.$n > /dev/null || ret=1
grep "use -o to specify a different zone origin" verify.out.$n > /dev/null || ret=1
[ $ret = 0 ] || failed
n=`expr $n + 1`
echo "I:checking error message when an invalid -o is specified and a SOA record not at top of zone is found ($n)"
ret=0
$VERIFY -o invalid.origin zones/ksk+zsk.nsec.good > verify.out.$n 2>&1 && ret=1
grep "not at top of zone" verify.out.$n > /dev/null || ret=1
grep "use -o to specify a different zone origin" verify.out.$n > /dev/null && ret=1
[ $ret = 0 ] || failed
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1