]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Only report not matching stderr content when we look for it
authorMark Andrews <marka@isc.org>
Tue, 5 Jul 2022 03:01:11 +0000 (13:01 +1000)
committerMark Andrews <marka@isc.org>
Tue, 5 Jul 2022 13:12:22 +0000 (23:12 +1000)
The previous test code could emit "D:cds:stderr did not match ''" rather
that just showing the contents of stderr.  Moved the debug line inside
the if/else block.

Replaced backquotes with $() and $(()) as approriate.

(cherry picked from commit 304d33fb32da4199e832daef027bd9228e4470a3)

bin/tests/system/cds/tests.sh

index d95e6f977ff8bf063c38c95ef9b903199fbfa0e7..81630fcb04469321b061c37739f9b5de4fb5b0bf 100644 (file)
@@ -18,7 +18,7 @@ status=0
 n=0
 fail() {
        echo_i "failed"
-       status=`expr $status + 1`
+       status=$((status + 1))
 }
 
 runcmd() {
@@ -27,11 +27,11 @@ runcmd() {
 }
 
 testcase() {
-       n=`expr $n + 1`
+       n=$((n + 1))
        echo_i "$name ($n)"
        expect=$1
        shift
-       result=`runcmd "$@"`
+       result=$(runcmd "$@")
        check_stdout
        check_stderr
        if [ "$expect" -ne "$result" ]; then
@@ -44,10 +44,10 @@ testcase() {
 check_stderr() {
        if [ -n "${err:=}" ]; then
                egrep "$err" err.$n >/dev/null && return 0
+               echo_d "stderr did not match '$err'"
        else
                [ -s err.$n ] || return 0
        fi
-       echo_d "stderr did not match '$err'"
        cat err.$n | cat_d
        fail
 }