selftests/bpf: test sockopt section name
authorStanislav Fomichev <sdf@google.com>
Thu, 27 Jun 2019 20:38:50 +0000 (13:38 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 27 Jun 2019 22:25:17 +0000 (15:25 -0700)
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>
tools/testing/selftests/bpf/test_section_names.c

index dee2f2eceb0fa1f8fda230888f1c3d065a3a3b82..29833aeaf0de27013d2af3cb4f40930508c65944 100644 (file)
@@ -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)