]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Small adjustments to kasp rndc_checkds function
authorMatthijs Mekking <matthijs@isc.org>
Thu, 3 Dec 2020 08:03:21 +0000 (09:03 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 23 Dec 2020 10:56:16 +0000 (11:56 +0100)
Slightly better test output, and only call 'load keys' if the
'rndc checkds' call succeeded.

(cherry picked from commit 756674f6d1e62e4f5eabbb71e80a25974a32783c)

bin/tests/system/kasp/tests.sh

index 9a4573000a82295132210273d3e193b3ff7f02d9..9f53253401f11679d5f949b2dd50b454d44b414c 100644 (file)
@@ -1257,21 +1257,23 @@ rndc_checkds() {
        _keycmd=""
        if [ "${_key}" != "-" ]; then
                _keyid=$(key_get $_key ID)
-               _keycmd="-key ${_keyid}"
+               _keycmd=" -key ${_keyid}"
        fi
 
        _whencmd=""
        if [ "${_when}" != "now" ]; then
-               _whencmd="-when ${_when}"
+               _whencmd=" -when ${_when}"
        fi
 
        n=$((n+1))
-       echo_i "calling rndc dnssec -checkds ${_keycmd} ${_whencmd} ${_what} zone ${_zone} ($n)"
+       echo_i "calling rndc dnssec -checkds${_keycmd}${_whencmd} ${_what} zone ${_zone} in ${_view} ($n)"
        ret=0
 
-       rndccmd $_server dnssec -checkds $_keycmd $_whencmd $_what $_zone in $_view > rndc.dnssec.checkds.out.$_zone.$n || log_error "rndc dnssec -checkds (${_keycmd} ${_whencmd} ${_what} zone ${_zone} failed"
+       rndccmd $_server dnssec -checkds $_keycmd $_whencmd $_what $_zone in $_view > rndc.dnssec.checkds.out.$_zone.$n || log_error "rndc dnssec -checkds${_keycmd}${_whencmd} ${_what} zone ${_zone} failed"
 
-       _loadkeys_on $_server $_dir $_zone || log_error "loadkeys zone ${_zone} failed ($n)"
+       if [ "$ret" -eq 0 ]; then
+                _loadkeys_on $_server $_dir $_zone || log_error "loadkeys zone ${_zone} failed ($n)"
+       fi
 
        test "$ret" -eq 0 || echo_i "failed"
        status=$((status+ret))