From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: <bot+bpf-ci@kernel.org>, <alexis.lothore@bootlin.com>,
<andrii@kernel.org>, <eddyz87@gmail.com>, <ast@kernel.org>,
<daniel@iogearbox.net>, <martin.lau@linux.dev>, <song@kernel.org>,
<yonghong.song@linux.dev>, <john.fastabend@gmail.com>,
<kpsingh@kernel.org>, <sdf@fomichev.me>, <haoluo@google.com>,
<jolsa@kernel.org>, <shuah@kernel.org>, <qmo@kernel.org>
Cc: <ebpf@linuxfoundation.org>, <bastien.curutchet@bootlin.com>,
<thomas.petazzoni@bootlin.com>, <linux-kernel@vger.kernel.org>,
<bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<martin.lau@kernel.org>, <clm@meta.com>,
<ihor.solodrai@linux.dev>
Subject: Re: [PATCH bpf-next v3 2/3] selftests/bpf: convert test_bpftool_metadata.sh into test_progs framework
Date: Thu, 22 Jan 2026 09:06:24 +0100 [thread overview]
Message-ID: <DFUYORZLZEX5.T1T4UT063RRM@bootlin.com> (raw)
In-Reply-To: <ad4c694cdb5ec78a78956b2b397a6052d4d0ef426eb85769781ce2a0baddf08a@mail.kernel.org>
On Wed Jan 21, 2026 at 9:50 PM CET, bot+bpf-ci wrote:
>> 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
The bot is right, I forgot to port this specific check. That will be
added in the next revision.
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-01-22 8:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 20:30 [PATCH bpf-next v3 0/3] selftests/bpf: migrate a few bpftool testing scripts Alexis Lothoré (eBPF Foundation)
2026-01-21 20:31 ` [PATCH bpf-next v3 1/3] bpf/selftests: add a few helpers for bpftool testing Alexis Lothoré (eBPF Foundation)
2026-01-21 20:31 ` [PATCH bpf-next v3 2/3] selftests/bpf: convert test_bpftool_metadata.sh into test_progs framework Alexis Lothoré (eBPF Foundation)
2026-01-21 20:50 ` bot+bpf-ci
2026-01-22 8:06 ` Alexis Lothoré [this message]
2026-01-21 20:31 ` [PATCH bpf-next v3 3/3] selftests/bpf: convert test_bpftool_map_access.sh " Alexis Lothoré (eBPF Foundation)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DFUYORZLZEX5.T1T4UT063RRM@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bastien.curutchet@bootlin.com \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=ebpf@linuxfoundation.org \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=qmo@kernel.org \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.