netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Baerts <matthieu.baerts@tessares.net>
To: mptcp@lists.linux.dev, Mat Martineau <martineau@kernel.org>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,  Shuah Khan <shuah@kernel.org>,
	Florian Westphal <fw@strlen.de>,
	 Davide Caratti <dcaratti@redhat.com>,
	Christoph Paasch <cpaasch@apple.com>,
	 Geliang Tang <geliangtang@gmail.com>,
	Geliang Tang <geliang.tang@suse.com>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	 Matthieu Baerts <matthieu.baerts@tessares.net>,
	stable@vger.kernel.org
Subject: [PATCH net 09/17] selftests: mptcp: join: skip implicit tests if not supported
Date: Sat, 10 Jun 2023 18:11:44 +0200	[thread overview]
Message-ID: <20230609-upstream-net-20230610-mptcp-selftests-support-old-kernels-part-3-v1-9-2896fe2ee8a3@tessares.net> (raw)
In-Reply-To: <20230609-upstream-net-20230610-mptcp-selftests-support-old-kernels-part-3-v1-0-2896fe2ee8a3@tessares.net>

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

One of them is the support of the implicit endpoints introduced by
commit d045b9eb95a9 ("mptcp: introduce implicit endpoints").

It is possible to look for "mptcp_subflow_send_ack" in kallsyms because
it was needed to introduce the mentioned feature. So we can know in
advance if the feature is supported instead of trying and accepting any
results.

Note that here and in the following commits, we re-do the same check for
each sub-test of the same function for a few reasons. The main one is
not to break the ID assign to each test in order to be able to easily
compare results between different kernel versions. Also, we can still
run a specific test even if it is skipped. Another reason is that it
makes it clear during the review that a specific subtest will be skipped
or not under certain conditions. At the end, it looks OK to call the
exact same helper multiple times: it is not a critical path and it is
the same code that is executed, not really more cases to maintain.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368
Fixes: 69c6ce7b6eca ("selftests: mptcp: add implicit endpoint test case")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 3d4f22fe8f8c..7f860a93527f 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3272,8 +3272,10 @@ userspace_tests()
 
 endpoint_tests()
 {
+	# subflow_rebuild_header is needed to support the implicit flag
 	# userspace pm type prevents add_addr
-	if reset "implicit EP"; then
+	if reset "implicit EP" &&
+	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
 		pm_nl_set_limits $ns1 2 2
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -3293,7 +3295,8 @@ endpoint_tests()
 		kill_tests_wait
 	fi
 
-	if reset "delete and re-add"; then
+	if reset "delete and re-add" &&
+	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
 		pm_nl_set_limits $ns1 1 1
 		pm_nl_set_limits $ns2 1 1
 		pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow

-- 
2.40.1


  parent reply	other threads:[~2023-06-10 16:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10 16:11 [PATCH net 00/17] selftests: mptcp: skip tests not supported by old kernels (part 3) Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 01/17] selftests: mptcp: lib: skip if not below kernel version Matthieu Baerts
2023-06-13  0:00   ` patchwork-bot+netdevbpf
2023-06-10 16:11 ` [PATCH net 02/17] selftests: mptcp: join: use 'iptables-legacy' if available Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 03/17] selftests: mptcp: join: helpers to skip tests Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 04/17] selftests: mptcp: join: skip check if MIB counter not supported Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 05/17] selftests: mptcp: join: skip test if iptables/tc cmds fail Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 06/17] selftests: mptcp: join: support local endpoint being tracked or not Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 07/17] selftests: mptcp: join: skip Fastclose tests if not supported Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 08/17] selftests: mptcp: join: support RM_ADDR for used endpoints or not Matthieu Baerts
2023-06-10 16:11 ` Matthieu Baerts [this message]
2023-06-10 16:11 ` [PATCH net 10/17] selftests: mptcp: join: skip backup if set flag on ID not supported Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 11/17] selftests: mptcp: join: skip fullmesh flag tests if " Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 12/17] selftests: mptcp: join: skip userspace PM " Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 13/17] selftests: mptcp: join: skip fail " Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 14/17] selftests: mptcp: join: skip MPC backups " Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 15/17] selftests: mptcp: join: skip PM listener " Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 16/17] selftests: mptcp: join: uniform listener tests Matthieu Baerts
2023-06-10 16:11 ` [PATCH net 17/17] selftests: mptcp: join: skip mixed tests if not supported Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230609-upstream-net-20230610-mptcp-selftests-support-old-kernels-part-3-v1-9-2896fe2ee8a3@tessares.net \
    --to=matthieu.baerts@tessares.net \
    --cc=bpf@vger.kernel.org \
    --cc=cpaasch@apple.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=geliang.tang@suse.com \
    --cc=geliangtang@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).