From: Michał Kępień Date: Wed, 26 Jan 2022 14:18:43 +0000 (+0100) Subject: Do not strip leading whitespace from test output X-Git-Tag: v9.19.0~144^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb8702211532c4f68f2d180aac23d983d5e17fc7;p=thirdparty%2Fbind9.git Do not strip leading whitespace from test output The echo_*() and cat_*() functions in bin/tests/system/conf.sh.common call the "read" builtin command without specifying the field separator to use. This results in leading whitespace getting stripped from each line of the texts passed to those functions, which mangles e.g. pytest output, hindering test failure troubleshooting. Address by setting IFS to an empty value for the "read" calls used in the aforementioned helper functions. --- diff --git a/bin/tests/system/conf.sh.common b/bin/tests/system/conf.sh.common index 3809d74aa8d..ce7b923b23f 100644 --- a/bin/tests/system/conf.sh.common +++ b/bin/tests/system/conf.sh.common @@ -181,19 +181,19 @@ then printf "${COLOR_END}%s${COLOR_NONE}\n" "$*" } echo_i() { - printf '%s\n' "$*" | while read -r __LINE ; do + printf '%s\n' "$*" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR:$__LINE" done } echo_ic() { - printf '%s\n' "$*" | while read -r __LINE ; do + printf '%s\n' "$*" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR: $__LINE" done } echo_d() { - printf '%s\n' "$*" | while read -r __LINE ; do + printf '%s\n' "$*" | while IFS= read -r __LINE ; do echoinfo "D:$SYSTESTDIR:$__LINE" done } @@ -218,32 +218,32 @@ else } echo_i() { - echo "$@" | while read -r __LINE ; do + echo "$@" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR:$__LINE" done } echo_ic() { - echo "$@" | while read -r __LINE ; do + echo "$@" | while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR: $__LINE" done } echo_d() { - echo "$@" | while read -r __LINE ; do + echo "$@" | while IFS= read -r __LINE ; do echoinfo "D:$SYSTESTDIR:$__LINE" done } fi cat_i() { - while read -r __LINE ; do + while IFS= read -r __LINE ; do echoinfo "I:$SYSTESTDIR:$__LINE" done } cat_d() { - while read -r __LINE ; do + while IFS= read -r __LINE ; do echoinfo "D:$SYSTESTDIR:$__LINE" done }