Commit 3e5329e1 authored by Eduard Zingerman's avatar Eduard Zingerman Committed by Alexei Starovoitov

selftests/bpf: Report program name on parse_test_spec error

Change test_loader.c:run_subtest() behavior to show BPF program name
when test spec for that program can't be parsed.
Signed-off-by: default avatarEduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20230325025524.144043-2-eddyz87@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 496f4f1b
...@@ -232,8 +232,11 @@ void run_subtest(struct test_loader *tester, ...@@ -232,8 +232,11 @@ void run_subtest(struct test_loader *tester,
/* if we can't derive test specification, go to the next test */ /* if we can't derive test specification, go to the next test */
err = parse_test_spec(tester, obj, prog, &spec); err = parse_test_spec(tester, obj, prog, &spec);
if (!ASSERT_OK(err, "parse_test_spec")) if (err) {
PRINT_FAIL("Can't parse test spec for program '%s'\n",
bpf_program__name(prog));
continue; continue;
}
tobj = bpf_object__open_mem(obj_bytes, obj_byte_cnt, &open_opts); tobj = bpf_object__open_mem(obj_bytes, obj_byte_cnt, &open_opts);
if (!ASSERT_OK_PTR(tobj, "obj_open_mem")) /* shouldn't happen */ if (!ASSERT_OK_PTR(tobj, "obj_open_mem")) /* shouldn't happen */
......
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