zephyr/tests
Marcin Niestroj c4bd3f1e38 tests: net: socket: udp: verify that sent DGRAM was not fragmented
Datagrams should either be fully sent or not sent at all if networking
buffers or network interface MTU does not allow that.

Verify that by trying to send MTU+1 bytes in case of IPv4 (as IP level
fragmentation is not implemented) and IPv6 (should fail when IPv6
fragmentation support is not enabled and succeed otherwise). In case of
IPv6 try to send "total number of network buffers + 1", so that even with
IPv6 fragmentation enabled requested datagram will not be sent. In all
tested cases when datagram is too big, check that ENOMEM error code is set.

NOTE: Tested behavior is not 100% compliant with Linux, as on Linux
EMSGSIZE error code is set when trying to send datagram bigger than MTU,
when manually disabling IP fragmentation (by setting IP_MTU_DISCOVER to
IP_PMTUDISC_DO). However, it is not trivial to implement such
behavior (EMSGSIZE error due to MTU) now and there is always a risk of
running out of buffers (and getting ENOMEM), so for now implemented tests
just assume the latter case to always happen.

Add 3rd testcase, which enables IPv6 fragmentation support, so that UDP
socket behavior can be tested in that context.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-06-01 11:17:07 +02:00
..
application_development/gen_inc_file kconfig: Rename the ZTEST stack size option to align with the rest 2022-02-22 08:23:05 -05:00
arch include: add more missing zephyr/ prefixes 2022-05-27 15:20:27 -07:00
benchmarks include: add more missing zephyr/ prefixes 2022-05-27 15:20:27 -07:00
bluetooth Bluetooth: audio: Fix call control client build 2022-05-27 17:47:58 -07:00
boards include: add more missing zephyr/ prefixes 2022-05-27 15:20:27 -07:00
boot/uefi tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
cmake/config_dir cmake: APPLICATION_CONFIG_DIR support implemented 2021-11-10 08:25:36 -05:00
crypto libc: minimal: Introduce CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS 2022-06-01 11:03:38 +02:00
drivers tests/spi_loopback: Fix buffer sizes to avoid buffer overflow 2022-05-27 15:34:34 -07:00
kernel tests/kernel/common: Include errno_private.h 2022-05-27 15:34:34 -07:00
lib libc: minimal: Introduce CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS 2022-06-01 11:03:38 +02:00
misc tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
net tests: net: socket: udp: verify that sent DGRAM was not fragmented 2022-06-01 11:17:07 +02:00
posix tests/posix/fs: extend readdir test 2022-05-13 11:10:04 -07:00
subsys include: add more missing zephyr/ prefixes 2022-05-27 15:20:27 -07:00
unit tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
ztest include: add more missing zephyr/ prefixes 2022-05-27 15:20:27 -07:00