Re: [PATCH bpf-next v10 06/12] selftests/bpf: Add expect_errno for network_helper_opts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[...]





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux