casaroli opened a new pull request, #3940: URL: https://github.com/apache/nuttx-apps/pull/3940
## Summary Add the cmocka test `cmocka_net_mcast` to `testing/nettest/mcast`. It tests the RFC 3678 options `MCAST_JOIN_GROUP` and `MCAST_LEAVE_GROUP` on the loopback device, for IPv4 (IGMP) and for IPv6 (MLD). The test checks that a datagram to a joined group arrives, and that no IPv4 datagram arrives after the leave. It also checks the errors: a second leave gives the same errno as a second `IP_DROP_MEMBERSHIP` / `IPV6_LEAVE_GROUP`, a short option length gives `EINVAL`, a group of the wrong address family gives `EINVAL` (IPv4) or `EADDRNOTAVAIL` (IPv6), and `MCAST_JOIN_SOURCE_GROUP` gives `ENOSYS`. The test uses `struct group_req` and the `MCAST_*` names that apache/nuttx#21127 adds to `netinet/in.h`. depends-on: apache/nuttx#21127 ## Impact New test only. `CONFIG_TESTING_NET_MCAST` is in the nettest menu (`CONFIG_TESTING_NET_TEST`). It needs `NET_UDP`, `NET_SOCKOPTS`, `NET_LOOPBACK`, and `NET_IGMP` or `NET_MLD`. The IPv4 part builds only with `NET_IGMP`, the IPv6 part only with `NET_MLD`. No defconfig enables the nettest menu, so no CI build changes. Documentation: no change. The nettest page in `Documentation/applications/testing/nettest` describes the menu, and the new option follows its naming. ## Testing Built against apache/nuttx#21127 and run under QEMU (HVF), arm64: | Config | Options | Result | |---|---|---| | `qemu-armv8a:knsh` (kernel) | `NET_IGMP` and `NET_MLD` | `cmocka_net_mcast`: 11 tests PASSED | | `qemu-armv8a:nsh` (flat) | `NET_IGMP` and `NET_MLD` | 11 tests PASSED | | `qemu-armv8a:knsh` and `qemu-armv8a:nsh` | `NET_IGMP` only | 6 tests PASSED (the IPv6 part is not built) | | `qemu-armv8a:knsh` and `qemu-armv8a:nsh` | `NET_MLD` only | 6 tests PASSED (the IPv4 part is not built) | `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]
