2023-01-23 20:51:43 +08:00
|
|
|
CONFIG_NEWLIB_LIBC=y
|
|
|
|
CONFIG_NEWLIB_LIBC_NANO=n
|
|
|
|
|
|
|
|
# CONFIG_THRIFT Dependencies
|
|
|
|
CONFIG_CPP=y
|
|
|
|
CONFIG_STD_CPP17=y
|
|
|
|
CONFIG_CPP_EXCEPTIONS=y
|
|
|
|
CONFIG_GLIBCXX_LIBCPP=y
|
|
|
|
CONFIG_POSIX_API=y
|
|
|
|
CONFIG_NETWORKING=y
|
|
|
|
CONFIG_NET_TCP=y
|
|
|
|
CONFIG_NET_SOCKETS=y
|
|
|
|
CONFIG_NET_SOCKETPAIR=y
|
|
|
|
CONFIG_HEAP_MEM_POOL_SIZE=16384
|
|
|
|
CONFIG_EVENTFD=y
|
|
|
|
|
|
|
|
CONFIG_THRIFT=y
|
|
|
|
|
|
|
|
# Test dependencies
|
|
|
|
CONFIG_ZTEST=y
|
|
|
|
CONFIG_TEST_RANDOM_GENERATOR=y
|
|
|
|
CONFIG_NET_TEST=y
|
|
|
|
CONFIG_NET_DRIVERS=y
|
|
|
|
CONFIG_NET_LOOPBACK=y
|
tests: lib: thrift: Fix timing issues with TCP
The test delegates putting the server socket into listening (i. e.
calling listen() on the socket) to a separate thread, which did have a
chance to run before client attempted to establish TCP connection.
This was not visible before, as we did not reply with RST to a
connection attempt on a closed port, so the connection was eventually
establish after SYN retransmission. But as we do reject such a
connection now with RST, the connection attempt failed. Therefore, a
small delay was added after spawning the server thread, to give it a
chance to configure the server socket.
Additionally, lower the CONFIG_NET_TCP_TIME_WAIT_DELAY value so that TCP
contexts are released earlier, and add a respective delay in the test
teardown function. Not doing so also triggered unneeded SYN
retransmissions, as there were no enough TCP context to accept the
incoming connection, before freeing the resources allocated for the
previous one.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-18 19:16:10 +08:00
|
|
|
CONFIG_NET_TCP_TIME_WAIT_DELAY=100
|
2023-01-23 20:51:43 +08:00
|
|
|
|
|
|
|
# Some platforms require relatively large stack sizes.
|
|
|
|
# This can be tuned per-board.
|
|
|
|
CONFIG_ZTEST_STACK_SIZE=8192
|
|
|
|
CONFIG_MAIN_STACK_SIZE=4096
|
|
|
|
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
|
|
|
|
CONFIG_THRIFTTEST_SERVER_STACK_SIZE=8192
|
|
|
|
CONFIG_NET_TCP_WORKQ_STACK_SIZE=4096
|
|
|
|
CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096
|
|
|
|
CONFIG_IDLE_STACK_SIZE=4096
|
|
|
|
CONFIG_NET_RX_STACK_SIZE=8192
|
|
|
|
|
|
|
|
CONFIG_NET_BUF_TX_COUNT=20
|
|
|
|
CONFIG_NET_PKT_TX_COUNT=20
|
|
|
|
CONFIG_NET_BUF_RX_COUNT=20
|
|
|
|
CONFIG_NET_PKT_RX_COUNT=20
|
2023-07-30 07:46:32 +08:00
|
|
|
|
|
|
|
# We can get away with using fewer sockets in the non-TLS tests because we use
|
|
|
|
# TFDServer.cpp for our server and socketpair() for our channel. We do not
|
|
|
|
# need an accept socket for the server (in contrast to TCP), it only needs 1
|
|
|
|
# eventfd for server cancellation, and there are no cancellation sockets
|
|
|
|
# required because we close them in the testsuite.
|
|
|
|
#
|
|
|
|
# File Descriptor Usage
|
|
|
|
# ---------------------
|
|
|
|
# stdin, stdout, stderr: 3
|
|
|
|
# socketpair for channel: 2
|
|
|
|
# eventfd for cancellation: 1
|
|
|
|
CONFIG_POSIX_MAX_FDS=6
|
2023-01-23 20:51:43 +08:00
|
|
|
|
|
|
|
# Network address config
|
|
|
|
CONFIG_NET_IPV4=y
|
|
|
|
CONFIG_NET_CONFIG_SETTINGS=y
|
|
|
|
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1"
|