From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 395511DB34C; Sat, 1 Nov 2025 16:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762016370; cv=none; b=lUSeJrpYkyheyRfzc/XqiTXu2iPn1QPWO7U0nwzl3z0nboOMee2FX8TjHNg6hkJSr6iy6BV6lJiTCbCJwXcKbGO8yjE84cQdgVBap1hMpVLCvw7YOmikx26EYZTS7LOBKyQnACcUpnSpXGIkTAFIrHa6U/vCdR9LqXwm6+/H+Vg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762016370; c=relaxed/simple; bh=c/QNy1CINC/+bHH4T8XLMHsp9R/UI4aM9zE23cc5cTE=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=Rta+lKoqQkkAWEsIfLJ2E9Ga1Dq4BmWWCxYuryJaTFcBVIrOyOXRwcyQoIq0Koc0Bgz//l3Z4cVNQIWqB2lvvnEpR2LPS0ASu8OtUnnUZLeUQ53V7YiP6HNNLuWmz7EJZysh2qOw12MKrXAjcempC4tM2HyGfDPNzs3bE1uOFkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=koDFtNPy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="koDFtNPy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A58E0C4CEF1; Sat, 1 Nov 2025 16:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762016370; bh=c/QNy1CINC/+bHH4T8XLMHsp9R/UI4aM9zE23cc5cTE=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=koDFtNPyduJ5SQEQxzsUy+uv7vnLEOAIq96Pjn00jSqzlwOmwbe/cBDMwdKFfPRh4 bNGIJ8026w7rmzXmRV41wRZSG8QlKnrHKp/JPtPYArnyDHB30yvz4yM9l+eRGX6S/+ ga9snnZfYuorxDi+0/hnNOaZ/a3D+qO7h2NRly4eSxcBzR3Rs2p7SANM36GCArNzkV V8udXyhdb4CgwIQdNf3rwdQ7ay/aUNtG4q3PLE+8gKyUMcMuRZiAqHXbJx1K2lu8tu nyjToKf0MMiR8bVwOtFc5w89zWBLHK8MxocsdYaENVn2VNMwgkOwYZOodljfrE83Dh ycbBqHo/DO0Ig== Message-ID: <7db88366-69b3-4b69-bf1f-3453dc95b291@kernel.org> Date: Sat, 1 Nov 2025 16:59:24 +0000 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Quentin Monnet Subject: Re: [PATCH v2 2/2] selftests/bpf: Add test for bpftool map ID printing To: Harshit Mogalapalli , bpf@vger.kernel.org Cc: alan.maguire@oracle.com, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20251030210655.3938262-1-harshit.m.mogalapalli@oracle.com> <20251030210655.3938262-3-harshit.m.mogalapalli@oracle.com> Content-Language: en-GB In-Reply-To: <20251030210655.3938262-3-harshit.m.mogalapalli@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 2025-10-30 14:06 UTC-0700 ~ Harshit Mogalapalli > Add selftest to check if Map ID is printed on successful creation in > both plain text and json formats. > > Signed-off-by: Harshit Mogalapalli > --- > .../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