Re: [PATCH net v2 2/2] af_unix: Add test for SCM_INQ on partial read
From: Kuniyuki Iwashima
Date: Sat May 30 2026 - 00:24:02 EST
On Thu, May 28, 2026 at 4:00 AM <jianyu.li@xxxxxxxxxxxx> wrote:
>
> From: Jianyu Li <jianyu.li@xxxxxxxxxxxx>
>
> Add test to verify that when a skb is partially consumed,
> unix_inq_len() return correct remaining byte count.
>
> Before:
>
> # RUN scm_inq.stream.partial_read ...
> # scm_inq.c:165:partial_read:Expected remain (512) == *(int *)CMSG_DATA(cmsg) (768)
> # partial_read: Test terminated by assertion
> # FAIL scm_inq.stream.partial_read
> not ok 2 scm_inq.stream.partial_read
>
> After:
>
> # RUN scm_inq.stream.partial_read ...
> # OK scm_inq.stream.partial_read
> ok 2 scm_inq.stream.partial_read
>
> Signed-off-by: Jianyu Li <jianyu.li@xxxxxxxxxxxx>
> ---
> v2: Follow reverse xmas tree ordering in partial_read test case
> ---
> tools/testing/selftests/net/af_unix/scm_inq.c | 54 ++++++++++++++++++-
> 1 file changed, 52 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/af_unix/scm_inq.c b/tools/testing/selftests/net/af_unix/scm_inq.c
> index 3a86be9bda..49cfa6ef07 100644
> --- a/tools/testing/selftests/net/af_unix/scm_inq.c
> +++ b/tools/testing/selftests/net/af_unix/scm_inq.c
> @@ -8,8 +8,9 @@
>
> #include "kselftest_harness.h"
>
> -#define NR_CHUNKS 100
> -#define MSG_LEN 256
> +#define NR_CHUNKS 100
> +#define MSG_LEN 256
nit: please align the indentation of the above two lines
with the line below.
Sorry, I should've looked closer.
> +#define NR_PARTIAL_READS 3
Otherwise looks good.
Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Thanks