@@ -62,15 +62,15 @@ __chk_nr()
printf "%-50s" "$msg"
if [ $nr != $expected ]; then
if [ $nr = "$skip" ] && ! mptcp_lib_expect_all_features; then
- echo "[ SKIP ] Feature probably not supported"
+ mptcp_lib_print_warn "[ SKIP ] Feature probably not supported"
mptcp_lib_result_skip "${msg}"
else
- echo "[ FAIL ] expected $expected found $nr"
+ mptcp_lib_print_err "[ FAIL ] expected $expected found $nr"
mptcp_lib_result_fail "${msg}"
ret=$test_cnt
fi
else
- echo "[ OK ]"
+ mptcp_lib_print_ok "[ OK ]"
mptcp_lib_result_pass "${msg}"
fi
test_cnt=$((test_cnt+1))
@@ -111,15 +111,15 @@ wait_msk_nr()
printf "%-50s" "$msg"
if [ $i -ge $timeout ]; then
- echo "[ FAIL ] timeout while expecting $expected max $max last $nr"
+ mptcp_lib_print_err "[ FAIL ] timeout while expecting $expected max $max last $nr"
mptcp_lib_result_fail "${msg} # timeout"
ret=$test_cnt
elif [ $nr != $expected ]; then
- echo "[ FAIL ] expected $expected found $nr"
+ mptcp_lib_print_err "[ FAIL ] expected $expected found $nr"
mptcp_lib_result_fail "${msg} # unexpected result"
ret=$test_cnt
else
- echo "[ OK ]"
+ mptcp_lib_print_ok "[ OK ]"
mptcp_lib_result_pass "${msg}"
fi
test_cnt=$((test_cnt+1))
Use mptcp_lib_print_ok(), _warn(), and _err() helpers in script diag.sh to print test results with colors. Having colors helps to quickly identify issues when looking at a long list of output logs and results. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- tools/testing/selftests/net/mptcp/diag.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)