selftests: mptcp: sockopt: skip getsockopt checks if not supported
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Thu, 8 Jun 2023 16:38:52 +0000 (18:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jun 2023 09:12:19 +0000 (11:12 +0200)
commitbfe225dec643652094d3f6ec70ea7c77e429136d
treea9e185d1bb824b6ce9b44b870e74197709b77b51
parent103b4e62de32fcc7a756dd79b94df7c0f4c62148
selftests: mptcp: sockopt: skip getsockopt checks if not supported

commit c6f7eccc519837ebde1d099d9610c4f1d5bd975e upstream.

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

One of them is the getsockopt(SOL_MPTCP) to get info about the MPTCP
connections introduced by commit 55c42fa7fa33 ("mptcp: add MPTCP_INFO
getsockopt") and the following ones.

It is possible to look for "mptcp_diag_fill_info" in kallsyms because
it is introduced by the mentioned feature. So we can know in advance if
the feature is supported and skip the sub-test if not.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368
Fixes: ce9979129a0b ("selftests: mptcp: add mptcp getsockopt test cases")
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_sockopt.sh