selftests/bpf: Test sysctl section name
authorAndrey Ignatov <rdna@fb.com>
Fri, 8 Mar 2019 17:17:45 +0000 (09:17 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 12 Apr 2019 20:54:58 +0000 (13:54 -0700)
Add unit test to verify that program and attach types are properly
identified for "cgroup/sysctl" section name.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_section_names.c

index 7c4f41572b1cfd26f437ab64ba32a798e49efb38..bebd4fbca1f43e7102ec9dd66c0828d3aebfc60a 100644 (file)
@@ -119,6 +119,11 @@ static struct sec_name_test tests[] = {
                {0, BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_CGROUP_UDP6_SENDMSG},
                {0, BPF_CGROUP_UDP6_SENDMSG},
        },
+       {
+               "cgroup/sysctl",
+               {0, BPF_PROG_TYPE_CGROUP_SYSCTL, BPF_CGROUP_SYSCTL},
+               {0, BPF_CGROUP_SYSCTL},
+       },
 };
 
 static int test_prog_type_by_name(const struct sec_name_test *test)