summaryrefslogtreecommitdiffstats
path: root/bin/tests/system/cds/tests.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 16:41:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 16:41:28 +0000
commit14509ce60103dab695cef4d4f31321bab27ab967 (patch)
tree5959cfb9832b3af242a1ca45d4a1227acae67d87 /bin/tests/system/cds/tests.sh
parentAdding debian version 1:9.18.19-1~deb12u1. (diff)
downloadbind9-14509ce60103dab695cef4d4f31321bab27ab967.tar.xz
bind9-14509ce60103dab695cef4d4f31321bab27ab967.zip
Merging upstream version 1:9.18.24.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/tests/system/cds/tests.sh')
-rw-r--r--bin/tests/system/cds/tests.sh66
1 files changed, 35 insertions, 31 deletions
diff --git a/bin/tests/system/cds/tests.sh b/bin/tests/system/cds/tests.sh
index 2eb092f..0453881 100644
--- a/bin/tests/system/cds/tests.sh
+++ b/bin/tests/system/cds/tests.sh
@@ -18,49 +18,53 @@ set -e
status=0
n=0
fail() {
- echo_i "failed"
- status=$((status + 1))
+ echo_i "failed"
+ status=$((status + 1))
}
runcmd() {
- ("$@" 1> out.$n 2> err.$n; echo $?) || true
+ (
+ "$@" 1>out.$n 2>err.$n
+ echo $?
+ ) || true
}
testcase() {
- n=$((n + 1))
- echo_i "$name ($n)"
- expect=$1
- shift
- result=$(runcmd "$@")
- check_stdout
- check_stderr
- if [ "$expect" -ne "$result" ]; then
- echo_d "exit status does not match $expect"
- fail
- fi
- unset name err out
+ n=$((n + 1))
+ echo_i "$name ($n)"
+ expect=$1
+ shift
+ result=$(runcmd "$@")
+ check_stdout
+ check_stderr
+ if [ "$expect" -ne "$result" ]; then
+ echo_d "exit status does not match $expect"
+ fail
+ fi
+ unset name err out
}
check_stderr() {
- if [ -n "${err:=}" ]; then
- grep -E "$err" err.$n >/dev/null && return 0
- echo_d "stderr did not match '$err'"
- else
- [ -s err.$n ] || return 0
- fi
- cat err.$n | cat_d
- fail
+ if [ -n "${err:=}" ]; then
+ grep -E "$err" err.$n >/dev/null && return 0
+ echo_d "stderr did not match '$err'"
+ else
+ [ -s err.$n ] || return 0
+ fi
+ cat err.$n | cat_d
+ fail
}
check_stdout() {
- diff out.$n "${out:-empty}" >/dev/null && return
- echo_d "stdout did not match '$out'"
- ( echo "wanted"
- cat "$out"
- echo "got"
- cat out.$n
- ) | cat_d
- fail
+ diff out.$n "${out:-empty}" >/dev/null && return
+ echo_d "stdout did not match '$out'"
+ (
+ echo "wanted"
+ cat "$out"
+ echo "got"
+ cat out.$n
+ ) | cat_d
+ fail
}
Z=cds.test