]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Deduplicate write_sysctl() to test_progs.c
authorYiFei Zhu <zhuyifei@google.com>
Fri, 9 Sep 2022 00:49:40 +0000 (00:49 +0000)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 9 Sep 2022 17:40:45 +0000 (10:40 -0700)
commit294c3d84f3a9d3b045201f532af64e9ead07c624
tree51bf73beda4f03c3931dd87c8fe5a5ea029b19fc
parentc379c0f9d11a18b1bd3d36d01635db96eb25f6b8
selftests/bpf: Deduplicate write_sysctl() to test_progs.c

This helper is needed in multiple tests. Instead of copying it over
and over, better to deduplicate this helper to test_progs.c.

test_progs.c is chosen over testing_helpers.c because of this helper's
use of CHECK / ASSERT_*, and the CHECK was modified to use ASSERT_*
so it does not rely on a duration variable.

Suggested-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Link: https://lore.kernel.org/r/9b4fc9a27bd52f771b657b4c4090fc8d61f3a6b5.1662682323.git.zhuyifei@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c
tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_progs.h