summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_section_names.c
diff options
context:
space:
mode:
authorStanislav Fomichev2019-06-27 22:38:50 +0200
committerAlexei Starovoitov2019-06-28 00:25:17 +0200
commit47ac90bbce5b9f7c1c600a4c81fcfd78cb674798 (patch)
tree97b9e91c5a9a8ba1aeafa7b4d3d91e60384001de /tools/testing/selftests/bpf/test_section_names.c
parentlibbpf: support sockopt hooks (diff)
downloadkernel-qcow2-linux-47ac90bbce5b9f7c1c600a4c81fcfd78cb674798.tar.gz
kernel-qcow2-linux-47ac90bbce5b9f7c1c600a4c81fcfd78cb674798.tar.xz
kernel-qcow2-linux-47ac90bbce5b9f7c1c600a4c81fcfd78cb674798.zip
selftests/bpf: test sockopt section name
Add tests that make sure libbpf section detection works. Cc: Andrii Nakryiko <andriin@fb.com> Cc: Martin Lau <kafai@fb.com> Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_section_names.c')
-rw-r--r--tools/testing/selftests/bpf/test_section_names.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_section_names.c b/tools/testing/selftests/bpf/test_section_names.c
index dee2f2eceb0f..29833aeaf0de 100644
--- a/tools/testing/selftests/bpf/test_section_names.c
+++ b/tools/testing/selftests/bpf/test_section_names.c
@@ -134,6 +134,16 @@ static struct sec_name_test tests[] = {
{0, BPF_PROG_TYPE_CGROUP_SYSCTL, BPF_CGROUP_SYSCTL},
{0, BPF_CGROUP_SYSCTL},
},
+ {
+ "cgroup/getsockopt",
+ {0, BPF_PROG_TYPE_CGROUP_SOCKOPT, BPF_CGROUP_GETSOCKOPT},
+ {0, BPF_CGROUP_GETSOCKOPT},
+ },
+ {
+ "cgroup/setsockopt",
+ {0, BPF_PROG_TYPE_CGROUP_SOCKOPT, BPF_CGROUP_SETSOCKOPT},
+ {0, BPF_CGROUP_SETSOCKOPT},
+ },
};
static int test_prog_type_by_name(const struct sec_name_test *test)