@@ -531,41 +531,7 @@ skel_destroy: \
}
MPTCP_SCHED_TEST(first, WITH_DATA, WITHOUT_DATA);
-
-static void test_bkup(void)
-{
- struct mptcp_bpf_bkup *bkup_skel;
- int server_fd, client_fd;
- struct nstoken *nstoken;
- struct bpf_link *link;
-
- bkup_skel = mptcp_bpf_bkup__open_and_load();
- if (!ASSERT_OK_PTR(bkup_skel, "bpf_bkup__open_and_load"))
- return;
-
- link = bpf_map__attach_struct_ops(bkup_skel->maps.bkup);
- if (!ASSERT_OK_PTR(link, "bpf_map__attach_struct_ops")) {
- mptcp_bpf_bkup__destroy(bkup_skel);
- return;
- }
-
- nstoken = sched_init("subflow backup", "bpf_bkup");
- if (!ASSERT_OK_PTR(nstoken, "sched_init:bpf_bkup"))
- goto fail;
- server_fd = start_mptcp_server(AF_INET, ADDR_1, PORT_1, 0);
- client_fd = connect_to_fd(server_fd, 0);
-
- send_data(server_fd, client_fd, "bpf_bkup");
- ASSERT_OK(has_bytes_sent(ADDR_1), "has_bytes_sent addr_1");
- ASSERT_GT(has_bytes_sent(ADDR_2), 0, "has_bytes_sent addr_2");
-
- close(client_fd);
- close(server_fd);
-fail:
- cleanup_netns(nstoken);
- bpf_link__destroy(link);
- mptcp_bpf_bkup__destroy(bkup_skel);
-}
+MPTCP_SCHED_TEST(bkup, WITH_DATA, WITHOUT_DATA);
static void test_rr(void)
{
@@ -684,8 +650,7 @@ void test_mptcp(void)
RUN_MPTCP_TEST(mptcpify);
RUN_MPTCP_TEST(default);
RUN_MPTCP_TEST(first);
- if (test__start_subtest("bkup"))
- test_bkup();
+ RUN_MPTCP_TEST(bkup);
if (test__start_subtest("rr"))
test_rr();
if (test__start_subtest("red"))
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2022, SUSE. */
+/* Copyright (c) 2024, Kylin Software */
#include <linux/bpf.h>
#include "bpf_tcp_helpers.h"