Instead of passing the test parameters to the websocket function, by
casting the pointer to integer (which may not work on 64-bit platform
due to int/pointer size mismatch), let the test allocate a file
descriptor, and initialize it with test context. The tested functions
expect a file descriptor as an argument anyway, so it's a more intuitive
approach.
The conditional test code within WS implementation can retrieve the test
context by using FD APIs to obtain the object represented by the FD.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The websocket library uses int for pointers for testing and does not
work reliably on 64 bit architectures.
Exclude the test so it does not block other unrelated PRs.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add new test cases for SO_RCVBUF/SO_SNDBUF which verify that setting
those options actually affects the RX/TX window sizes at the TCP level.
Existing tests only verified whether the options can be set/read
correctly.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Adds dummy link layer for offloaded ifaces, allowing
ifaces to directly receive l2_enable calls
Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
Previously, `socketpair()` tests had pulled in the native
`fcntl()` implementation instead of using the Zephyr version
when being run under `native_posix_64`.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This test runs fine on native_posix_64. The exclude was added long time
ago and seems to not apply anymore.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move net/socket/websocket tests to use new ztest API
TEST=twister -T tests/net/socket/websocket
Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The `fcntl()` call (`zsock_fcntl()`) does not seem to work
properly (specifically with `CONFIG_ARCH_POSIX`). This will
be resolved in subsequent work harmonizing the networking
subsystem and POSIX library.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Previously, the test was only run for configurations that used
the Newlib C library. However, socketpair runs equally well
under the minimal libc, and picolibc, as well as the native
libc.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
* do not define `read`, `write`, as different symbols
* use `recv`, and `send` as defined by
`CONFIG_NET_SOCKETS_POSIX_NAMES`
* do not specify `(2)` as manual-page sections are
somewhat irrelevant
Note: we use `CONFIG_NET_SOCKETS_POSIX_NAMES` here, and
`CONFIG_POSIX_API` in `samples/` to show that the socketpair
API is available in both configurations.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Wow, this testsuite was really celebrating some redundancy
before.
While that is sometimes a good thing, it's also sometimes
better to be more concise.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `test_socketpair_` prefix was leftover from the old ztest
framework.
It is also redundant, so remove it.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The declarations of extern test functions were leftover from
the old ztest framework.
They are unnecessary now.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Move net/socket/tls_ext tests to use new ztest API
TEST=west build -p -b native_posix tests/net/socket/tls_ext
Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
There is a test case which verifies that no new packets show up on the
interface, assuming that the only source of the packets is TCP stack.
ND protocol could interfere with that assumption, sending
advertisements.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
warning: format '%d' expects argument of type 'int', but argument 3
has type 'size_' {aka 'long unsigned int'} [-Wformat=]
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
After several fixes of the re-ordering logic in TCP, the receive queue
works as intended and cleans itself up properly. Previously the default
timeout was 100 ms, which pretty much disables it for real applications.
Increase the timeout to 2 seconds to actually enable it for in practice.
This should help pass much more of the Maxwell Pro tests.
This is the first step before removing the timeout completely.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
The `fcntl.h` header has never been a part of ISO C so move it to
`include/zephyr/posix`.
To ensure a smooth migration, a header was left in
`lib/libc/minimal/include` that prints a deprecation warning.
Users should either include `<zephyr/posix/fcntl.h>` or switch to
`CONFIG_POSIX_API=y`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
websocket_recv_msg() is reworked with using fsm. Now the function
return 0 when payload is empty, -ENOTCONN if socket close. Receiving
empty ping and sending empty pong were added in tests.
Fixes#52327
Signed-off-by: Grixa Yrev <grixayrev@yandex.ru>
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
These tests turn on mbedtls and require ajusting min flash
requirements to prevent twister from trying to build them on
platforms without required amount of flash.
Fixes: #51421
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
As the UDP test suite is mostly intended to run over loopback, use
loopback addresses and skip configuration of other addresses.
For the test cases that use fake Ethernet iterface the configuration
is done manually anyway, so just rename the symbols to avoid
collission.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As the TLS test suite is intended to run over loopback interface, use
loopback addresses and skip configuration of other addresses.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As the TCP test suite is intended to run over loopback interface, use
loopback addresses and skip configuration of other addresses.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As the test suite is intended to run over loopback interfce, use
loopback address and skip configuration of other addresses.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As the test suite is intended to run over loopback interfce, use
loopback address and skip configuration of other addresses.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The test suite already configured the dummy interfaces manually, so it's
only needed to provide respective address strings, no need to involve
NET_CONFIG_SETTINGS.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The can_frame and can_filter structs support a number of different flags
(standard/extended CAN ID type, Remote Transmission Request, CAN-FD format,
Bit Rate Switch, ...). Each of these flags is represented as a discrete bit
in the given structure.
This design pattern requires every user of these structs to initialize all
of these flags to either 0 or 1, which does not scale well for future flag
additions.
Some of these flags have associated enumerations to be used for assignment,
some do not. CAN drivers and protocols tend to rely on the logical value of
the flag instead of using the enumeration, leading to a very fragile
API. The enumerations are used inconsistently between the can_frame and
can_filter structures, which further complicates the API.
Instead, convert these flags to bitfields with separate flag definitions
for the can_frame and can_filter structures. This API allows for future
extensions without having to revisit existing users of the two
structures. Furthermore, this allows driver to easily check for unsupported
flags in the respective API calls.
As this change leads to the "id_mask" field of the can_filter to be the
only mask present in that structure, rename it to "mask" for simplicity.
Fixes: #50776
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit updates the `getaddrinfo` test to use the newlib nano
variant when available because it can run out of RAM with the newlib
full variant on the platforms with a small RAM.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
Align the struct socketcan_frame to most recent Linux kernel.
Compatibility with legacy can frames is maintained because the DLC is
equal to payload length for up to 8 bytes. Only the data buffer is
extended, resulting in larger size when CAN FD is enabled.
Signed-off-by: Martin Jäger <martin@libre.solar>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
When the NO_DELAY option is enabled, the retransmitted packets
will likely be differently broken down from the packets transmitted
initially. This provides a nice stress test for the out or order
reception logic.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Instead of waiting for the retransmit timeout, retransmit as soon as
missing data is deduced based on a triple-duplicate ACK.
Increase the number of buffers in the testcase, to allow for at least 4
packets in flight to trigger the triple-duplicate ACK.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
This change introduces test coverage for IEEE 802.15.4 AF_PACKET support
and IEEE 802.15.4 security operation.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
Decouple the zephyr/net/socketcan.h and zephyr/drivers/can.h header files
by moving the SocketCAN utilities to their own header.
This is preparation for including the SocketCAN types defined in
socketcan.h in a native posix (Linux) SocketCAN driver context without name
clashes.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
SocketCAN does not support CAN-FD data lengths of up to 64 bytes
payload. Decouple the maximum supported SocketCAN data length from the
maximum supported CAN controller data length.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Rename the SocketCAN header from socket_can.h to socketcan.h to better
match the naming of the functionality.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Rename the SocketCAN utility functions to reflect the new naming of the CAN
controller API and SocketCAN API data types.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Remove the "z" prefix from the public CAN controller API types as this
makes them appear as internal APIs.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Rename the SocketCAN data types to "socketcan_*" in preparation of renaming
the low-level CAN controller API data types.
This breaks the naming compatibility with the similar SocketCAN data types
from the Linux kernel, but Zephyr and Linux SocketCAN are not 100%
compatible anyways (only the structure fields are compatible, extended
functionality such filtering, error reporting etc. are not).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Move the SocketCAN tests from tests/drivers/can/utilities to
tests/net/socket/can to match the location of the code under test.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
There are several test cases that create fake ethernet devices and
expect the fake device to be the only ethernet device enabled. Some
tests handle this be explicitly disabling actual ethernet drivers,
but this doesn't scale well.
Change drivers/ethernet/Kconfig to utilze a menuconfig option that
wraps all the drivers. This allows us for those test cases that
don't want any actual ethernet drivers to disable them with a
simple CONFIG_ETH_DRIVER=n.
Note, the fake ethernet devices utilize CONFIG_ETH_INIT_PRIORITY so
we have it outside of the 'if ETH_DRIVER' block.
Signed-off-by: Kumar Gala <galak@kernel.org>
Disable unstable tests cases for mps2_an385, which fail sporadically
due to timer stability issues on that platform (see #48608).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Loosen some timing constraints in order to hack arond spurious
failures in upstream Zephyr's CI while working on an unrelated task.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit disables the `net.socket.tcp.preempt` test on the
`mps2_an385` platform because it fails very frequently due to the
system timer stability issues.
For more details, refer to the issue zephyrproject-rtos/zephyr#48608.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
It can happen that two similar stacks enter a retransmission cycle
due to a packet collision. If the transmission timeout is the same
both stacks will retry at the same moment resulting in another
collision.
By introducing a randomized retry timeout, the chance of
a second collision is reduced and it reduces furter the more
retransmissions occur.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Apply an exponentially increasing wait time between tcp retries. This
is a good balance between reacting fast to single lost packets and reduce
the network load when an outage takes a little longer. It also allows the
connection to survive a longer interruption with less retransmissions.
Update the test to accommodate for the increased socket closure timeout
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Previously the test waited for the worst case time till all sockets
where closed, this causes the test to wait for a long unnecessary time.
Secondly it does not ensure the sockets are actually closed before
starting the next tests.
For tests that are not conducted in user mode, wait until all the contexts
are close for a maximum time. If the contexts are not closed in time raise
an explicit assertion.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Move af_packet_ipproto_raw tests to use new ztest API
TEST=twister -T tests/net/socket/af_packet_ipproto_raw/
Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Increase threads stack sizes from 2k to 3k, so that it will pass without
stack overflow on qemu_x86 platform when SHA384 support will be reenabled.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
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>
A reproducible case to the behavior when during a connection
the link gets broken and all data is lost, the TCP connection
should properly terminate.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Fix the existing DGRAM packet socket test. The test will now specify
LL destination address and protocol type. Also, update the fake ethernet
device send handler, so that it sets the packet network interface
corretly, so that the packet is not rejected at Ethernet L2.
Additionally, add two additional test cases verifying datagram packet
sockets. Fist test will exchange packet between RAW and DGRAM socket,
making sure that net stack forwards/removes L2 header correctly. The
second test verifies that it's possible to recieve a packet on both RAW
and DGRAM socket, making sure the received data has correct format.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Datagrams (for DTLS connection) need to be sent using single API call to
mbedTLS and should not result in sending each fragment in a separate
datagram. Check if that is the case, so allow only single fragment data to
be sent and expect an error when multiple fragments were passed to
sendmsg().
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
When there is no response from the server, a client side close
is obstructed, it should terminate and clean the context. This
tests breaks the connection after the accept and validates
this behavior.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
The test suite is failing on qemu_cotext_a9 due to stack overflow.
Apparently this issue can also be observed on main after enabling
STACK_SENTINEL, however the test only started crashing after TCP
changes.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The close function on a TCP socket can return before the complete
socket has been closed, as there might be packets still in flight.
Add a wait at the end of the test so we are sure all sockets have
been closed before the next test starts.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
The close function on a TCP socket can return before the complete
socket has been closed, as there might be packets still in flight.
Modify the test to wait briefly (less then the retransmit time), before
counting the number of still open net_contexts. This makes the test
outcome not dependent on the scheduling order of the different tasks.
Secondly the test actually checks the number of open contexts to be zero
so there is no need to wait for any open contexts to still close.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
When there is no response from the server, a client side connect
should return a ETIMEOUT. This tests breaks the connection and validates
this behavior.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Add unit tests for socket dispatcher module. The tests verify that:
* a socket is automatically dispatched to a regular socket on any
first socket call, if the socket was not bound already before
(according to the default priority rules)
* a socket is correctly dispatched to an offloaded/native socket
implementation after a SO_BINDTODEVICE call
* a socket is correctly dispatched to a native TLS socket, with an
underlying native/offloaded socket, if TLS_NATIVE and SO_BINDOTODEVICE
socket options are used
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A reproducible case to see what happens when the TCP stack runs out
of buffers. It transfers a block, bigger then the number of buffers
available.
Also test by introducing packet loss in the loopback driver.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.
Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
Since the loopback driver makes use of the RX packet pool now, adjust
the packet count for the test.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A common pattern here was to take the work item as the subfield of a
containing object. But the contained field is not a k_work, it's a
k_work_delayable.
Things were working only because the work field was first, so the
pointers had the same value. Do things right and fix things to
produce correct code if/when that field ever moves within delayable.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The print specifier for `atomic_t` should be updated
to `%ld`, `%lu`, or `%lx` to account for the type
change of `atomic_t` to `long`.
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Previous timeouts values were done when local TCP replies wourd occur
within sender's thread. This was a known behavior: no context switch,
shorter timings for sending packets (locally only) thus shorter
timeouts.
Such behavior changed when local replies had to go through TCP's work
queue. See commit 798588e709Fixes#40129
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Client thread might run before the server gets to put itself on accept.
Leading to the server waiting forever.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Due to the previous change on when to send TCP packet on local IP, pkt
may be held in a queue which is to run on a k_work. This changes the
scheduling, and due to that one of the test is failing to allocate a
RX net_pkt at the time it wants to. (previous TCP connection is not yet
fully closed and still own PKT that new connection cannot get then).
Of course all those waiting paquets require buffers so raising them.
It was verified that there is no leak, adding net_pkt_print() at
tcp_conn_unref() shows that when all tcp connection are finally unrefed:
all net_pkt get freed as well.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
When creating a socket, all of the registered socket implementation are
processed in a sequence, allowing to find appropriate socket
implementation for specified family/type/protocol. So far however,
the order of processing was not clearly defined, leaving ambiguity if
multiple implmentations supported the same set of parameters.
Fix this, by registering socket priority along with implementation. This
makes the processing order of particular socket implementations
explicit, giving more flexibility to the user, for example when it's
neeed to prioritze one implementation over another if they support the
same set of parameters.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fixes: #38403
Adding NET_DRIVERS menuconfig so that network drivers are grouped
together in its own menu entry under drivers, similar to most other
drivers.
This further has the advantages that `CONFIG_NET_DRIVERS` can be used
for testing to determine if network drivers has been selected.
This changed revealed a dependency loop where both `select` (for SLIP)
and `depends` (for PPP) which both depends on NET_DRIVERS` where in use
in the dependency tree for Qemu networking, especially NET_SLIP_TAP.
This is handled by defaulting `NET_DRIVERS` to `y` when building for a
Qemu target.
`SLIP` had a dependency to `!QEMU_TARGET || NET_QEMU_SLIP`. This is
changed so that SLIP prompt depends on `!QEMU_TARGET` which provides
full user control in hardware but makes the symbol promptless on Qemu
targets.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The test ocassionally fails on the mps2_an385 platform in the CI, due
to strict timing requirements of the test.
Relax the timeouts and acceptable fuzz time a bit, to prevent the
failures in the future.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add unit tests which verifies that poll() function is signalled
correctly if called after data was written/read to/from a socket.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Network test cases are designed for emulated
environments so add platform_allowed filter to
only allow qemu platforms.
Fixes: #36418
Signed-off-by: David Leach <david.leach@nxp.com>
The timings were too tight for TLS tests executing on nRF52840 with
hardware entropy source enabled. Increase the timings to make tests
pass.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit increases the newlib heap size to 2048, which is the
recommended minimum required to ensure proper operation of the newlib
nano used by test (see #35799).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
If the tests/net/socket/getaddrinfo is run in a board that has
Ethernet controller, then it is possible that it will interfere
the test if the Ethernet cable is connected. As the test only
needs loopback support to run, disable the Ethernet as it is
not needed by the test.
Fixes#34923
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The network tests were expecting that network interfaces
are in certain order. As we cannot guarantee that, refactor
the tests like this:
* if test is using DUMMY L2 driver, then disable Ethernet L2
and fetch only DUMMY L2 instead of default interface
* if test is using Ethernet L2 driver, then make sure that the
test is using the Ethernet interface specified in the test
instead of the one provided by the DUT
Fixes#34505
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Replace all existing deprecated API with the recommended alternative.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
CMSIS_DSP and net_socket tests are either too
slow or too large for this platform, also drop
bluetooth for test
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
The previous implementation of process_dns() handler did not
properly catch how many queries we sent.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This platform has a tiny handful of remaining tests that fail. We
will track them as issues, but let's exclude them from integration
testing to allow full runs to complete. Often a hung device in one
test will break an entire twister run.
Tests with known (and tracked) failures:
samples/application_development/external_lib
samples/posix/eventfd
samples/userspace/hello_world_user
tests/kernel/fatal/message_capture
tests/net/socket/socketpair
tests/portability/cmsis_rtos_v2
These tests never fail in isolated testing, but are reliable timeouts
when run in sequence in a big twister run. It's possible that the bug
here may be in twister or the flash/serial scripts:
tests/crypto/tinycrypt
tests/subsys/logging/log_immediate
tests/subsys/logging/log_output
See: #32836
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The timeout might take more than 10ms in a heavily loaded system,
so increase the timeout to 20ms.
For example this is often seen for mps2_an385 platform.
Assertion failed at \
WEST_TOPDIR/zephyr/tests/net/socket/select/src/main.c:101: \
test_select: (tstamp <= FUZZ is false)
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
../src/main.c:662:13: warning: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
662 | int sock = (int)p1;
| ^
../src/main.c: In function 'spawn_child':
../src/main.c:671:4: warning: cast to pointer from integer of different
size [-Wint-to-pointer-cast]
671 | (void *)sock, NULL, NULL, 0, K_USER,
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The main stack size is too small by default in many boards.
Increase the size to 1024 bytes which works fine with
sam_e70_xplained board.
Fixes#31343
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The af_packet test has been augmented to check if sent UDP packet from
one port to another (via net interface) is also passed to open SOCK_RAW
connection.
The test_packet_sockets() function has been reused to setup the SOCK_RAW
sockets for this test.
It is important to note that the packet is passed to receive part of net
stack after being sent.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
The setup_socket() function calls socket() with proto changed to network
order. In this case functions with zsock_* prefix are called instead of
zpacket_*. The problem is with 'packet_is_supported()' method from
sockets_packet.c, which returns false when ETH_P_ALL proto is converted
with htons().
This patch fixes this issue by removing the htons() call.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Suggested-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This patch adds a test for the network address resolver module
that verifies resolving literal IPv6 addresses.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
some tests configured with CONFIG_NEWLIB_LIBC=y,
it's better to add a filter filter: TOOLCHAIN_HAS_NEWLIB == 1
in those tests yaml file.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>