Skip to content

Commit

Permalink
selftests: mptcp: join: no extra msg if no counter
Browse files Browse the repository at this point in the history
commit 76a2d83 upstream.

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: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ Conflicts in mptcp_join.sh, because the context is different, but the
  exact same fix can still be applied on the modified lines: adding
  '[ -n "$count" ]', and fixing the indentation. ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
matttbe authored and gregkh committed Sep 8, 2024
1 parent 141d0f0 commit 753427d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1252,13 +1252,13 @@ chk_csum_nr()

printf "%-${nr_blank}s %s" " " "sum"
count=$(get_counter ${ns1} "MPTcpExtDataCsumErr")
if [ "$count" != "$csum_ns1" ]; then
if [ -n "$count" ] && [ "$count" != "$csum_ns1" ]; then
extra_msg="$extra_msg ns1=$count"
fi
if [ -z "$count" ]; then
echo -n "[skip]"
elif { [ "$count" != $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 0 ]; } ||
{ [ "$count" -lt $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 1 ]; }; then
{ [ "$count" -lt $csum_ns1 ] && [ $allow_multi_errors_ns1 -eq 1 ]; }; then
echo "[fail] got $count data checksum error[s] expected $csum_ns1"
fail_test
dump_stats=1
Expand All @@ -1267,13 +1267,13 @@ chk_csum_nr()
fi
echo -n " - csum "
count=$(get_counter ${ns2} "MPTcpExtDataCsumErr")
if [ "$count" != "$csum_ns2" ]; then
if [ -n "$count" ] && [ "$count" != "$csum_ns2" ]; then
extra_msg="$extra_msg ns2=$count"
fi
if [ -z "$count" ]; then
echo -n "[skip]"
elif { [ "$count" != $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 0 ]; } ||
{ [ "$count" -lt $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 1 ]; }; then
{ [ "$count" -lt $csum_ns2 ] && [ $allow_multi_errors_ns2 -eq 1 ]; }; then
echo "[fail] got $count data checksum error[s] expected $csum_ns2"
fail_test
dump_stats=1
Expand Down Expand Up @@ -1315,13 +1315,13 @@ chk_fail_nr()

printf "%-${nr_blank}s %s" " " "ftx"
count=$(get_counter ${ns_tx} "MPTcpExtMPFailTx")
if [ "$count" != "$fail_tx" ]; then
if [ -n "$count" ] && [ "$count" != "$fail_tx" ]; then
extra_msg="$extra_msg,tx=$count"
fi
if [ -z "$count" ]; then
echo -n "[skip]"
elif { [ "$count" != "$fail_tx" ] && [ $allow_tx_lost -eq 0 ]; } ||
{ [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1 ]; }; then
{ [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1 ]; }; then
echo "[fail] got $count MP_FAIL[s] TX expected $fail_tx"
fail_test
dump_stats=1
Expand All @@ -1331,13 +1331,13 @@ chk_fail_nr()

echo -n " - failrx"
count=$(get_counter ${ns_rx} "MPTcpExtMPFailRx")
if [ "$count" != "$fail_rx" ]; then
if [ -n "$count" ] && [ "$count" != "$fail_rx" ]; then
extra_msg="$extra_msg,rx=$count"
fi
if [ -z "$count" ]; then
echo -n "[skip]"
elif { [ "$count" != "$fail_rx" ] && [ $allow_rx_lost -eq 0 ]; } ||
{ [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1 ]; }; then
{ [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1 ]; }; then
echo "[fail] got $count MP_FAIL[s] RX expected $fail_rx"
fail_test
dump_stats=1
Expand Down

0 comments on commit 753427d

Please sign in to comment.