Make sure the tests work if VLAN count is set to 0. This means
that only priority tagged (tag 0) VLAN frames can be received.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure that buffer configuration and buffer lengths provided in
struct msghdr are left intact after being processed by recvmsg().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Make sure that buffer configuration and buffer lengths provided in
struct msghdr are left intact after being processed by recvmsg().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The conversion from IPv4 string presentation to numeric value
did not check if the individual address value was between 0 and 255
inclusive.
Add also test case for this.
Fixes#84593
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Increasing the stack size for header_reserved test.
This avoids stack overflow in various boards.
Fixes#84620
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
A _res_fallback parameter to HTTP_SERVICE_DEFINE is added to optionally
specify a fallback resource detail, which will be served if no other
resource matches the URL.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
As the test coverage keeps growing, the test suite no longer fits into
smaller devices, hence add min_flash requirement for the test suite to
filter them out.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Increasing the stack size for variable_buf_size test. This avoids
stack overflow in various boards.
Fixes#84489
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Fixes#84198.
If a '?' character is used as part of a wildcard resource, do not treat
this as the end of the string when comparing with a path from the HTTP
request. Only the path from the HTTP request may be terminated by '?'
(in the case of a request with query parameters).
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Make sure we are able to receive VLAN tag 0 packet, and
verify that reply packet is sent correctly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The headroom was not taken into account for variable size data
buffers when CONFIG_NET_L2_ETHERNET_RESERVE_HEADER was enabled.
Add a test case for it to make sure the reserve allocation works
properly.
Fixes#84053
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add test case for matching pending replies with received responses.
Cover corner cases that are failing with the current implementation.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
It was incorrectly introduced earlier and not really needed
because the test will pass without it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Three tests has been added for Content-Range functionality in http
parser:
- test_content_range_supplied: Checks if parser handles range correctly.
- test_content_range_asterisk_total: Checks if parser interprets
astersk as no total size supplied.
- test_double_content_range_error: Checks if parser rejects header with
repeated Content-Range field.
Signed-off-by: Piotr Radecki <piotr.radecki@jrdltd.co.uk>
Use the 192.0.2/24 address space reserved for documentation.
No functional changes by this commit.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of setting the upper protocol type in ethernet_send()
by checking the protocol type bits, use the ptype that is already
set by the caller. This allows new protocol types to be supported
and makes the system extensible.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add tests cases verifying that the server replies with HTTP 500 Internal
Server Error reply in case of processing error.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add tests cases verifying that the server replies with HTTP 405 Method
Not Allowed reply in case the client tries to access the resource with a
method it does not allow.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Ensure that HTTP resources can only be served to a client connected on
the specific service(s) that the resource was registered against using
the HTTP_RESOURCE_DEFINE macro.
This allows different resources to be registered to different services,
for example to make some resources only available via an HTTPS service
and not via unencrypted HTTP.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
For waking up the poll() use eventfd() instead of socketpair()
so we save some buffer space and one file descriptor.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When using tickless mode, the socketpair()
seem to use heap by default on native_sim, so
add some space for it.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Create a special Ethernet interface that supports link layer
embedding. Add a test that uses this special Ethernet interface
to verify that the L2 header is embedded to the first net_buf.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure we send IGMP report when re-joining the multicast group
when interface goes up after operative down event.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Convert vendor specific **_WIFI_BUILD_ONLY_MODE symbol as global
in order to provide common build flag to enable CI with no blobs.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add additional test cases which verify that the HTTP server code can
handle PUT/PATCH/DELETE request types.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC is promptless so it cannot
be selected. Moreover it's also automatically enabled by
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE in the same overlay file
so there would be no need to explicitly enable it.
As for the IMPORT, EXPORT, DERIVE they are needed for the TLS connection
to work properly. Previously it was working because at least IMPORT and
EXPORT are internally enabled by Mbed TLS at build time. So here we
are basically doing the same enablements with Kconfigs in clear.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
We have now fully migrated to CRYPTO_ALT which is a superset, so, remove
unused CRYPTO module and it's related files.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Make sure that the socket service is properly unregistered when
dispatcher is unregistered.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The tests overflowed system workqueue stack slightly when running on
nRF52840, increase the stack size globally for the tests to avoid
potential issues on other platforms as well.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Testcase uses certificates from the sample application at
samples/net/sockets/http_server. These were modified and moved into a
different folder by a previous commit, causing a build failure in the
test.
Testcase updated to:
- use new path to certificates
- update available cipher suites, since certificates now use ECDSA
- update expected hostname in certificate
The CA certificate in the sample app is also converted to .der format
for inclusion in the test (the content is exactly the same as the PEM
version, just converted to DER).
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Convert them to native YAML lists. Support for space-separated
lists was deprecated in Twister a long time ago.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Concurrent HTTP POST requests on different HTTP2 concurrent streams
require that the client's header_capture_context is re-used to capture
headers on a second stream before all of the body data has been received
(and sent to the application) on the first stream.
As a result, any captured headers must be sent to the application
callback before any headers can be received on a different stream. In
practice this means that for HTTP2 the application callback is called
for the first time on receiving a headers frame, before any data frames
are received. All subsequent application callbacks will not include the
request header data.
While this mechanism is not necessary for HTTP1, it is also updated to
only send headers in the first application callback for consistency.
Fixes#82273
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Removed implying of NVS by the NET_L2_OPENTHREAD, and from now a
platform can choose between ZMS and NVS as a settings backend.
NET_L2_OPENTHREAD still requires NVS or ZMS backend so the config
depends on one of those.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
The test interfaces registered addresses within the same subnet. As now
only the subnet part of the address is verified when choosing source
address or interface, it was not deterministic which interface would be
selected. Therefore, make the two interfaces use two different subnets
so that tests that verified which address/interface was used work
reliably as earlier.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add a test case which validates that if two network interfaces are
equally good wrt net mask for LL IPv4 communication, the default
interface is preferred.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add a test case verifying that a proper source IPv4 address and
interface is selected for a given LL destination address.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add minimum flash requirement to the tests. This will effectively
exclude nrf5340dk/nrf5340/cpuapp/ns as it does not have
enough flash for the application.
Fixes#81862
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add collector parameter to metric creation macros so that it
is possible to bind the metric to collector already at built
time.
Also add optional user_data to metric macro calls so that user
can add optional data there. This will be used by network statistics
Prometheus support in subsequent commits.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>