casaroli opened a new pull request, #4106:
URL: https://github.com/apache/nuttx-apps/pull/4106
## Summary
depends-on: apache/nuttx/pull/22145
New cases of `cmocka_net_tcp` for the fixes of apache/nuttx#22145, on the
IPv4 loopback address:
- `test_tcp_backlog_relisten_rst`: client A connects to a listener of
backlog 4 and nobody accepts it. `listen()` again gives a backlog of 1, then A
resets its connection (`SO_LINGER` {1, 0}). The `connect()` of client C must
end within 2 s. 10 rounds. Needs `CONFIG_NET_SOLINGER`.
- `test_tcp_backlog_relisten_race`: 50 rounds of a listener of backlog 8, 6
clients that connect at once, `listen()` again with a backlog of 1 while they
connect, and the close of the listener. Two more clients keep the loopback
input busy.
- `test_tcp_backlog_close_race`: the same with 4 clients and the close of
the listener while their handshakes run.
- `test_tcp_procfs_many`: 300 connections that the client closes first (they
stay in TIME_WAIT), then a read of `/proc/net/tcp` to its end in 1 KiB parts.
The read must end within 8192 lines and list each connection of the case's
listener once (300 to 600 lines with its port). Connections that the earlier
cases leave in TIME_WAIT are not counted. Needs procfs,
`CONFIG_NET_TCP_ALLOC_CONNS` > 0 and `CONFIG_NET_ALLOC_DEVIF_CALLBACKS` > 0.
Every socket has a 10 s send and receive timeout. A kernel with the
lock-order bug stops the network in the race cases.
## Impact
Only `testing/nettest/tcp`: two new source files (`test_tcp_backlog.c`,
`test_tcp_procfs.c`, built with `CONFIG_NET_IPv4`) and their lines in
`Makefile` and `CMakeLists.txt`. No new Kconfig option.
## Testing
qemu-armv8a:knsh under HVF, 4 CPUs, TCP over the loopback device,
`NET_TCPBACKLOG`, `NET_SOLINGER`, dynamic connections and devif callbacks:
| Case | NuttX master | with apache/nuttx#22145 |
|---|---|---|
| `test_tcp_backlog_relisten_rst` | FAIL | PASS |
| `test_tcp_backlog_relisten_race` | the network stops (the close of the
listener waits for the device lock with the list lock held) | PASS |
| `test_tcp_backlog_close_race` | (not reached) | PASS |
| `test_tcp_procfs_many` | FAIL: "8193 lines, 8004 of the listener, 7750
more than once" (the read starts again from the head) | PASS: "318 lines, 300
of the listener, 0 more than once" |
Run again on NuttX master 5814b404c95 and with apache/nuttx#22145, knsh and
flat nsh with 4 CPUs, all cases in one run: 17 of 17 pass on knsh, 16 of 17 on
flat nsh. `test_tcp_procfs_many` then sees 2188 and 1738 lines, 300 of its
listener. In flat nsh `test_tcp_reset_send` fails on master and with
apache/nuttx#22145 alike (the `SIGPIPE` goes to another thread). The test
server needs apache/nuttx-apps#4103.
`tools/checkpatch.sh -c -u -m -g` passes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]