Commit 47eae080 authored by Zijian Zhang's avatar Zijian Zhang Committed by Martin KaFai Lau
Browse files

selftests/bpf: Add more tests for test_txmsg_push_pop in test_sockmap



Add more tests for test_txmsg_push_pop in test_sockmap for better coverage

Signed-off-by: default avatarZijian Zhang <zijianzhang@bytedance.com>
Reviewed-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20241106222520.527076-6-zijianzhang@bytedance.com


Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
parent 862087c3
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -1795,12 +1795,49 @@ static void test_txmsg_push(int cgrp, struct sockmap_options *opt)

static void test_txmsg_push_pop(int cgrp, struct sockmap_options *opt)
{
	/* Test push/pop range overlapping */
	txmsg_pass = 1;
	txmsg_start_push = 1;
	txmsg_end_push = 10;
	txmsg_start_pop = 5;
	txmsg_pop = 4;
	test_send_large(opt, cgrp);

	txmsg_pass = 1;
	txmsg_start_push = 1;
	txmsg_end_push = 10;
	txmsg_start_pop = 5;
	txmsg_pop = 16;
	test_send_large(opt, cgrp);

	txmsg_pass = 1;
	txmsg_start_push = 5;
	txmsg_end_push = 4;
	txmsg_start_pop = 1;
	txmsg_pop = 10;
	test_send_large(opt, cgrp);

	txmsg_pass = 1;
	txmsg_start_push = 5;
	txmsg_end_push = 16;
	txmsg_start_pop = 1;
	txmsg_pop = 10;
	test_send_large(opt, cgrp);

	/* Test push/pop range non-overlapping */
	txmsg_pass = 1;
	txmsg_start_push = 1;
	txmsg_end_push = 10;
	txmsg_start_pop = 16;
	txmsg_pop = 4;
	test_send_large(opt, cgrp);

	txmsg_pass = 1;
	txmsg_start_push = 16;
	txmsg_end_push = 10;
	txmsg_start_pop = 5;
	txmsg_pop = 4;
	test_send_large(opt, cgrp);
}

static void test_txmsg_apply(int cgrp, struct sockmap_options *opt)