[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <ad4c694cdb5ec78a78956b2b397a6052d4d0ef426eb85769781ce2a0baddf08a@mail.kernel.org>
Date: Wed, 21 Jan 2026 20:50:35 +0000 (UTC)
From: bot+bpf-ci@...nel.org
To: alexis.lothore@...tlin.com,andrii@...nel.org,eddyz87@...il.com,ast@...nel.org,daniel@...earbox.net,martin.lau@...ux.dev,song@...nel.org,yonghong.song@...ux.dev,john.fastabend@...il.com,kpsingh@...nel.org,sdf@...ichev.me,haoluo@...gle.com,jolsa@...nel.org,shuah@...nel.org,qmo@...nel.org
Cc: ebpf@...uxfoundation.org,bastien.curutchet@...tlin.com,thomas.petazzoni@...tlin.com,linux-kernel@...r.kernel.org,bpf@...r.kernel.org,linux-kselftest@...r.kernel.org,alexis.lothore@...tlin.com,ast@...nel.org,andrii@...nel.org,daniel@...earbox.net,martin.lau@...nel.org,eddyz87@...il.com,yonghong.song@...ux.dev,clm@...a.com,ihor.solodrai@...ux.dev
Subject: Re: [PATCH bpf-next v3 2/3] selftests/bpf: convert test_bpftool_metadata.sh into test_progs framework
> diff --git a/tools/testing/selftests/bpf/prog_tests/bpftool_metadata.c b/tools/testing/selftests/bpf/prog_tests/bpftool_metadata.c
> new file mode 100644
> index 000000000000..b5598741a01c
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/bpftool_metadata.c
[ ... ]
> +static void run_test(struct test_desc *test)
> +{
> + int ret;
> + char cmd[MAX_BPFTOOL_CMD_LEN];
> +
> + ret = snprintf(cmd, MAX_BPFTOOL_CMD_LEN, "prog load %s %s",
> + test->bpf_prog, test->bpffs_path);
> + if (!ASSERT_GT(ret, 0, "format prog insert command"))
> + return;
> + ret = run_bpftool_command(cmd);
> + if (!ASSERT_OK(ret, "load program"))
> + return;
> +
> + /* Check output with default format */
> + ret = snprintf(cmd, MAX_BPFTOOL_CMD_LEN, "prog show pinned %s",
> + test->bpffs_path);
> + if (!ASSERT_GT(ret, 0, "format pinned prog check command"))
> + return;
> + ret = get_bpftool_command_output(cmd, output,
> + MAX_BPFTOOL_OUTPUT_LEN);
> + if (ASSERT_OK(ret, "get program info")) {
> + ret = check_metadata(output, test->expected_output,
> + ARRAY_SIZE(test->expected_output));
> + ASSERT_OK(ret, "find metadata");
> + }
> +
> + /* Check output with json format */
> + ret = snprintf(cmd, MAX_BPFTOOL_CMD_LEN, "prog -j show pinned %s",
> + test->bpffs_path);
> + if (!ASSERT_GT(ret, 0, "format pinned prog check command in json"))
> + return;
> + ret = get_bpftool_command_output(cmd, output,
> + MAX_BPFTOOL_OUTPUT_LEN);
> + if (ASSERT_OK(ret, "get program info in json")) {
> + ret = check_metadata(output, test->expected_output_json,
> + ARRAY_SIZE(test->expected_output_json));
> + ASSERT_OK(ret, "find metadata in json");
> + }
> +
> +}
The original shell script also verified the map listing output:
> diff --git a/tools/testing/selftests/bpf/test_bpftool_metadata.sh b/tools/testing/selftests/bpf/test_bpftool_metadata.sh
> deleted file mode 100755
> index b5520692f41b..000000000000
> --- a/tools/testing/selftests/bpf/test_bpftool_metadata.sh
> +++ /dev/null
[ ... ]
> -bpftool prog --json | grep '"metadata":{"a":"foo","b":1}' > /dev/null
> -
> -bpftool map | grep 'metadata.rodata' > /dev/null
[ ... ]
> -bpftool prog --json | grep '"metadata":{"a":"bar","b":2}' > /dev/null
> -
> -bpftool map | grep 'metadata.rodata' > /dev/null
Was the "bpftool map | grep 'metadata.rodata'" check intentionally removed
from the converted test? The original script verified that the metadata map
appeared in bpftool's map listing, which tests a different code path than
the "prog show" commands. If this was dropped on purpose, it might be worth
a comment explaining why; otherwise this appears to be a test coverage
regression.
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21225032840
Powered by blists - more mailing lists