Skip to content

Commit 948abb5

Browse files
committed
Merge branch 'mptcp-test-fixes'
Matthieu Baerts says: ==================== selftests: mptcp: fixes for diag.sh Here are two patches fixing issues in MPTCP diag.sh kselftest: - Patch 1 makes sure the exit code is '1' in case of error, and not the test ID, not to return an exit code that would be wrongly interpreted by the ksefltests framework, e.g. '4' means 'skip'. - Patch 2 avoids waiting for unnecessary conditions, which can cause timeouts in some very slow environments. ==================== Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
2 parents 429679d + f05d228 commit 948abb5

File tree

1 file changed

+6
-9
lines changed
  • tools/testing/selftests/net/mptcp

1 file changed

+6
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ __chk_nr()
6969
else
7070
echo "[ fail ] expected $expected found $nr"
7171
mptcp_lib_result_fail "${msg}"
72-
ret=$test_cnt
72+
ret=${KSFT_FAIL}
7373
fi
7474
else
7575
echo "[ ok ]"
@@ -96,8 +96,8 @@ chk_listener_nr()
9696
local expected=$1
9797
local msg="$2"
9898

99-
__chk_nr "ss -inmlHMON $ns | wc -l" "$expected" "$msg - mptcp" 0
100-
__chk_nr "ss -inmlHtON $ns | wc -l" "$expected" "$msg - subflows"
99+
__chk_nr "ss -nlHMON $ns | wc -l" "$expected" "$msg - mptcp" 0
100+
__chk_nr "ss -nlHtON $ns | wc -l" "$expected" "$msg - subflows"
101101
}
102102

103103
wait_msk_nr()
@@ -124,11 +124,11 @@ wait_msk_nr()
124124
if [ $i -ge $timeout ]; then
125125
echo "[ fail ] timeout while expecting $expected max $max last $nr"
126126
mptcp_lib_result_fail "${msg} # timeout"
127-
ret=$test_cnt
127+
ret=${KSFT_FAIL}
128128
elif [ $nr != $expected ]; then
129129
echo "[ fail ] expected $expected found $nr"
130130
mptcp_lib_result_fail "${msg} # unexpected result"
131-
ret=$test_cnt
131+
ret=${KSFT_FAIL}
132132
else
133133
echo "[ ok ]"
134134
mptcp_lib_result_pass "${msg}"
@@ -304,10 +304,7 @@ for I in $(seq 1 $NR_SERVERS); do
304304
ip netns exec $ns ./mptcp_connect -p $((I + 20001)) \
305305
-t ${timeout_poll} -l 0.0.0.0 >/dev/null 2>&1 &
306306
done
307-
308-
for I in $(seq 1 $NR_SERVERS); do
309-
mptcp_lib_wait_local_port_listen $ns $((I + 20001))
310-
done
307+
mptcp_lib_wait_local_port_listen $ns $((NR_SERVERS + 20001))
311308

312309
chk_listener_nr $NR_SERVERS "many listener sockets"
313310

0 commit comments

Comments
 (0)