Skip to contentSkip to conversation

skip test if ip mptcp not support

PATCH In review Geliang Tang 3 participants 6 messages Aug 1, 2024 – Aug 3, 2024

Subsystems (4)
lore
Share & tools
lore

Geliang Tang

author reviewer
#0 lore raw

v2 cover skip test if ip mptcp not support

From: Geliang Tang <[email protected]>

v2:
- printf a log as Matt suggested.
- two more squash-to patches for BPF sched tests.

'ip mptcp' not supported, skip this test.

Geliang Tang (3):
Squash to "selftests/bpf: Add mptcp subflow subtest" Squash to "selftests/bpf: Add bpf scheduler test" Squash to "selftests/bpf: Add bpf_first scheduler & test"

 tools/testing/selftests/bpf/prog_tests/mptcp.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.43.0
author reviewer
#1 lore raw

PATCH v2 1/3 Squash to "selftests/bpf: Add mptcp subflow subtest"

From: Geliang Tang <[email protected]>

Skip the test with test__skip() for systems that do not support "ip mptcp", so that CI can also pass.

---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
tools/testing/selftests/bpf/prog_tests/mptcp.c +6 -5
index 00f63f3f19f4..a6afced3ca82 100644
@@ -357,10 +357,11 @@ static int endpoint_init(char *flags)
 	SYS(fail, "ip -net %s link set dev veth1 up", NS_TEST);
 	SYS(fail, "ip -net %s addr add %s/24 dev veth2", NS_TEST, ADDR_2);
 	SYS(fail, "ip -net %s link set dev veth2 up", NS_TEST);
-	/* It would be better to use  "ip -net %s mptcp endpoint add %s %s",
-	 * but the BPF CI is using an old version of IPRoute (5.5.0).
-	 */
-	SYS(fail, "ip netns exec %s ./mptcp_pm_nl_ctl add %s flags %s", NS_TEST, ADDR_2, flags);
+	if (SYS_NOFAIL("ip -net %s mptcp endpoint add %s %s", NS_TEST, ADDR_2, flags)) {
+		printf("'ip mptcp' not supported, skip this test.\n");
+		test__skip();
+		goto fail;
+	}
 
 	return 0;
 fail:
@@ -435,7 +436,7 @@ static void test_subflow(void)
 	if (!ASSERT_OK_PTR(nstoken, "create_netns: mptcp_subflow"))
 		goto skel_destroy;
 
-	if (!ASSERT_OK(endpoint_init("subflow"), "endpoint_init"))
+	if (endpoint_init("subflow"))
 		goto close_netns;
 
 	run_subflow(skel->data->cc);
Signature · 1 line
2.43.0
author reviewer
#2 lore raw

PATCH v2 2/3 Squash to "selftests/bpf: Add bpf scheduler test"

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

Drop ASSERT_OK() and ASSERT_OK_PTR() since endpoint_init() or sched_init() may fail.

---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/prog_tests/mptcp.c +2 -2
index a6afced3ca82..91bad33b0c72 100644
@@ -457,7 +457,7 @@ static struct nstoken *sched_init(char *flags, char *sched)
 	if (!ASSERT_OK_PTR(nstoken, "create_netns"))
 		return NULL;
 
-	if (!ASSERT_OK(endpoint_init("subflow"), "endpoint_init"))
+	if (endpoint_init("subflow"))
 		goto fail;
 
 	SYS(fail, "ip netns exec %s sysctl -qw net.mptcp.scheduler=%s", NS_TEST, sched);
@@ -519,7 +519,7 @@ static void test_default(void)
 	struct nstoken *nstoken;
 
 	nstoken = sched_init("subflow", "default");
-	if (!ASSERT_OK_PTR(nstoken, "sched_init:default"))
+	if (!nstoken)
 		goto fail;
 
 	send_data_and_verify("default", WITH_DATA, WITH_DATA);
Signature · 1 line
2.43.0
author reviewer
#3 lore raw

PATCH v2 3/3 Squash to "selftests/bpf: Add bpf_first scheduler & test"

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

Drop CHECK() since sched_init() may fail.

---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/mptcp.c +1 -1
index 91bad33b0c72..63722412f847 100644
@@ -546,7 +546,7 @@ static void test_bpf_sched(struct bpf_object *obj, char *sched,
 		return;
 
 	nstoken = sched_init("subflow", strcat(bpf_sched, sched));
-	if (CHECK(!nstoken, sched, "sched_init: %d\n", errno))
+	if (!nstoken)
 		goto fail;
 
 	send_data_and_verify(sched, addr1, addr2);
Signature · 1 line
2.43.0
#4 lore raw
In reply to Geliang Tang

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/10198995225

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/d1d49379e03b
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=875915

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

maintainer
#5 lore raw
In reply to Geliang Tang

Hi Geliang,

Quoted 5 lines · Geliang Tang

From: Geliang Tang <[email protected]>

v2:
- printf a log as Matt suggested.
- two more squash-to patches for BPF sched tests.

Thank you for these patches!

New patches for t/upstream:
- f1f07f5728ba: "squashed" patch 1/3 in "selftests/bpf: Add mptcp subflow subtest"
- a392b2586063: "squashed" patch 2/3 in "selftests/bpf: Add bpf scheduler test"
- bce806fa62f5: "squashed" patch 3/3 in "selftests/bpf: Add bpf_first scheduler & test"
- Results: 2b058d91b960..0c6c6967de4e (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/361e2c420a7b9f54b4f184607a1719080707e497/checks

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.