Skip to content

Commit 6215df1

Browse files
Geliang Tangkuba-moo
authored andcommitted
selftests: mptcp: print all error messages to stdout
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>
1 parent 0d1a7a8 commit 6215df1

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

tools/testing/selftests/net/mptcp/mptcp_connect.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ do_ping()
294294
ip netns exec ${connector_ns} ping ${ping_args} $connect_addr >/dev/null || rc=1
295295

296296
if [ $rc -ne 0 ] ; then
297-
echo "$listener_ns -> $connect_addr connectivity [ FAIL ]" 1>&2
297+
echo "$listener_ns -> $connect_addr connectivity [ FAIL ]"
298298
ret=1
299299

300300
return 1
@@ -470,13 +470,13 @@ do_transfer()
470470

471471
if [ ${stat_synrx_now_l} -lt ${expect_synrx} ]; then
472472
printf "[ FAIL ] lower MPC SYN rx (%d) than expected (%d)\n" \
473-
"${stat_synrx_now_l}" "${expect_synrx}" 1>&2
473+
"${stat_synrx_now_l}" "${expect_synrx}"
474474
retc=1
475475
fi
476476
if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} ] && [ ${stat_ooo_now} -eq 0 ]; then
477477
if [ ${stat_ooo_now} -eq 0 ]; then
478478
printf "[ FAIL ] lower MPC ACK rx (%d) than expected (%d)\n" \
479-
"${stat_ackrx_now_l}" "${expect_ackrx}" 1>&2
479+
"${stat_ackrx_now_l}" "${expect_ackrx}"
480480
rets=1
481481
else
482482
printf "[ Note ] fallback due to TCP OoO"
@@ -721,7 +721,7 @@ EOF
721721
ip -net "$listener_ns" route del local $local_addr/0 dev lo table 100
722722

723723
if [ $lret -ne 0 ]; then
724-
echo "FAIL: $msg, mptcp connection error" 1>&2
724+
echo "FAIL: $msg, mptcp connection error"
725725
ret=$lret
726726
return 1
727727
fi
@@ -810,7 +810,7 @@ log_if_error()
810810
local msg="$1"
811811

812812
if [ ${ret} -ne 0 ]; then
813-
echo "FAIL: ${msg}" 1>&2
813+
echo "FAIL: ${msg}"
814814

815815
final_ret=${ret}
816816
ret=0

tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ check_mark()
103103
local v
104104
for v in $values; do
105105
if [ $v -ne 0 ]; then
106-
echo "FAIL: got $tables $values in ns $ns , not 0 - not all expected packets marked" 1>&2
106+
echo "FAIL: got $tables $values in ns $ns," \
107+
"not 0 - not all expected packets marked"
107108
ret=1
108109
return 1
109110
fi
@@ -162,7 +163,7 @@ do_transfer()
162163
local rets=$?
163164

164165
if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then
165-
echo " client exit code $retc, server $rets" 1>&2
166+
echo " client exit code $retc, server $rets"
166167
echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2
167168
ip netns exec ${listener_ns} ss -Menita 1>&2 -o "sport = :$port"
168169

@@ -221,7 +222,7 @@ do_mptcp_sockopt_tests()
221222
lret=$?
222223

223224
if [ $lret -ne 0 ]; then
224-
echo "FAIL: SOL_MPTCP getsockopt" 1>&2
225+
echo "FAIL: SOL_MPTCP getsockopt"
225226
mptcp_lib_result_fail "sockopt v4"
226227
ret=$lret
227228
return
@@ -232,7 +233,7 @@ do_mptcp_sockopt_tests()
232233
lret=$?
233234

234235
if [ $lret -ne 0 ]; then
235-
echo "FAIL: SOL_MPTCP getsockopt (ipv6)" 1>&2
236+
echo "FAIL: SOL_MPTCP getsockopt (ipv6)"
236237
mptcp_lib_result_fail "sockopt v6"
237238
ret=$lret
238239
return
@@ -263,7 +264,7 @@ do_tcpinq_test()
263264
local lret=$?
264265
if [ $lret -ne 0 ];then
265266
ret=$lret
266-
echo "FAIL: mptcp_inq $*" 1>&2
267+
echo "FAIL: mptcp_inq $*"
267268
mptcp_lib_result_fail "TCP_INQ: $*"
268269
return $lret
269270
fi

0 commit comments

Comments
 (0)