]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
socket tests: add listener_wakeup
authorGleb Smirnoff <glebius@FreeBSD.org>
Thu, 15 Feb 2024 18:48:44 +0000 (10:48 -0800)
committerGleb Smirnoff <glebius@FreeBSD.org>
Thu, 15 Feb 2024 18:48:44 +0000 (10:48 -0800)
commitbc9107f8c405ce83f47abc915ae95baadb770d6d
treebf77b909557c86ff8acbc280d11c69cdc6f47a9a
parentabe8379b4f244aa12f13a603124eb6b41faabec5
socket tests: add listener_wakeup

This test runs several scenarios when sleep(9) on a listen(2)ing socket is
interrupted by shutdown(2) or by close(2).  What should happen in that
case is not specified, neither is documented.  However, there is certain
behavior that we have and this test makes sure it is preserved.  There is
software that relies on it, see bug 227259.  This test is based on
submission with this bug, bugzilla attachment 192260.

The test checks TCP and unix(4) stream socket behavior and SCTP can be
added easily if needed.

The test passes on FreeBSD 11 to 15.  It won't pass on FreeBSD 10,
although the wakeup behavior of shutdown(2) is the same, but it doesn't
return error.

PR: 227259
tests/sys/kern/Makefile
tests/sys/kern/listener_wakeup.c [new file with mode: 0644]