From: Tony Finch Date: Thu, 7 Feb 2019 19:00:43 +0000 (+0000) Subject: dnssec-coverage: fix handling of zones without trailing dots X-Git-Tag: v9.12.4rc1~21^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b4c9c398123b74a784a44c8ae13e7a92da845a3;p=thirdparty%2Fbind9.git dnssec-coverage: fix handling of zones without trailing dots After change 5143, zones listed on the command line without trailing dots were ignored. (cherry picked from commit a159675f448130daf29670c2b2bbc9edb5e20c09) --- diff --git a/bin/python/isc/coverage.py.in b/bin/python/isc/coverage.py.in index b6ed5d0a692..14c00aac0a9 100644 --- a/bin/python/isc/coverage.py.in +++ b/bin/python/isc/coverage.py.in @@ -189,7 +189,8 @@ def parse_args(): fatal("ERROR: -f can only be used with one zone.") # strip trailing dots - args.zone = [x[:-1] for x in args.zone if len(x) > 1 and x[-1] == '.'] + args.zone = [x[:-1] if len(x) > 1 and x[-1] == '.' else x + for x in args.zone] # convert from time arguments to seconds try: diff --git a/bin/tests/system/coverage/clean.sh b/bin/tests/system/coverage/clean.sh index 253e8aaca59..9917e2e24f9 100644 --- a/bin/tests/system/coverage/clean.sh +++ b/bin/tests/system/coverage/clean.sh @@ -13,4 +13,5 @@ rm -f named-compilezone rm -f */K*.key rm -f */K*.private rm -rf coverage.* +rm -rf dotted-dotless rm -f ns*/named.lock diff --git a/bin/tests/system/coverage/tests.sh b/bin/tests/system/coverage/tests.sh index f435eb8f0e3..47a45895118 100644 --- a/bin/tests/system/coverage/tests.sh +++ b/bin/tests/system/coverage/tests.sh @@ -81,5 +81,17 @@ for dir in [0-9][0-9]-*; do status=`expr $status + $ret` done +dir=dotted-dotless +[ -d $dir ] || mkdir $dir +echo_i "$dir" +zsk1=`$KEYGEN -q -K $dir -a rsasha256 one.example` +zsk2=`$KEYGEN -q -K $dir -a rsasha256 two.example` +$COVERAGE -K $dir one.example. two.example > coverage.$n 2>&1 +grep one.example coverage.$n >/dev/null 2>&1 || ret=1 +grep two.example coverage.$n >/dev/null 2>&1 || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1