diff options
author | Matthieu Baerts <matthieu.baerts@tessares.net> | 2023-07-30 11:05:16 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-01 06:11:53 +0300 |
commit | 9466df1a27d55842bec496d3a84e98ee938c31aa (patch) | |
tree | 1d2e0b354976162eb4250dfba318ef27b55954af /tools/testing/selftests/net/mptcp/mptcp_join.sh | |
parent | 03668c65d153579c1725ef439b6676ef3742522e (diff) | |
download | linux-9466df1a27d55842bec496d3a84e98ee938c31aa.tar.xz |
selftests: mptcp: join: colored results
Thanks to the parent commit, it is easy to change the output and add
some colours to help spotting issues.
The colours are not used if stdout is redirected or if NO_COLOR env var
is set to 1 as specified in https://no-color.org.
It is possible to force displaying the colours even if stdout is
redirected by setting this env var:
SELFTESTS_MPTCP_LIB_COLOR_FORCE=1
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Link: https://lore.kernel.org/r/20230730-upstream-net-next-20230728-mptcp-selftests-misc-v1-2-7e9cc530a9cd@tessares.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/mptcp/mptcp_join.sh')
-rwxr-xr-x | tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 6da3a6c98ba7..136d20641fce 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -215,22 +215,22 @@ print_info() # It can be empty, no need to print anything then [ -z "${1}" ] && return - printf "%-${nr_blank}sInfo: %s\n" " " "${*}" + mptcp_lib_print_info " Info: ${*}" } print_ok() { - echo "[ ok ]${1:+ ${*}}" + mptcp_lib_print_ok "[ ok ]${1:+ ${*}}" } print_fail() { - echo "[fail]${1:+ ${*}}" + mptcp_lib_print_err "[fail]${1:+ ${*}}" } print_skip() { - echo "[skip]${1:+ ${*}}" + mptcp_lib_print_warn "[skip]${1:+ ${*}}" } # [ $1: fail msg ] |