Commit d25c5e23 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

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: ee2eb063 ("selftests/bpf: Add BPF_CORE_READ and BPF_CORE_READ_STR_INTO macro tests")
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191016060051.2024182-3-andriin@fb.com
parent 0b6e71c3
...@@ -211,8 +211,8 @@ static struct core_reloc_test_case test_cases[] = { ...@@ -211,8 +211,8 @@ static struct core_reloc_test_case test_cases[] = {
.input_len = 0, .input_len = 0,
.output = STRUCT_TO_CHAR_PTR(core_reloc_kernel_output) { .output = STRUCT_TO_CHAR_PTR(core_reloc_kernel_output) {
.valid = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }, .valid = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
.comm = "test_progs\0\0\0\0\0", .comm = "test_progs",
.comm_len = 11, .comm_len = sizeof("test_progs"),
}, },
.output_len = sizeof(struct core_reloc_kernel_output), .output_len = sizeof(struct core_reloc_kernel_output),
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
struct core_reloc_kernel_output { struct core_reloc_kernel_output {
int valid[10]; int valid[10];
char comm[16]; char comm[sizeof("test_progs")];
int comm_len; int comm_len;
}; };
......
...@@ -15,7 +15,8 @@ static volatile struct data { ...@@ -15,7 +15,8 @@ static volatile struct data {
struct core_reloc_kernel_output { struct core_reloc_kernel_output {
int valid[10]; int valid[10];
char comm[16]; /* we have test_progs[-flavor], so cut flavor part */
char comm[sizeof("test_progs")];
int comm_len; int comm_len;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment