selftests: mptcp: connect: skip if MPTCP is not supported
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Sun, 28 May 2023 17:35:27 +0000 (19:35 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 30 May 2023 11:21:02 +0000 (13:21 +0200)
commitd83013bdf90a7994a474b0e650a7fc94b0d4ded6
treef9ed0a4b873a05b5eaf7e4ada6db96a9787fb39a
parentd328fe87067480cf2bd0b58dab428a98d31dbb7e
selftests: mptcp: connect: skip if MPTCP is not supported

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

A new check is then added to make sure MPTCP is supported. If not, the
test stops and is marked as "skipped". Note that this check can also
mark the test as failed if 'SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES' env
var is set to 1: by doing that, we can make sure a test is not being
skipped by mistake.

A new shared file is added here to be able to re-used the same check in
the different selftests we have.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368
Fixes: 048d19d444be ("mptcp: add basic kselftest for mptcp")
Cc: stable@vger.kernel.org
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/mptcp/Makefile
tools/testing/selftests/net/mptcp/mptcp_connect.sh
tools/testing/selftests/net/mptcp/mptcp_lib.sh [new file with mode: 0644]