Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ TEST_FILES = xsk_prereqs.sh $(wildcard progs/btf_dump_test_case_*.c)
# Order correspond to 'make run_tests' order
TEST_PROGS := test_kmod.sh \
test_lirc_mode2.sh \
test_tc_tunnel.sh \
test_tc_edt.sh \
test_xdping.sh \
test_bpftool_build.sh \
Expand Down Expand Up @@ -737,6 +736,7 @@ TRUNNER_EXTRA_SOURCES := test_progs.c \
netlink_helpers.c \
jit_disasm_helpers.c \
io_helpers.c \
tc_helpers.c \
test_loader.c \
xsk.c \
disasm.c \
Expand Down
46 changes: 23 additions & 23 deletions tools/testing/selftests/bpf/prog_tests/tc_links.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "test_tc_link.skel.h"

#include "netlink_helpers.h"
#include "tc_helpers.h"
#include "tcx_helpers.h"

void test_ns_tc_links_basic(void)
{
Expand Down Expand Up @@ -67,7 +67,7 @@ void test_ns_tc_links_basic(void)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -100,7 +100,7 @@ void test_ns_tc_links_basic(void)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -191,7 +191,7 @@ static void test_tc_links_before_target(int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "link_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -248,7 +248,7 @@ static void test_tc_links_before_target(int target)
ASSERT_EQ(optq.prog_ids[4], 0, "prog_ids[4]");
ASSERT_EQ(optq.link_ids[4], 0, "link_ids[4]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -345,7 +345,7 @@ static void test_tc_links_after_target(int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "link_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -402,7 +402,7 @@ static void test_tc_links_after_target(int target)
ASSERT_EQ(optq.prog_ids[4], 0, "prog_ids[4]");
ASSERT_EQ(optq.link_ids[4], 0, "link_ids[4]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -504,7 +504,7 @@ static void test_tc_links_revision_target(int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "prog_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -584,7 +584,7 @@ static void test_tc_chain_classic(int target, bool chain_tc_old)

assert_mprog_count(target, 2);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand All @@ -597,7 +597,7 @@ static void test_tc_chain_classic(int target, bool chain_tc_old)

assert_mprog_count(target, 1);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -708,7 +708,7 @@ static void test_tc_links_replace_target(int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "link_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -779,7 +779,7 @@ static void test_tc_links_replace_target(int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "link_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -807,7 +807,7 @@ static void test_tc_links_replace_target(int target)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -835,7 +835,7 @@ static void test_tc_links_replace_target(int target)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -1247,7 +1247,7 @@ static void test_tc_links_prepend_target(int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "link_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -1302,7 +1302,7 @@ static void test_tc_links_prepend_target(int target)
ASSERT_EQ(optq.prog_ids[4], 0, "prog_ids[4]");
ASSERT_EQ(optq.link_ids[4], 0, "link_ids[4]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -1403,7 +1403,7 @@ static void test_tc_links_append_target(int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "link_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -1458,7 +1458,7 @@ static void test_tc_links_append_target(int target)
ASSERT_EQ(optq.prog_ids[4], 0, "prog_ids[4]");
ASSERT_EQ(optq.link_ids[4], 0, "link_ids[4]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -1628,7 +1628,7 @@ static void test_tc_chain_mixed(int target)

assert_mprog_count(target, 1);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4");
Expand All @@ -1641,7 +1641,7 @@ static void test_tc_chain_mixed(int target)

assert_mprog_count(target, 1);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc4, true, "seen_tc4");
Expand All @@ -1654,7 +1654,7 @@ static void test_tc_chain_mixed(int target)

assert_mprog_count(target, 0);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4");
Expand Down Expand Up @@ -1744,7 +1744,7 @@ static void test_tc_links_ingress(int target, bool chain_tc_old,

assert_mprog_count(target, 2);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand All @@ -1757,7 +1757,7 @@ static void test_tc_links_ingress(int target, bool chain_tc_old,

assert_mprog_count(target, 1);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_OK(system(ping_cmd), ping_cmd);

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down
22 changes: 11 additions & 11 deletions tools/testing/selftests/bpf/prog_tests/tc_netkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "test_tc_link.skel.h"
#include "netlink_helpers.h"
#include "tc_helpers.h"
#include "tcx_helpers.h"

#define NETKIT_HEADROOM 32
#define NETKIT_TAILROOM 8
Expand Down Expand Up @@ -252,7 +252,7 @@ void serial_test_tc_netkit_basic(void)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -285,7 +285,7 @@ void serial_test_tc_netkit_basic(void)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -366,7 +366,7 @@ static void serial_test_tc_netkit_multi_links_target(int mode, int target)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -406,7 +406,7 @@ static void serial_test_tc_netkit_multi_links_target(int mode, int target)
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");
ASSERT_EQ(optq.link_ids[2], 0, "link_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -481,7 +481,7 @@ static void serial_test_tc_netkit_multi_opts_target(int mode, int target)
ASSERT_EQ(optq.prog_ids[0], pid1, "prog_ids[0]");
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -512,7 +512,7 @@ static void serial_test_tc_netkit_multi_opts_target(int mode, int target)
ASSERT_EQ(optq.prog_ids[1], pid1, "prog_ids[1]");
ASSERT_EQ(optq.prog_ids[2], 0, "prog_ids[2]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -616,7 +616,7 @@ void serial_test_tc_netkit_device(void)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1");
Expand Down Expand Up @@ -716,7 +716,7 @@ static void serial_test_tc_netkit_neigh_links_target(int mode, int target)
ASSERT_EQ(optq.prog_ids[1], 0, "prog_ids[1]");
ASSERT_EQ(optq.link_ids[1], 0, "link_ids[1]");

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(__send_icmp(ping_addr_noneigh), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc1, true /* L2: ARP */, "seen_tc1");
Expand Down Expand Up @@ -787,7 +787,7 @@ static void serial_test_tc_netkit_pkt_type_mode(int mode)

move_netkit();

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
skel->bss->set_type = true;
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

Expand Down Expand Up @@ -847,7 +847,7 @@ static void serial_test_tc_netkit_scrub_type(int scrub, bool room)
assert_mprog_count_ifindex(ifindex, BPF_NETKIT_PRIMARY, 1);
assert_mprog_count_ifindex(ifindex, BPF_NETKIT_PEER, 0);

tc_skel_reset_all_seen(skel);
tcx_skel_reset_all_seen(skel);
ASSERT_EQ(send_icmp(), 0, "icmp_pkt");

ASSERT_EQ(skel->bss->seen_tc8, true, "seen_tc8");
Expand Down
Loading
Loading