diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-10-15 23:00:46 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-10-17 12:15:08 -0700 |
commit | d25c5e23552d54ebb9eea0de0d8cf9b7a7c5535c (patch) | |
tree | 6b657ff5ce821fabe2ef9ceb62d24d16d1796c9f /tools/testing/selftests/bpf/progs | |
parent | 0b6e71c398a947a335622ad52807e500e1b5fefa (diff) |
selftests/bpf: Make CO-RE reloc test impartial to test_progs flavor
test_core_reloc_kernel test captures its own process name and validates
it as part of the test. Given extra "flavors" of test_progs, this break
for anything by default test_progs binary. Fix the test to cut out
flavor part of the process name.
Fixes: ee2eb063d330 ("selftests/bpf: Add BPF_CORE_READ and BPF_CORE_READ_STR_INTO macro tests")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191016060051.2024182-3-andriin@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs')
-rw-r--r-- | tools/testing/selftests/bpf/progs/core_reloc_types.h | 2 | ||||
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/core_reloc_types.h b/tools/testing/selftests/bpf/progs/core_reloc_types.h index ad763ec0ba8f..f5939d9d5c61 100644 --- a/tools/testing/selftests/bpf/progs/core_reloc_types.h +++ b/tools/testing/selftests/bpf/progs/core_reloc_types.h @@ -6,7 +6,7 @@ struct core_reloc_kernel_output { int valid[10]; - char comm[16]; + char comm[sizeof("test_progs")]; int comm_len; }; diff --git a/tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c b/tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c index 50f609618b65..a4b5e0562ed5 100644 --- a/tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c +++ b/tools/testing/selftests/bpf/progs/test_core_reloc_kernel.c @@ -15,7 +15,8 @@ static volatile struct data { struct core_reloc_kernel_output { int valid[10]; - char comm[16]; + /* we have test_progs[-flavor], so cut flavor part */ + char comm[sizeof("test_progs")]; int comm_len; }; |