Hi Geliang,
On 17/05/2023 15:57, Geliang Tang wrote:
> Run mptcp sched test in a dedicated netns.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> tools/testing/selftests/bpf/prog_tests/mptcp.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> index 88bef3dff24e..912457da88eb 100644
> --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
> +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> @@ -385,6 +385,7 @@ static void test_bkup(void)
>
> static void test_rr(void)
> {
> + struct nstoken *nstoken = NULL;
> struct mptcp_bpf_rr *rr_skel;
> int server_fd, client_fd;
> struct bpf_link *link;
> @@ -399,7 +400,9 @@ static void test_rr(void)
> return;
> }
>
> - sched_init("subflow", "bpf_rr");
> + nstoken = sched_init("subflow", "bpf_rr");
> + if (!ASSERT_OK_PTR(nstoken, "sched_init:rr"))
Small detail if you have to send a v4: can you add the "bpf_" prefix
like with the others?
sched_init:bpf_rr
Cheers,
Matt
> + goto fail;
> server_fd = start_mptcp_server(AF_INET, ADDR_1, 0, 0);
> client_fd = connect_to_fd(server_fd, 0);
>
> @@ -409,7 +412,8 @@ static void test_rr(void)
>
> close(client_fd);
> close(server_fd);
> - sched_cleanup();
> +fail:
> + cleanup_netns(nstoken);
> bpf_link__destroy(link);
> mptcp_bpf_rr__destroy(rr_skel);
> }
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net