linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@kernel.org>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	bpf@vger.kernel.org
Cc: alan.maguire@oracle.com, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2 2/2] selftests/bpf: Add test for bpftool map ID printing
Date: Sat, 1 Nov 2025 16:59:24 +0000	[thread overview]
Message-ID: <7db88366-69b3-4b69-bf1f-3453dc95b291@kernel.org> (raw)
In-Reply-To: <20251030210655.3938262-3-harshit.m.mogalapalli@oracle.com>

2025-10-30 14:06 UTC-0700 ~ Harshit Mogalapalli
<harshit.m.mogalapalli@oracle.com>
> Add selftest to check if Map ID is printed on successful creation in
> both plain text and json formats.
> 
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
>  .../testing/selftests/bpf/test_bpftool_map.sh | 36 +++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/test_bpftool_map.sh b/tools/testing/selftests/bpf/test_bpftool_map.sh
> index 515b1df0501e..013a64e96cbf 100755
> --- a/tools/testing/selftests/bpf/test_bpftool_map.sh
> +++ b/tools/testing/selftests/bpf/test_bpftool_map.sh
> @@ -361,6 +361,40 @@ test_map_access_with_btf_list() {
>  	fi
>  }
>  
> +# Function to test map ID printing
> +# Parameters:
> +#   $1: bpftool path
> +#   $2: BPF_DIR
> +test_map_id_printing() {
> +	local bpftool_path="$1"
> +	local bpf_dir="$2"
> +	local test_map_name="test_map_id"
> +	local test_map_path="$bpf_dir/$test_map_name"
> +
> +	local output
> +	output=$("$bpftool_path" map create "$test_map_path" type hash key 4 \
> +		value 8 entries 128 name "$test_map_name")
> +	if echo "$output" | grep -q "Map successfully created with ID:"; then
> +		echo "PASS: Map ID printed in plain text output."
> +	else
> +		echo "FAIL: Map ID not printed in plain text output."
> +		exit 1


Other tests in the file print a message only on failure, without a
"FAIL:" prefix. Could you do the same, for consistency and brevity? Same
for the JSON test.

Thanks,
Quentin

  reply	other threads:[~2025-11-01 16:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30 21:06 [PATCH v2 0/2] Print map ID on successful creation Harshit Mogalapalli
2025-10-30 21:06 ` [PATCH v2 1/2] bpftool: Print map ID upon creation and support JSON output Harshit Mogalapalli
2025-10-31  5:21   ` Yonghong Song
2025-11-01 16:59   ` Quentin Monnet
2025-11-01 18:46     ` Harshit Mogalapalli
2025-10-30 21:06 ` [PATCH v2 2/2] selftests/bpf: Add test for bpftool map ID printing Harshit Mogalapalli
2025-11-01 16:59   ` Quentin Monnet [this message]
2025-11-01 16:59 ` [PATCH v2 0/2] Print map ID on successful creation Quentin Monnet
2025-11-01 19:20   ` Harshit Mogalapalli

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=7db88366-69b3-4b69-bf1f-3453dc95b291@kernel.org \
    --to=qmo@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --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@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).