[PATCH mptcp-next v2] Squash to "selftests/bpf: Add bpf_rr test"

Geliang Tang posted 1 patch 1 year, 1 month ago
Failed in applying to current master (apply log)
tools/testing/selftests/bpf/prog_tests/mptcp.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[PATCH mptcp-next v2] Squash to "selftests/bpf: Add bpf_rr test"
Posted by Geliang Tang 1 year, 1 month ago
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 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
index 6d728edce349..ad1c46b35715 100644
--- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
+++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
@@ -344,7 +344,7 @@ static void test_bkup(char *ns)
 	mptcp_bpf_bkup__destroy(bkup_skel);
 }
 
-static void test_rr(void)
+static void test_rr(char *ns)
 {
 	struct mptcp_bpf_rr *rr_skel;
 	int server_fd, client_fd;
@@ -360,17 +360,17 @@ static void test_rr(void)
 		return;
 	}
 
-	sched_init("subflow", "bpf_rr");
+	sched_init(ns, "subflow", "bpf_rr");
 	server_fd = start_mptcp_server(AF_INET, ADDR_1, 0, 0);
 	client_fd = connect_to_fd(server_fd, 0);
 
 	send_data(server_fd, client_fd);
-	ASSERT_OK(has_bytes_sent(ADDR_1), "has_bytes_sent addr 1");
-	ASSERT_OK(has_bytes_sent(ADDR_2), "has_bytes_sent addr 2");
+	ASSERT_OK(has_bytes_sent(ns, ADDR_1), "has_bytes_sent addr 1");
+	ASSERT_OK(has_bytes_sent(ns, ADDR_2), "has_bytes_sent addr 2");
 
 	close(client_fd);
 	close(server_fd);
-	sched_cleanup();
+	sched_cleanup(ns);
 	bpf_link__destroy(link);
 	mptcp_bpf_rr__destroy(rr_skel);
 }
@@ -396,7 +396,7 @@ void test_mptcp(void)
 	if (test__start_subtest("bkup"))
 		test_bkup(NS_TEST);
 	if (test__start_subtest("rr"))
-		test_rr();
+		test_rr(NS_TEST);
 
 	if (nstoken)
 		close_netns(nstoken);
-- 
2.35.3