[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60f9b887-5b96-2502-e86e-06b08c0bbcd6@huawei.com>
Date: Tue, 8 Nov 2022 11:07:51 +0800
From: wangyufen <wangyufen@...wei.com>
To: Martin KaFai Lau <martin.lau@...ux.dev>, <bpf@...r.kernel.org>
CC: 'Alexei Starovoitov ' <ast@...nel.org>,
'Andrii Nakryiko ' <andrii@...nel.org>,
'Daniel Borkmann ' <daniel@...earbox.net>,
<netdev@...r.kernel.org>, <kernel-team@...a.com>
Subject: Re: [PATCH v2 bpf-next 2/3] selftests/bpf: Fix incorrect ASSERT in
the tcp_hdr_options test
在 2022/11/8 7:04, Martin KaFai Lau 写道:
> From: Martin KaFai Lau <martin.lau@...nel.org>
>
> This patch fixes the incorrect ASSERT test in tcp_hdr_options during
> the CHECK to ASSERT macro cleanup.
>
> Cc: Wang Yufen <wangyufen@...wei.com>
> Fixes: 3082f8cd4ba3 ("selftests/bpf: Convert tcp_hdr_options test to ASSERT_* macros")
> Signed-off-by: Martin KaFai Lau <martin.lau@...nel.org>
> ---
> tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c b/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
> index 617bbce6ef8f..57191773572a 100644
> --- a/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
> +++ b/tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
> @@ -485,7 +485,7 @@ static void misc(void)
> goto check_linum;
>
> ret = read(sk_fds.passive_fd, recv_msg, sizeof(recv_msg));
> - if (ASSERT_EQ(ret, sizeof(send_msg), "read(msg)"))
> + if (!ASSERT_EQ(ret, sizeof(send_msg), "read(msg)"))
> goto check_linum;
> }
>
> @@ -539,7 +539,7 @@ void test_tcp_hdr_options(void)
> goto skel_destroy;
>
> cg_fd = test__join_cgroup(CG_NAME);
> - if (ASSERT_GE(cg_fd, 0, "join_cgroup"))
> + if (!ASSERT_GE(cg_fd, 0, "join_cgroup"))
> goto skel_destroy;
>
> for (i = 0; i < ARRAY_SIZE(tests); i++) {
LGTM. Sorry for the breakage.
Acked-by: Wang Yufen <wangyufen@...wei.com>
Powered by blists - more mailing lists