Repository navigation
testing/nettest: Add a TCP case with an answer after a half-close. - #4105
Merged
Merged
Conversation
Contributor
|
Points to raise:
Verdict: I'd ask for the window check in commit 2 before approving 22144. Everything else there is nits plus the Impact note. 4105 can be approved once the dependency question is answered and 22144 has merged. |
xiaoxiang781216
previously approved these changes
Nov 22, 2026
casaroli
force-pushed
the
tcp-input-fixes-test-up
branch
from
November 22, 2026 17:48
469498c to
fe99fc4
Compare
test_tcp_halfclose_answer: over 127.0.0.1 the client sends 100 bytes and calls shutdown(SHUT_WR); the server reads them and end-of-file, then a thread sends a 16 KiB answer and closes the socket. The client must read the whole answer, in order, then end-of-file, within 10 seconds. The case does not use the loopback server of the group. It needs CONFIG_NET_SOCKOPTS. On nuttx master the client sends each segment of the answer back after its FIN, and it does not get the end of the answer. In a flat build with one CPU the case fails after 10 s. With 4 CPUs the loopback work thread can stay in one poll of the device, with the device locked: then recv() of the client waits for that lock, the case does not end and nsh does not come back. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli
force-pushed
the
tcp-input-fixes-test-up
branch
from
November 22, 2026 22:28
fe99fc4 to
afd955c
Compare
Contributor
Author
|
cederom
approved these changes
Nov 23, 2026
casaroli
marked this pull request as ready for review
November 23, 2026 12:02
xiaoxiang781216
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new case of
cmocka_net_tcp,test_tcp_halfclose_answer: over the loopback address, a client sends a 100-byte request, callsshutdown(SHUT_WR)and reads a 16 KiB answer to its end. The server reads the request to the end of file, sends the answer and closes. The client must get all the answer and then end of file within 10 s.On NuttX master the client sends each segment of the answer back after its FIN, and the transfer never ends; apache/nuttx#22144 fixes it (its first fix). The other fixes of apache/nuttx#22144 have TUN cases (
test_tun_tcp_ackahead,_wndedge,_synrto,_connect_sndtimeo); they build on the TUN test of #4101 and come when it merges.Impact
Only
testing/nettest/tcp: one new source file, built withCONFIG_NET_IPv4, and its lines inMakefileandCMakeLists.txt. No new Kconfig option. The case has its own listener on a free port: it does not use the loopback server of the group.Testing
qemu-armv8a under HVF, TCP write buffers, NuttX master c51b1af1ee2:
recv()of the client waits for that lockAll other cases of
cmocka_net_tcpgive the same result on both, except flat nshtest_tcp_reset_send, which fails on both (theSIGPIPEgoes to another thread).tools/checkpatch.sh -c -u -m -gpasses.