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) <matttbe@kernel.org>
This commit is contained in:
commit
948abb59eb
@ -69,7 +69,7 @@ __chk_nr()
|
|||||||
else
|
else
|
||||||
echo "[ fail ] expected $expected found $nr"
|
echo "[ fail ] expected $expected found $nr"
|
||||||
mptcp_lib_result_fail "${msg}"
|
mptcp_lib_result_fail "${msg}"
|
||||||
ret=$test_cnt
|
ret=${KSFT_FAIL}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "[ ok ]"
|
echo "[ ok ]"
|
||||||
@ -96,8 +96,8 @@ chk_listener_nr()
|
|||||||
local expected=$1
|
local expected=$1
|
||||||
local msg="$2"
|
local msg="$2"
|
||||||
|
|
||||||
__chk_nr "ss -inmlHMON $ns | wc -l" "$expected" "$msg - mptcp" 0
|
__chk_nr "ss -nlHMON $ns | wc -l" "$expected" "$msg - mptcp" 0
|
||||||
__chk_nr "ss -inmlHtON $ns | wc -l" "$expected" "$msg - subflows"
|
__chk_nr "ss -nlHtON $ns | wc -l" "$expected" "$msg - subflows"
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_msk_nr()
|
wait_msk_nr()
|
||||||
@ -124,11 +124,11 @@ wait_msk_nr()
|
|||||||
if [ $i -ge $timeout ]; then
|
if [ $i -ge $timeout ]; then
|
||||||
echo "[ fail ] timeout while expecting $expected max $max last $nr"
|
echo "[ fail ] timeout while expecting $expected max $max last $nr"
|
||||||
mptcp_lib_result_fail "${msg} # timeout"
|
mptcp_lib_result_fail "${msg} # timeout"
|
||||||
ret=$test_cnt
|
ret=${KSFT_FAIL}
|
||||||
elif [ $nr != $expected ]; then
|
elif [ $nr != $expected ]; then
|
||||||
echo "[ fail ] expected $expected found $nr"
|
echo "[ fail ] expected $expected found $nr"
|
||||||
mptcp_lib_result_fail "${msg} # unexpected result"
|
mptcp_lib_result_fail "${msg} # unexpected result"
|
||||||
ret=$test_cnt
|
ret=${KSFT_FAIL}
|
||||||
else
|
else
|
||||||
echo "[ ok ]"
|
echo "[ ok ]"
|
||||||
mptcp_lib_result_pass "${msg}"
|
mptcp_lib_result_pass "${msg}"
|
||||||
@ -304,10 +304,7 @@ for I in $(seq 1 $NR_SERVERS); do
|
|||||||
ip netns exec $ns ./mptcp_connect -p $((I + 20001)) \
|
ip netns exec $ns ./mptcp_connect -p $((I + 20001)) \
|
||||||
-t ${timeout_poll} -l 0.0.0.0 >/dev/null 2>&1 &
|
-t ${timeout_poll} -l 0.0.0.0 >/dev/null 2>&1 &
|
||||||
done
|
done
|
||||||
|
mptcp_lib_wait_local_port_listen $ns $((NR_SERVERS + 20001))
|
||||||
for I in $(seq 1 $NR_SERVERS); do
|
|
||||||
mptcp_lib_wait_local_port_listen $ns $((I + 20001))
|
|
||||||
done
|
|
||||||
|
|
||||||
chk_listener_nr $NR_SERVERS "many listener sockets"
|
chk_listener_nr $NR_SERVERS "many listener sockets"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user