selftests: mptcp: more stable simult_flows tests
authorPaolo Abeni <pabeni@redhat.com>
Fri, 29 Oct 2021 23:55:59 +0000 (16:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:03 +0000 (17:41 +0100)
commitf8c4da198eedef46740e83571a6917a2ae7ff1fc
tree6ab9063b9e2723d29542819ef5fbb5808f59b012
parent1c0efab08c9b7c23fc171b4fb0b01ae04252b865
selftests: mptcp: more stable simult_flows tests

[ Upstream commit b6ab64b074f29b42ff272793806efc913f7cc742 ]

Currently the simult_flows.sh self-tests are not very stable,
especially when running on slow VMs.

The tests measure runtime for transfers on multiple subflows
and check that the time is near the theoretical maximum.

The current test infra introduces a bit of jitter in test
runtime, due to multiple explicit delays. Additionally the
runtime is measured by the shell script wrapper. On a slow
VM, the script overhead is measurable and subject to relevant
jitter.

One solution to make the test more stable would be adding more
slack to the expected time; that could possibly hide real
regressions. Instead move the measurement inside the command
doing the transfer, and drop most unneeded sleeps.

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 3de88b95c4d4 ("selftests: mptcp: fix mibit vs mbit mix up")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_connect.c
tools/testing/selftests/net/mptcp/simult_flows.sh