diff --git a/patches.kernel.org/6.2.12-125-selftests-mptcp-userspace-pm-uniform-verify-ev.patch b/patches.kernel.org/6.2.12-125-selftests-mptcp-userspace-pm-uniform-verify-ev.patch new file mode 100644 index 0000000..c271af3 --- /dev/null +++ b/patches.kernel.org/6.2.12-125-selftests-mptcp-userspace-pm-uniform-verify-ev.patch @@ -0,0 +1,58 @@ +From: Matthieu Baerts +Date: Tue, 11 Apr 2023 22:42:12 +0200 +Subject: [PATCH] selftests: mptcp: userspace pm: uniform verify events +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: 711ae788cbbb82818531b55e32b09518ee09a11a + +commit 711ae788cbbb82818531b55e32b09518ee09a11a upstream. + +Simply adding a "sleep" before checking something is usually not a good +idea because the time that has been picked can not be enough or too +much. The best is to wait for events with a timeout. + +In this selftest, 'sleep 0.5' is used more than 40 times. It is always +used before calling a 'verify_*' function except for this +verify_listener_events which has been added later. + +At the end, using all these 'sleep 0.5' seems to work: the slow CIs +don't complain so far. Also because it doesn't take too much time, we +can just add two more 'sleep 0.5' to uniform what is done before calling +a 'verify_*' function. For the same reasons, we can also delay a bigger +refactoring to replace all these 'sleep 0.5' by functions waiting for +events instead of waiting for a fix time and hope for the best. + +Fixes: 6c73008aa301 ("selftests: mptcp: listener test for userspace PM") +Cc: stable@vger.kernel.org +Suggested-by: Paolo Abeni +Signed-off-by: Matthieu Baerts +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + tools/testing/selftests/net/mptcp/userspace_pm.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh +index ab2d581f..c61f3aea 100755 +--- a/tools/testing/selftests/net/mptcp/userspace_pm.sh ++++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh +@@ -884,6 +884,7 @@ test_listener() + $client4_port > /dev/null 2>&1 & + local listener_pid=$! + ++ sleep 0.5 + verify_listener_events $client_evts $LISTENER_CREATED $AF_INET 10.0.2.2 $client4_port + + # ADD_ADDR from client to server machine reusing the subflow port +@@ -899,6 +900,7 @@ test_listener() + # Delete the listener from the client ns, if one was created + kill_wait $listener_pid + ++ sleep 0.5 + verify_listener_events $client_evts $LISTENER_CLOSED $AF_INET 10.0.2.2 $client4_port + } + +-- +2.35.3 + diff --git a/series.conf b/series.conf index 80ac67a..7eeda6e 100644 --- a/series.conf +++ b/series.conf @@ -2352,6 +2352,7 @@ patches.kernel.org/6.2.12-122-mptcp-use-mptcp_schedule_work-instead-of-open-.patch patches.kernel.org/6.2.12-123-mptcp-stricter-state-check-in-mptcp_worker.patch patches.kernel.org/6.2.12-124-mptcp-fix-NULL-pointer-dereference-on-fastopen.patch + patches.kernel.org/6.2.12-125-selftests-mptcp-userspace-pm-uniform-verify-ev.patch ######################################################## # Build fixes that apply to the vanilla kernel too.