freebsd-src/tests/sys/netlink/Makefile
Gleb Smirnoff 0ad011ecec tests/netlink: add netlink socket buffer test
With upcoming protocol specific socket buffer for Netlink we need some
additional tests that cover basic socket operations, w/o much of actual
Netlink knowledge.  Following tests are performed:

1) Overflow.  If an application keeps sending messages to the kernel,
but doesn't read out the replies, then first the receive buffer shall
fill and after that further messages from applications will be queued
on the send buffer until it is filled.  After that socket operations
should block.  However, reading from the receive buffer some data should
wake up the taskqueue and the send buffer should start draining again.

2) Peek & trunc.  Check that socket correctly reports amount of readable
data with MSG_PEEK & MSG_TRUNC.  This is typical pattern of Netlink apps.

3) Sizes. Check that zero size read doesn't affect the socket, undersize
read will return one truncated message and the message is removed from
the buffer.  Check that large buffer will be filled in one read, without
any boundaries imposed by internal representation of the buffer.  Check
that any meaningful read is amended with control data if requested so.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D42525
2024-01-02 13:03:49 -08:00

19 lines
436 B
Makefile

PACKAGE= tests
WARNS?= 1
TESTSDIR= ${TESTSBASE}/sys/netlink
ATF_TESTS_C+= netlink_socket
ATF_TESTS_C+= test_snl test_snl_generic
ATF_TESTS_PYTEST += test_nl_core.py
ATF_TESTS_PYTEST += test_rtnl_iface.py
ATF_TESTS_PYTEST += test_rtnl_ifaddr.py
ATF_TESTS_PYTEST += test_rtnl_neigh.py
ATF_TESTS_PYTEST += test_rtnl_route.py
ATF_TESTS_PYTEST += test_netlink_message_writer.py
CFLAGS+= -I${.CURDIR:H:H:H}
.include <bsd.test.mk>