@@ -230,7 +230,7 @@ do_mptcp_sockopt_tests()
local lret=0
if ! mptcp_lib_kallsyms_has "mptcp_diag_fill_info$"; then
- echo "INFO: MPTCP sockopt not supported: SKIP"
+ mptcp_lib_print_warn "INFO: MPTCP sockopt not supported: SKIP"
mptcp_lib_result_skip "sockopt"
return
fi
@@ -240,7 +240,7 @@ do_mptcp_sockopt_tests()
printf "%-25s %35s" "sockopt v4" " "
if [ $lret -ne 0 ]; then
- echo "FAIL: SOL_MPTCP getsockopt" 1>&2
+ mptcp_lib_print_err "[ FAIL ] SOL_MPTCP getsockopt"
mptcp_lib_result_fail "sockopt v4"
ret=$lret
return
@@ -253,7 +253,7 @@ do_mptcp_sockopt_tests()
printf "%-25s %35s" "sockopt v6" " "
if [ $lret -ne 0 ]; then
- echo "FAIL: SOL_MPTCP getsockopt (ipv6)" 1>&2
+ mptcp_lib_print_err "[ FAIL] SOL_MPTCP getsockopt (ipv6)"
mptcp_lib_result_fail "sockopt v6"
ret=$lret
return
@@ -286,13 +286,13 @@ do_tcpinq_test()
local lret=$?
if [ $lret -ne 0 ];then
ret=$lret
- echo "FAIL: mptcp_inq $@" 1>&2
+ mptcp_lib_print_err "[ FAIL ] mptcp_inq $@"
mptcp_lib_result_fail "TCP_INQ: $*"
return $lret
fi
mptcp_lib_print_ok "[ OK ]"
- echo "PASS: TCP_INQ cmsg/ioctl $@"
+ mptcp_lib_print_info "PASS: TCP_INQ cmsg/ioctl $@"
mptcp_lib_result_pass "TCP_INQ: $*"
return $lret
}
@@ -302,7 +302,7 @@ do_tcpinq_tests()
local lret=0
if ! mptcp_lib_kallsyms_has "mptcp_ioctl$"; then
- echo "INFO: TCP_INQ not supported: SKIP"
+ mptcp_lib_print_warn "INFO: TCP_INQ not supported: SKIP"
mptcp_lib_result_skip "TCP_INQ"
return
fi
@@ -339,12 +339,12 @@ run_tests $ns1 $ns2 10.0.1.1
run_tests $ns1 $ns2 dead:beef:1::1
if [ $ret -eq 0 ];then
- echo "PASS: all packets had packet mark set"
+ mptcp_lib_print_info "PASS: all packets had packet mark set"
fi
do_mptcp_sockopt_tests
if [ $ret -eq 0 ];then
- echo "PASS: SOL_MPTCP getsockopt has expected information"
+ mptcp_lib_print_info "PASS: SOL_MPTCP getsockopt has expected information"
fi
do_tcpinq_tests
Use mptcp_lib_print_info(), _warn() and _err() helpers in script mptcp_sockopt.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> --- .../testing/selftests/net/mptcp/mptcp_sockopt.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)