zephyr/tests/net/socket
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
..
af_packet tests: net: sockets: Update packet socket tests 2022-05-27 15:40:29 -07:00
af_packet_ipproto_raw tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
getaddrinfo tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
getnameinfo tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
misc tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
net_mgmt tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
offload_dispatcher tests: net: socket: Increase ztest stack size for offload_dispatcher 2022-05-13 15:42:01 +02:00
poll tests: net: socket: Add test to verify POLLOUT functionality 2022-05-18 11:09:17 +02:00
register tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
select tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
socketpair tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
tcp tests: net: socket: tcp: Add test for a broken link 2022-05-30 10:30:38 +02:00
tls tests: socket: tls: check sendmsg() behavior for datagrams 2022-05-25 14:20:09 +02:00
tls_ext tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
udp tests: net: socket: udp: verify that sent DGRAM was not fragmented 2022-06-01 11:17:07 +02:00
websocket tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00
socket_helpers.h tests: migrate includes to <zephyr/...> 2022-05-06 20:02:14 +02:00