From: Martin KaFai Lau <martin.lau@linux.dev>
To: Geliang Tang <geliang@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Mykola Lysenko <mykolal@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
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@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
Geliang Tang <tanggeliang@kylinos.cn>,
bpf@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf-next v10 06/12] selftests/bpf: Add expect_errno for network_helper_opts
Date: Mon, 8 Jul 2024 13:06:12 -0700 [thread overview]
Message-ID: <35634a5d-7e6e-4ab7-8de1-639f1af5fe5f@linux.dev> (raw)
In-Reply-To: <5bbb91e1270a0d9d51e403847e74912aab95d484.camel@gmail.com>
On 7/8/24 12:15 PM, Eduard Zingerman wrote:
> On Mon, 2024-07-08 at 10:29 +0800, Geliang Tang wrote:
>
> [...]
>
>> diff --git a/tools/testing/selftests/bpf/network_helpers.h b/tools/testing/selftests/bpf/network_helpers.h
>> index fcda6b2333ad..14d161d35248 100644
>> --- a/tools/testing/selftests/bpf/network_helpers.h
>> +++ b/tools/testing/selftests/bpf/network_helpers.h
>> @@ -24,6 +24,7 @@ typedef __u16 __sum16;
>> struct network_helper_opts {
>> int timeout_ms;
>> bool must_fail;
>> + int expect_errno;
>
> I think this option obfuscates actual test cases.
> Each helper that accepts network_helper_opts as a parameter, does
> multiple system calls. It is not obvious which of these calls is
> expected to fail.
+1
Please no. On top of that, handling specific errno is not something that belongs
to the generic network_helpers.c. The individual test should check for the errno
that it expects on the error path.
Is it for make_client()? The caller of make_client can check the errno instead, no?
[ The same goes for the existing "bool must_fail;" but it can be left for a
separate cleanup patch ]
pw-bot: cr
>
>> int proto;
>> /* The backlog argument for listen(), defines the maximum length to which
>> * the queue of pending connections for sockfd may grow.
>
> [...]
next prev parent reply other threads:[~2024-07-08 20:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 2:29 [PATCH bpf-next v10 00/12] use network helpers, part 8 Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 01/12] selftests/bpf: Add backlog for network_helper_opts Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 02/12] selftests/bpf: Use start_server_str in sockmap_ktls Geliang Tang
2024-07-08 8:46 ` Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 03/12] selftests/bpf: Use connect_to_fd_opts " Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 04/12] selftests/bpf: Use make_sockaddr " Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 05/12] selftests/bpf: Add network_helper_opts for connect_fd_to_fd Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 06/12] selftests/bpf: Add expect_errno for network_helper_opts Geliang Tang
2024-07-08 19:15 ` Eduard Zingerman
2024-07-08 20:06 ` Martin KaFai Lau [this message]
2024-07-08 2:29 ` [PATCH bpf-next v10 07/12] selftests/bpf: Set expect_errno for cgroup_skb_sk_lookup Geliang Tang
2024-07-08 21:04 ` Martin KaFai Lau
2024-07-08 2:29 ` [PATCH bpf-next v10 08/12] selftests/bpf: Close fd in error path in drop_on_reuseport Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 09/12] selftests/bpf: Use start_server_str in sk_lookup Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 10/12] selftests/bpf: Use connect_fd_to_fd " Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 11/12] selftests/bpf: Use connect_to_addr " Geliang Tang
2024-07-08 2:29 ` [PATCH bpf-next v10 12/12] selftests/bpf: Drop make_socket " Geliang Tang
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=35634a5d-7e6e-4ab7-8de1-639f1af5fe5f@linux.dev \
--to=martin.lau@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=geliang@kernel.org \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mykolal@fb.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tanggeliang@kylinos.cn \
--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