]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: mptcp: join: skip test if iptables/tc cmds fail
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Sat, 10 Jun 2023 16:11:40 +0000 (18:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jun 2023 09:14:02 +0000 (11:14 +0200)
commit76cede8594b154b1123a521727c7223752d6a844
treee5fa9bfd546c12eea151e9c292d605d5d517b5e0
parent041c1e5388e816fc36b1fd4025566b95edc8ed0a
selftests: mptcp: join: skip test if iptables/tc cmds fail

commit 4a0b866a3f7d3c22033f40e93e94befc6fe51bce upstream.

Selftests are supposed to run on any kernels, including the old ones not
supporting all MPTCP features.

Some tests are using IPTables and/or TC commands to force some
behaviours. If one of these commands fails -- likely because some
features are not available due to missing kernel config -- we should
intercept the error and skip the tests requiring these features.

Note that if we expect to have these features available and if
SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES env var is set to 1, the tests
will be marked as failed instead of skipped.

This patch also replaces the 'exit 1' by 'return 1' not to stop the
selftest in the middle without the conclusion if there is an issue with
NF or TC.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368
Fixes: 8d014eaa9254 ("selftests: mptcp: add ADD_ADDR timeout test case")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/mptcp/mptcp_join.sh