]> xenbits.xensource.com Git - people/aperard/linux.git/commitdiff
selftests: mptcp: print all error messages to stdout
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 8 Mar 2024 22:10:08 +0000 (23:10 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 Mar 2024 22:07:25 +0000 (15:07 -0700)
Some error messages are printed to stderr while the others are printed
to 'stdout'. As part of the unification, this patch drop "1>&2" to let
all errors messages are printed to 'stdout'.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240308-upstream-net-next-20240308-selftests-mptcp-unification-v1-1-4f42c347b653@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_connect.sh
tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

index 0ca2960c909964673cebf08236ffc44414372d38..679e366c8f6b8f2589ccda23104a71e2bd79e12f 100755 (executable)
@@ -294,7 +294,7 @@ do_ping()
        ip netns exec ${connector_ns} ping ${ping_args} $connect_addr >/dev/null || rc=1
 
        if [ $rc -ne 0 ] ; then
-               echo "$listener_ns -> $connect_addr connectivity [ FAIL ]" 1>&2
+               echo "$listener_ns -> $connect_addr connectivity [ FAIL ]"
                ret=1
 
                return 1
@@ -470,13 +470,13 @@ do_transfer()
 
        if [ ${stat_synrx_now_l} -lt ${expect_synrx} ]; then
                printf "[ FAIL ] lower MPC SYN rx (%d) than expected (%d)\n" \
-                       "${stat_synrx_now_l}" "${expect_synrx}" 1>&2
+                       "${stat_synrx_now_l}" "${expect_synrx}"
                retc=1
        fi
        if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} ] && [ ${stat_ooo_now} -eq 0 ]; then
                if [ ${stat_ooo_now} -eq 0 ]; then
                        printf "[ FAIL ] lower MPC ACK rx (%d) than expected (%d)\n" \
-                               "${stat_ackrx_now_l}" "${expect_ackrx}" 1>&2
+                               "${stat_ackrx_now_l}" "${expect_ackrx}"
                        rets=1
                else
                        printf "[ Note ] fallback due to TCP OoO"
@@ -721,7 +721,7 @@ EOF
        ip -net "$listener_ns" route del local $local_addr/0 dev lo table 100
 
        if [ $lret -ne 0 ]; then
-               echo "FAIL: $msg, mptcp connection error" 1>&2
+               echo "FAIL: $msg, mptcp connection error"
                ret=$lret
                return 1
        fi
@@ -810,7 +810,7 @@ log_if_error()
        local msg="$1"
 
        if [ ${ret} -ne 0 ]; then
-               echo "FAIL: ${msg}" 1>&2
+               echo "FAIL: ${msg}"
 
                final_ret=${ret}
                ret=0
index 6ed4aa32222fb303b8180746e3925f208ee54706..7c70b52e63c6c820067f1998611bf1e9685de7a1 100755 (executable)
@@ -103,7 +103,8 @@ check_mark()
        local v
        for v in $values; do
                if [ $v -ne 0 ]; then
-                       echo "FAIL: got $tables $values in ns $ns , not 0 - not all expected packets marked" 1>&2
+                       echo "FAIL: got $tables $values in ns $ns," \
+                            "not 0 - not all expected packets marked"
                        ret=1
                        return 1
                fi
@@ -162,7 +163,7 @@ do_transfer()
        local rets=$?
 
        if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then
-               echo " client exit code $retc, server $rets" 1>&2
+               echo " client exit code $retc, server $rets"
                echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2
                ip netns exec ${listener_ns} ss -Menita 1>&2 -o "sport = :$port"
 
@@ -221,7 +222,7 @@ do_mptcp_sockopt_tests()
        lret=$?
 
        if [ $lret -ne 0 ]; then
-               echo "FAIL: SOL_MPTCP getsockopt" 1>&2
+               echo "FAIL: SOL_MPTCP getsockopt"
                mptcp_lib_result_fail "sockopt v4"
                ret=$lret
                return
@@ -232,7 +233,7 @@ do_mptcp_sockopt_tests()
        lret=$?
 
        if [ $lret -ne 0 ]; then
-               echo "FAIL: SOL_MPTCP getsockopt (ipv6)" 1>&2
+               echo "FAIL: SOL_MPTCP getsockopt (ipv6)"
                mptcp_lib_result_fail "sockopt v6"
                ret=$lret
                return
@@ -263,7 +264,7 @@ do_tcpinq_test()
        local lret=$?
        if [ $lret -ne 0 ];then
                ret=$lret
-               echo "FAIL: mptcp_inq $*" 1>&2
+               echo "FAIL: mptcp_inq $*"
                mptcp_lib_result_fail "TCP_INQ: $*"
                return $lret
        fi