casaroli opened a new pull request, #4003:
URL: https://github.com/apache/nuttx-apps/pull/4003

   depends-on: apache/nuttx/pull/21614
   
   ## Summary
   
   Tests for the Unix domain socket fixes of the nuttx PR in the depends-on 
line. Two commits:
   
   - testing/nettest: Add SO_PEERCRED cases to cmocka_net_local. New option 
`CONFIG_TESTING_NET_LOCAL_PEERCRED` (default y; depends on `TESTING_NET_LOCAL`, 
`NET_LOCAL_STREAM`, `NET_LOCAL_DGRAM`, `NET_SOCKOPTS`), file 
`local/test_local_peercred.c`. As on Linux: both ends of a stream and a 
datagram `socketpair()` give the process that made the pair; an unconnected 
socket gives pid 0, uid -1 and gid -1; a listening socket gives its own 
process; with `fork()`, a child's end still gives the creator, and on a stream 
connection the server side gives the client and the client gives the server, 
right after `connect()` and after `accept()`.
   - testing/nettest: Test socket pairs, signals and addresses of local 
sockets. 8 cases in `cmocka_net_local_dgram`: `addrlen` (an address with no NUL 
after the name and other bytes after it, for `bind()`, `connect()` and 
`sendto()`), `stream_listenclose` (a listener closes with a connection it did 
not accept), `pair_send`, `pair_full`, `pair_close`, `poll_pair` (datagram 
socket pairs), `recv_intr`, `stream_intr` (a signal ends a `recv()` that waits, 
with `EINTR`). New files `local/test_local_dgram_pair.c` and 
`local/test_local_dgram_wait.c`; `local_dgram_fill()` and 
`local_dgram_unfill()` in `local/test_local_dgram_common.c`.
   
   `poll_pair` comes from #3981 (draft), which keeps its other cases.
   
   ## Impact
   
   New tests only. `CONFIG_TESTING_NET_LOCAL_DGRAM` does not change; the new 
option only adds cases to `cmocka_net_local`. No defconfig enables 
`TESTING_NET_TEST`, so no CI build changes. No documentation change.
   
   ## Testing
   
   qemu-armv8a (arm64, HVF, 1 CPU), make, apps on 19cbea35a with this PR, each 
case alone (`cmocka_net_local_dgram <dir> <case>`). knsh: kernel build, the 
programs from `/system/bin`; nsh: flat build, builtins. Options: `NET`, 
`NET_IPv4`, `NET_LOOPBACK`, `NET_TCP`, `NET_UDP`, `NET_SOCKOPTS`, `NET_LOCAL` 
(stream, datagram, SCM), `PIPES`, `FS_TMPFS`, `DEBUG_ASSERTIONS`; for cmocka 
`ALLOW_MIT_COMPONENTS`, `LIBC_REGEX`, `ARCH_SETJMP_H`; `TESTING_NET_TEST`, 
`TESTING_NET_LOCAL`, `TESTING_NET_LOCAL_PEERCRED`, `TESTING_NET_LOCAL_DGRAM`.
   
   | Configuration | nuttx master cb52e915d95 | with the nuttx PR |
   |---|---|---|
   | knsh, `cmocka_net_local_dgram` | 75 PASS (the existing cases), the 8 new 
cases FAIL | 83 PASS |
   | nsh, `cmocka_net_local_dgram` | the same; `stream_listenclose` stops the 
system (`Assertion failed at semaphore/sem_wait.c:135`) | 83 PASS |
   | knsh, `cmocka_net_local` | `test_local_scm_rights` passes, then the kernel 
panics in `test_local_peercred_pair` | 6 PASS |
   | nsh, `cmocka_net_local` | the system stops in `test_local_peercred_pair` | 
4 PASS (no `fork()`: the fork and accept cases are not built) |
   
   On Linux 7.0 (arm64 container, host libc, the cmocka of apps): 
`cmocka_net_local_dgram` 82 PASS, 1 skipped (`fifo_policy`, NuttX only); 
`cmocka_net_local` with the `SO_PEERCRED` cases 6 PASS.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   
   Not run: CMake builds, the protected build, sim, other arches.
   


-- 
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]

Reply via email to