tools/testing/selftests/bpf/prog_tests/mptcp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
From: Geliang Tang <tanggeliang@kylinos.cn>
Skip the test with test__skip() for systems that do not
support "ip mptcp", so that CI can also pass.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
tools/testing/selftests/bpf/prog_tests/mptcp.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
index 00f63f3f19f4..ddef8c61360f 100644
--- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
+++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
@@ -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)) {
+ /* "ip mptcp" not support, skip this test. */
+ 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);
--
2.43.0
Hi Geliang, Thank you for the patch! On 25/07/2024 03:58, Geliang Tang wrote: > From: Geliang Tang <tanggeliang@kylinos.cn> > > Skip the test with test__skip() for systems that do not > support "ip mptcp", so that CI can also pass. > > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> > --- > tools/testing/selftests/bpf/prog_tests/mptcp.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c > index 00f63f3f19f4..ddef8c61360f 100644 > --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c > +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c > @@ -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)) { This will silently mark the test as skipped, because stderr will be muted. > + /* "ip mptcp" not support, skip this test. */ Could it be possible to at least print this comment? I can add: fprintf(stderr, "'ip mptcp' not supported, skip this test.\n"); when applying the patch. WDYT? > + 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); Cheers, Matt -- Sponsored by the NGI0 Core fund.
Hi Matt, On Fri, 2024-07-26 at 11:18 +0200, Matthieu Baerts wrote: > Hi Geliang, > > Thank you for the patch! > > On 25/07/2024 03:58, Geliang Tang wrote: > > From: Geliang Tang <tanggeliang@kylinos.cn> > > > > Skip the test with test__skip() for systems that do not > > support "ip mptcp", so that CI can also pass. > > > > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> > > --- > > tools/testing/selftests/bpf/prog_tests/mptcp.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c > > b/tools/testing/selftests/bpf/prog_tests/mptcp.c > > index 00f63f3f19f4..ddef8c61360f 100644 > > --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c > > +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c > > @@ -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)) { > > This will silently mark the test as skipped, because stderr will be > muted. > > > + /* "ip mptcp" not support, skip this test. */ > > Could it be possible to at least print this comment? I can add: > > fprintf(stderr, "'ip mptcp' not supported, skip this test.\n"); > > when applying the patch. WDYT? Martin, BPF maintainer, replied on "[v3 2/3] selftests/bpf: Add mptcp pm_nl_ctl link" recently to suggest us to send a v4 of it, if then, no need to apply this squash-to patch at this moment. Please send a v4 to continue using mptcp pm_nl_ctl. Sorry for the confusion caused. Thanks, -Geliang > > > + 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); > > Cheers, > Matt
Hi Geliang, On 27/07/2024 03:12, Geliang Tang wrote: > Hi Matt, > > On Fri, 2024-07-26 at 11:18 +0200, Matthieu Baerts wrote: >> Hi Geliang, >> >> Thank you for the patch! >> >> On 25/07/2024 03:58, Geliang Tang wrote: >>> From: Geliang Tang <tanggeliang@kylinos.cn> >>> >>> Skip the test with test__skip() for systems that do not >>> support "ip mptcp", so that CI can also pass. >>> >>> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> >>> --- >>> tools/testing/selftests/bpf/prog_tests/mptcp.c | 11 ++++++----- >>> 1 file changed, 6 insertions(+), 5 deletions(-) >>> >>> diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c >>> b/tools/testing/selftests/bpf/prog_tests/mptcp.c >>> index 00f63f3f19f4..ddef8c61360f 100644 >>> --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c >>> +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c >>> @@ -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)) { >> >> This will silently mark the test as skipped, because stderr will be >> muted. >> >>> + /* "ip mptcp" not support, skip this test. */ >> >> Could it be possible to at least print this comment? I can add: >> >> fprintf(stderr, "'ip mptcp' not supported, skip this test.\n"); >> >> when applying the patch. WDYT? > > Martin, BPF maintainer, replied on "[v3 2/3] selftests/bpf: Add mptcp > pm_nl_ctl link" recently to suggest us to send a v4 of it, if then, no > need to apply this squash-to patch at this moment. Please send a v4 to > continue using mptcp pm_nl_ctl. Thank you for this note. The modifications I suggested might require some changes of their CI. I think it should not, but I need to check. In other words, it might take some time. Would it be OK to apply your patch (with the fprintf()) to remove the dependency on mptcp_pm_nl_ctl, and send this first? After or in parallel, I can check what I suggested before. If this modification is accepted, and their CI is still using an old IPRoute version, then we can (re-)add mptcp_pm_nl_ctl. WDYT? > > Sorry for the confusion caused. > > Thanks, > -Geliang > >> >>> + 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); >> >> Cheers, >> Matt > Cheers, Matt -- Sponsored by the NGI0 Core fund.
© 2016 - 2024 Red Hat, Inc.