This patch adds tests for the wifi_credentials library.
Both the main functions and the backend implementations are tested.
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Add functionality to test the IGMP query handling. This test should
prevent the IGMP logic from sending IGMPv3 messages to IGMPv2 queriers.
The test does now also check backwards compatability when IGMPv3 queries
are received but only IGMPv2 is enabled.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
Tests for prometheus library support.
It contains integration and unit test
each metric types.
Signed-off-by: Mustafa Abdullah Kus <mustafa.kus@sparsetechnology.com>
Use EXTRA_CONF_FILE in sample yaml files,
that replaced deprecated OVERLAY_CONFIG
since the Zephyr v3.4 release.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
Added extra testcases for the IGMPv3 protocol. The IGMP driver is
supposed to send an IGMPv3 report when joining a group.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
conn_mgr_tests were occasionally failing when executed under heavy load.
The reason for this are short timeout values used when waiting for
events - if executed under heavy load, the even might not be delivered
on time.
An obvious solution would be to simply increase the timeout, however
when testing it turned out the actual timeout value would need to be
pretty high to ensure tests reliability. Therefore, to avoid
unnecessary increase of the overall test execution time to protect
against rare edge cases, rework the event waiting mechanism to use
semaphore instead. The test cases will now specify the events they're
waiting for, and the event handlers will feed the semaphore if all
expected events have been delivered. This allows the increase the
maximum timeout when waiting for events, w/o affecting too much the test
execution time under normal conditions.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
CONFIG_ZVFS_POLL_MAX is now used to control the maximum number of poll()
entires. Thereby, CONFIG_NET_SOCKETS_POLL_MAX is redundant and shall
be deprecated.
Modify the defaults for NET_SOCKETS_POLL_MAX and ZVS_POLL_MAX so that
the deprecation actually makes sense instead of symbol removal. In case
the application still sets the old config, it will modify the
ZVS_POLL_MAX default.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Move the implementation of zsock_poll to zvfs_poll. This allows
other types of file descriptors to also make use of poll()
functionality even when the network subsystem is not enabled.
Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add netif:eth to twister yaml for frdm_rw612
Exclude from wifi test because of binary blob requirement
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove the `work_q` parameter from `NET_SOCKET_SERVICE_SYNC_DEFINE` and
`NET_SOCKET_SERVICE_SYNC_DEFINE_STATIC` as this feature was dropped
during review but the removal was not 100% complete.
Signed-off-by: Jordan Yates <jordan@embeint.com>
IPv6 MLD API was so far defined in an internal header. This does not
seem correct though, as application code should be able to join/leave
multicast groups, hence the API should be exposed in a public header,
just as it is done for its IPv4 countepart - IGMP.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Extend the `coap_transmission_parameters` struct with the field
`ack_random_percent`. This was the last remaining CoAP transmission
parameter that was not configurable at runtime.
Signed-off-by: Adrian Friedli <adrian.friedli@husqvarnagroup.com>
The goal of this commit is to reduce the overall test time by optimizing
the time spent sleeping.
However while doing so, a few glitches became apparent and those have
been fixed as well.
1. The way the ZSOCK_POLLIN event is managed has been modified
In most tests, the event would stick for the whole test and this would
sometimes results in the client receiving more data than intended which
in turn would results in various unexpected warnings and errors.
The management of the ZSOCK_POLLIN event has now been mostly moved to
the send/receive overrides which better represent how things would
happen outside of the test scenario.
For example, when sending data, if this send would normally result in
receiving some response, the send function sets the ZSOCK_POLLIN event.
Then when receiving, we clear the event as the data has been received.
There are a few exceptions to this for cases where we need to simulate
some specific abnormal behavior.
2. The `messages_needing_response` queue now includes a valid bit
The test manages a queue of messages id to be able to respond to the
correct id in the receive hooks.
It was built in a way that the id 0 would be treated as invalid
although it is a valid id.
In practice, it would not be an issue in most cases however, it would
result in an unexpected behavior if the `test_multiple_requests` test
would be run first.
To fix this issue in the simplest way, the queue has been changed to
uint32_t which gives us 16 extra bits for the management of the queue,
1 of which is used to tell if the entry is valid or not.
Signed-off-by: Francois Gervais <francoisgervais@gmail.com>
mbed TLS MD operations, used by IPv6 Privacy Extensions, require access
to heap. This may vary depending on platform/mbed TLS variant used,
hence enable CONFIG_MBEDTLS_ENABLE_HEAP in tests to ensure mbed TLS has
always access to some heap memory.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Use security mode (PSK or X509) to detect if we should
set the socket option to verify hostname.
PSK security mode cannot verify hostnames as this information
is coming in the certificate, so don't set the options.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
This board just don't have enough RAM for all tests
so it is just a maintenance headache without any
benefits.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
* Wait for update when new object is created
Sometimes our blockwise transfer starts before server have
received an LwM2M Update. This causes Leshan to reject the SEND
because is was not aware of object /19/0
* Wait "registered" message already in conftest.py.
Sometimes Qemu boots faster, and the testcase don't see the
log.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Make sure that CONFIG_ZVFS_OPEN_MAX in the tests and samples is at
least the same value as CONFIG_NET_SOCKETS_POLL_MAX so that we
cannot have more polled sockets than there are available file
descriptors.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Since fc007eeef5 TLS sockets support
timeout based on CONFIG_NET_SOCKETS_CONNECT_TIMEOUT value. The TLS test
suite reduced this config value to speed up the tests, however it turns
out the 100ms timeout is too low to finalize the handshake on slower
platforms (nrf52840 specifically). Therefore increase the timeout value
to 200ms to prevent test failures on those.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As confirmable requests will stay allocated for (3 * ACK_TIMEOUT), we
need to adjust the timings so all requests are unallocated by the end
of the test.
Signed-off-by: Francois Gervais <francoisgervais@gmail.com>
Evaluate CONFIG_LINKER_ITERABLE_SUBALIGN in CMake instead of in the
linker script.
It cannot be assumed that a linker generator implementation is
pre-processed and therefore Kconfig settings cannot be used in those
but must be evaluated in CMake.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Since the same test might be run in parallel on different platforms,
the one that it's started later will fail due to port re-use for
the OpenSSL server.
Since it's not really required to run the tests on native_sim and
native_sim/native/64, the latter is removed in order to solve this
problem.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
native_posix is now deprecated.
Building these tests in both native_sim and native_posix does not
improve coverage for the tests or subsystem but doubles CI time.
As anyhow native_posix will be removed all together in
2 releases, let's remove it already for these.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Make sure it's possible to register IPv4/6 addresses on an offloaded
interface. Add an extra build configuration to make sure it's also
possible when native IP stack is disabled.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add test cases for dynamic GET/POST, where the payload is transferred
across more than one call to the dynamic resource callback.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
After introduction of struct http_response_ctx, the dynamic resource
data buffer is no longer needed for transferring data between the
application callback and the server. It is therefore removed to avoid
unnecessary copying of data.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Add tests covering new method of providing a response for dynamic
resources.
Tests cover the application sending response codes and headers,
overriding "default" headers, and sending various combinations of
headers and body data. Each case is tested for HTTP1 & HTTP2, both POST
and GET methods.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Allow the application to send headers and response codes from a dynamic
resource callback by filling out a response context structure.
This also allows simple requests to be completed in a single execution
of the callback, by setting the final_chunk flag.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Ethernet board variant was missed in commit 138e9591f8 (tests: net:
wifi: exclude RW612 based boards), but is the sole variant that actually
was running this test. Exclude this variant only, since it cannot build
this test due to requiring binary blobs.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit adds a test to showcase how to configure TLS 1.2 and 1.3
socket connections against an OpenSSL server. Only a limited number
of combinations are available for now:
- TLS 1.2
- RSA certificate and key exchange.
- ECDSA certificate and ECDHE key exchange.
- TLS 1.3 only supports ephemeral (ECDHE) key exchange with/without
session tickets.
Since the goal is to test TLS connection and not low level ethernet
functionalities or similar, the only supported platform is "native_sim"
where Linux sockets are used to connect to the OpenSSL server locally.
The idea is that the Zephyr application acts a client and tries to connect
to the OpenSSL server running on the same PC. For sake of simplificity a
bash script is provided to start the OpenSSL server properly.
For completeness a bash script is also provided to re-generate
certificates and keys.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This was seen in CI
START - test_cycle_ready_CC
Assertion failed at ...tests/net/conn_mgr_monitor/src/main.c:262:
cycle_ready_ifaces: (stats.conn_count_gen not equal to 1)
NET_EVENT_L4_CONNECTED should be fired when connectivity is gained.
FAIL - test_cycle_ready_CC in 0.015 seconds
As the event wait timeout is very short (1ms) by default, increase
it to 10ms so that we will not miss the event.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Move the network buffer tests to tests/lib/net_buf as their implementation
now lives outside of the networking subsystem.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.
Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Move the net_buf implementation from the networking subsystem to a library
as they have no dependency on the networking subsystem.
Network buffers are used in subsystems outside of networking
(e.g. Bluetooth, USB).
Fixes: #36374
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Allow application to register certain HTTP request headers to be stored
by the server. These stored headers can then be accessed from a dynamic
resource callback.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Exclude RW612 based boards from the WiFi testsuite, as these boards
require binary blobs be downloaded in order to build as expected
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Currently, the test doesn't clear the control data buffer before
calling recvmsg. This leads to recvmsg being unable to add the new
control data, which corresponds to the current received data.
This commit aims to clear the control data buffer to match most use
cases, when the control data buffer is empty before calling recvmsg.
Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
native_posix is deprecated, let's switch the
description & comments to refer to native_sim instead.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Convert users of net_buf_put() and net_buf_get() functions to use
non-wrapped putters and getters k_fifo_put() and k_fifo_get().
Special handling of net_bufs in k_fifos is no longer needed after commit
3d306c181f, since these actions are now
atomic regardless of any net_buf fragments.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The nrf7002dk board's wifi chip requires blobs to build wifi driver.
Therefore it can not be built by CI. Exclude the board and its
variants from the wifi test suite.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The MQTT publisher/subscriber/pubsub tests suites are currently
depending on an external MQTT broker being available. In result, the
test suites cannot be executed in twister and need to be run manually,
which makes them kind of pointless from the CI perspective.
This commit reworks the tests, so that they no longer rely on an
external broker being available, but rather implement minimalistic
broker functionality for test purposes only. This will make the tests
self contained, and thus executable in the CI.
Since it makes not point to duplicate the effort between the test
suites, the test suites have been merged into a single mqtt_client test
suite.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>