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: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20230325025524.144043-2-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Eduard Zingerman
2023-03-25 04:54:42 +02:00
committed by Alexei Starovoitov
parent 496f4f1b0f
commit 3e5329e193
+4 -1
View File
@@ -232,8 +232,11 @@ void run_subtest(struct test_loader *tester,
/* if we can't derive test specification, go to the next test */
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;
}
tobj = bpf_object__open_mem(obj_bytes, obj_byte_cnt, &open_opts);
if (!ASSERT_OK_PTR(tobj, "obj_open_mem")) /* shouldn't happen */