summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2021-05-13 17:36:09 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2021-05-19 00:33:40 +0200
commit2341d6bb133d44caeba9fbdc851f8624739a84a2 (patch)
tree868e22ff2f4065407650ebf4881fb100ce234ea4 /tools/testing/selftests/bpf/prog_tests
parentc571bd752e91602f092823b2f1ee685a74d2726c (diff)
downloadlinux-2341d6bb133d44caeba9fbdc851f8624739a84a2.tar.bz2
selftests/bpf: Test for btf_load command.
Improve selftest to check that btf_load is working from bpf program. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210514003623.28033-8-alexei.starovoitov@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/syscall.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/syscall.c b/tools/testing/selftests/bpf/prog_tests/syscall.c
index 1badd37148a1..81e997a69f7a 100644
--- a/tools/testing/selftests/bpf/prog_tests/syscall.c
+++ b/tools/testing/selftests/bpf/prog_tests/syscall.c
@@ -9,6 +9,7 @@ struct args {
int max_entries;
int map_fd;
int prog_fd;
+ int btf_fd;
};
void test_syscall(void)
@@ -49,4 +50,6 @@ cleanup:
close(ctx.prog_fd);
if (ctx.map_fd > 0)
close(ctx.map_fd);
+ if (ctx.btf_fd > 0)
+ close(ctx.btf_fd);
}