linux-kernelorg-stable/tools/testing/selftests/net/af_unix
Sunday Adelodun 45a1cd8346 selftests: af_unix: Add tests for ECONNRESET and EOF semantics
Add selftests to verify and document Linux’s intended behaviour for
UNIX domain sockets (SOCK_STREAM and SOCK_DGRAM) when a peer closes.
The tests verify that:

 1. SOCK_STREAM returns EOF when the peer closes normally.
 2. SOCK_STREAM returns ECONNRESET if the peer closes with unread data.
 3. SOCK_SEQPACKET returns EOF when the peer closes normally.
 4. SOCK_SEQPACKET returns ECONNRESET if the peer closes with unread data.
 5. SOCK_DGRAM does not return ECONNRESET when the peer closes.

This follows up on review feedback suggesting a selftest to clarify
Linux’s semantics.

Suggested-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Sunday Adelodun <adelodunolaoluwa@yahoo.com>
Link: https://patch.msgid.link/20251113112802.44657-1-adelodunolaoluwa@yahoo.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-11-18 11:33:17 +01:00
..
Makefile selftests: af_unix: Add tests for ECONNRESET and EOF semantics 2025-11-18 11:33:17 +01:00
config selftests: net: sort configs 2025-10-06 13:12:59 -07:00
diag_uid.c selftests/net: unix: fix unused variable compiler warning 2023-11-27 18:12:07 -08:00
msg_oob.c selftest: af_unix: Add tests for -ECONNRESET. 2025-06-24 10:10:07 +02:00
scm_inq.c selftest: af_unix: Silence -Wflex-array-member-not-at-end warning for scm_inq.c. 2025-08-12 18:01:53 -07:00
scm_pidfd.c selftest: af_unix: Silence -Wall warning for scm_pid.c. 2025-08-12 18:01:53 -07:00
scm_rights.c selftest: af_unix: Silence -Wflex-array-member-not-at-end warning for scm_rights.c. 2025-08-12 18:01:53 -07:00
unix_connect.c selftests: net: af_unix: Fix a build error of unix_connect.c. 2022-07-20 21:02:15 -07:00
unix_connreset.c selftests: af_unix: Add tests for ECONNRESET and EOF semantics 2025-11-18 11:33:17 +01:00