]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
dnssec-coverage: fix handling of zones without trailing dots
authorTony Finch <dot@dotat.at>
Thu, 7 Feb 2019 19:00:43 +0000 (19:00 +0000)
committerEvan Hunt <each@isc.org>
Fri, 8 Feb 2019 01:33:00 +0000 (17:33 -0800)
After change 5143, zones listed on the command line without trailing
dots were ignored.

(cherry picked from commit a159675f448130daf29670c2b2bbc9edb5e20c09)

bin/python/isc/coverage.py.in
bin/tests/system/coverage/clean.sh
bin/tests/system/coverage/tests.sh

index b6ed5d0a6929137668fc939e3c4a41bbb622fba0..14c00aac0a9df55dba8ddcc6334430e256dde5fd 100644 (file)
@@ -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:
index 253e8aaca5915dec68502d32e58829e77cbbaf1d..9917e2e24f96d98a70ff45e0c62b0a4088c0fbdb 100644 (file)
@@ -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
index f435eb8f0e3401105d8de3e3761b0d6e30819efa..47a45895118ee64b7360ddce875b795a619e1794 100644 (file)
@@ -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