Skip to content

Commit 76a2d83

Browse files
matttbePaolo Abeni
authored and
Paolo Abeni
committed
selftests: mptcp: join: no extra msg if no counter
The checksum and fail counters might not be available. Then no need to display an extra message with missing info. While at it, fix the indentation around, which is wrong since the same commit. Fixes: 47867f0 ("selftests: mptcp: join: skip check if MIB counter not supported") Cc: [email protected] Reviewed-by: Geliang Tang <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 1c2326f commit 76a2d83

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -1112,26 +1112,26 @@ chk_csum_nr()
11121112

11131113
print_check "sum"
11141114
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtDataCsumErr")
1115-
if [ "$count" != "$csum_ns1" ]; then
1115+
if [ -n "$count" ] && [ "$count" != "$csum_ns1" ]; then
11161116
extra_msg+=" ns1=$count"
11171117
fi
11181118
if [ -z "$count" ]; then
11191119
print_skip
11201120
elif { [ "$count" != $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 0 ]; } ||
1121-
{ [ "$count" -lt $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 1 ]; }; then
1121+
{ [ "$count" -lt $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 1 ]; }; then
11221122
fail_test "got $count data checksum error[s] expected $csum_ns1"
11231123
else
11241124
print_ok
11251125
fi
11261126
print_check "csum"
11271127
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtDataCsumErr")
1128-
if [ "$count" != "$csum_ns2" ]; then
1128+
if [ -n "$count" ] && [ "$count" != "$csum_ns2" ]; then
11291129
extra_msg+=" ns2=$count"
11301130
fi
11311131
if [ -z "$count" ]; then
11321132
print_skip
11331133
elif { [ "$count" != $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 0 ]; } ||
1134-
{ [ "$count" -lt $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 1 ]; }; then
1134+
{ [ "$count" -lt $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 1 ]; }; then
11351135
fail_test "got $count data checksum error[s] expected $csum_ns2"
11361136
else
11371137
print_ok
@@ -1169,27 +1169,27 @@ chk_fail_nr()
11691169

11701170
print_check "ftx"
11711171
count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFailTx")
1172-
if [ "$count" != "$fail_tx" ]; then
1172+
if [ -n "$count" ] && [ "$count" != "$fail_tx" ]; then
11731173
extra_msg+=",tx=$count"
11741174
fi
11751175
if [ -z "$count" ]; then
11761176
print_skip
11771177
elif { [ "$count" != "$fail_tx" ] && [ $allow_tx_lost -eq 0 ]; } ||
1178-
{ [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1 ]; }; then
1178+
{ [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1 ]; }; then
11791179
fail_test "got $count MP_FAIL[s] TX expected $fail_tx"
11801180
else
11811181
print_ok
11821182
fi
11831183

11841184
print_check "failrx"
11851185
count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFailRx")
1186-
if [ "$count" != "$fail_rx" ]; then
1186+
if [ -n "$count" ] && [ "$count" != "$fail_rx" ]; then
11871187
extra_msg+=",rx=$count"
11881188
fi
11891189
if [ -z "$count" ]; then
11901190
print_skip
11911191
elif { [ "$count" != "$fail_rx" ] && [ $allow_rx_lost -eq 0 ]; } ||
1192-
{ [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1 ]; }; then
1192+
{ [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1 ]; }; then
11931193
fail_test "got $count MP_FAIL[s] RX expected $fail_rx"
11941194
else
11951195
print_ok

0 commit comments

Comments
 (0)