]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
adjust style, match test to other tests
authorEvan Hunt <each@isc.org>
Fri, 8 Feb 2019 00:42:12 +0000 (16:42 -0800)
committerEvan Hunt <each@isc.org>
Fri, 8 Feb 2019 01:33:00 +0000 (17:33 -0800)
(cherry picked from commit 9949163936e22adabf94ea05a9dfed76527cf1a5)

bin/python/isc/coverage.py.in
bin/tests/system/coverage/13-dotted-dotless/expect [new file with mode: 0644]
bin/tests/system/coverage/setup.sh
bin/tests/system/coverage/tests.sh
util/copyrights

index 14c00aac0a9df55dba8ddcc6334430e256dde5fd..fe591431e8249020cde6b978352a48189393e833 100644 (file)
@@ -188,9 +188,9 @@ def parse_args():
     if args.filename and len(args.zone) > 1:
         fatal("ERROR: -f can only be used with one zone.")
 
-    # strip trailing dots
-    args.zone = [x[:-1] if len(x) > 1 and x[-1] == '.' else x
-                 for x in args.zone]
+    # strip trailing dots if any
+    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/13-dotted-dotless/expect b/bin/tests/system/coverage/13-dotted-dotless/expect
new file mode 100644 (file)
index 0000000..5760d29
--- /dev/null
@@ -0,0 +1,7 @@
+args="-z -m2h"
+warn=0
+error=0
+ok=2
+retcode=0
+match=
+zones="one.example. two.example"
index be6e3d8fba80fa9e422b6048789563359a6d7de8..a9852888a93d875193b2e09cb3f9b271d2bfd5e0 100644 (file)
@@ -134,3 +134,8 @@ ksk1=`$KEYGEN -q -K $dir -a rsasha1 -3fk example.com`
 dir=12-ksk-deletion
 ksk1=`$KEYGEN -q -K $dir -f KSK -a 8 -b 2048 -I +40d -D +40d example.com`
 ksk2=`$KEYGEN -q -K $dir -S $ksk1.key example.com`
+
+# Test 13: check names with/without dots at the end
+dir=13-dotted-dotless
+zsk1=`$KEYGEN -q -K $dir -a rsasha256 one.example`
+zsk2=`$KEYGEN -q -K $dir -a rsasha256 two.example`
index 47a45895118ee64b7360ddce875b795a619e1794..7434358558a421495dfa01e9de033afef125a728 100644 (file)
@@ -32,9 +32,9 @@ ret=0
 for dir in [0-9][0-9]-*; do
         ret=0
         echo_i "$dir"
-        args= warn= error= ok= retcode= match=
+        args= warn= error= ok= retcode= match= zones=
         . $dir/expect
-        $COVERAGE $args -K $dir example.com > coverage.$n 2>&1
+        $COVERAGE $args -K $dir ${zones:-example.com} > coverage.$n 2>&1
 
         # check that return code matches expectations
         found=$?
@@ -81,17 +81,5 @@ 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
index 25bdfe87f8a86f06740eca80cc12a262612b4aa4..9fd37187d26f2847b0c2914d7e9652a4675d7f5b 100644 (file)
 ./bin/tests/system/coverage/11-cutoff/README   X       2014,2018,2019
 ./bin/tests/system/coverage/11-cutoff/expect   X       2014,2018,2019
 ./bin/tests/system/coverage/12-ksk-deletion/expect     X       2018,2019
+./bin/tests/system/coverage/13-dotted-dotless/expect   X       2019
 ./bin/tests/system/coverage/clean.sh           SH      2013,2014,2016,2018,2019
 ./bin/tests/system/coverage/prereq.sh          SH      2014,2016,2018,2019
 ./bin/tests/system/coverage/setup.sh           SH      2013,2014,2016,2017,2018,2019