Commit 948abb59 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
parents 429679dc f05d2283
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ __chk_nr()
		else
			echo "[ fail ] expected $expected found $nr"
			mptcp_lib_result_fail "${msg}"
			ret=$test_cnt
			ret=${KSFT_FAIL}
		fi
	else
		echo "[  ok  ]"
@@ -96,8 +96,8 @@ chk_listener_nr()
	local expected=$1
	local msg="$2"

	__chk_nr "ss -inmlHMON $ns | wc -l" "$expected" "$msg - mptcp" 0
	__chk_nr "ss -inmlHtON $ns | wc -l" "$expected" "$msg - subflows"
	__chk_nr "ss -nlHMON $ns | wc -l" "$expected" "$msg - mptcp" 0
	__chk_nr "ss -nlHtON $ns | wc -l" "$expected" "$msg - subflows"
}

wait_msk_nr()
@@ -124,11 +124,11 @@ wait_msk_nr()
	if [ $i -ge $timeout ]; then
		echo "[ fail ] timeout while expecting $expected max $max last $nr"
		mptcp_lib_result_fail "${msg} # timeout"
		ret=$test_cnt
		ret=${KSFT_FAIL}
	elif [ $nr != $expected ]; then
		echo "[ fail ] expected $expected found $nr"
		mptcp_lib_result_fail "${msg} # unexpected result"
		ret=$test_cnt
		ret=${KSFT_FAIL}
	else
		echo "[  ok  ]"
		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)) \
		-t ${timeout_poll} -l 0.0.0.0 >/dev/null 2>&1 &
done

for I in $(seq 1 $NR_SERVERS); do
	mptcp_lib_wait_local_port_listen $ns $((I + 20001))
done
mptcp_lib_wait_local_port_listen $ns $((NR_SERVERS + 20001))

chk_listener_nr $NR_SERVERS "many listener sockets"