Add a test case verifying that if there's a static resource defined
which overlaps a FS resource pointing to a directory, it takes
preference on exact URI match.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Both cases use a large static buffer, we can optimize here and use a
single mutex-protected buffer for both.
sendmsg() test case needed adjustments, as it was also testing a buffer
overflow scenario. This can only be properly tested however if CID
feature is disabled, as otherwise the common helper buffer size is
increased for the CID use case, preventing the overflow from taking
place.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
lwm2m_setup() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
When building with clang it warns about self-assignment in these tests:
* net.icmpv6
* net.shell
* net.arp
* net.tcp
* net.ip_addr
* net.6lo
* net.icmpv4
* net.udp
Example:
error: explicitly assigning value of variable of type
'struct net_udp_context *' to itself [-Werror,-Wself-assign]
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
When the response has been sent completely to the client, the server
reports the new `HTTP_SERVER_TRANSACTION_COMPLETE` status. Together with
the existing `HTTP_SERVER_TRANSACTION_ABORTED` status, the application
can now also for successful completions of requests clean up any
resources allocated for handling the request.
This especially allows to dynamically allocate the response buffer
passed to the server in the request callback and free it when the
request is done.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Rename enum http_data_status to enum http_transaction_status
to better reflect its purpose, which is to indicate the status of the
overall HTTP transaction, not just data transfer.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Fix build failures when compiling for 64-bit native_sim,
and add native_sim/native/64 to the platform allow list for
the coap client tests.
Signed-off-by: Sam Friedman <sam@golioth.io>
The ipv4 code now filters for multicast packets for non joined groups,
make sure the test join the group before trying to create traffic on
that address.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Use zsock APIs rather than POSIX APIs in net subsys tests.
The primary last remaining API call was `fcntl()` and related
constants, strings, etc.
It's convention to use native zephyr APIs in the testsuites and
POSIX APIs in samples.
Signed-off-by: Chris Friedt <chris@fr4.co>
Some PSA configs were missing for DTLS to work in LwM2M interop tests.
CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID was defined twice, so remove
redundant entry.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Aligned with changes in pytest plugin, where added support
of multiple connections from one device.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
The test fails on 64bit targets running out of heap.
Let's just increase it.
Circumstantially it started failing after
d5982f0f89
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Socket dispatcher should create a native TLS socket with a native
underlying socket even if the socket is only bound to a native interface,
it shouldn't be needed to call ZSOCK_TLS_NATIVE specifically. This works
just fine, so add a test case for this scenario to make sure it remains
that way.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
It seems no other test (or sample) was building this.
So let's enable them in this test, so we at least build test them
somewhere.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In d45cd6716b the mayority of the
Zephyr codebased was changed to use the Zephyr native net_ prefixed
types, but some were forgotten.
Without this fix/change the code still builds as we are by now setting
CONFIG_NET_NAMESPACE_COMPAT_MODE. But when this is not set, things
fail to build.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Since the shell (and its use of sys_getopt) does not have any dependency
on the POSIX_API anymore, we do not need to disable it when we disable
the POSIX_API compatibility layer.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.
Duplicates inside different #ifdef branches are preserved
as they may be intentional.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The MQTT-SN v1.2 [0] specification specified the GwAddr as follows:
The GwAdd field has a variable length and contains the address of a GW. Its
depends on the network over which MQTT-SN operates and is indicated in the
first octet of this field. For example, in a ZigBee network the network
address is 2-octet long.
It specifies neither the possible values for the first octet, nor the
format of the network-specific address that follows. Thus, the
specification is incomplete and this functionality unusable.
I also wasn't able to find any implementation which implements a gwinfo
message where the address length is not zero. This includes
https://github.com/eclipse-paho/paho.mqtt-sn.embedded-c .
The current implementation in Zephyr simply copies a `struct sockaddr`
into GwAddr. This is a bad idea for many reasons, the most important one
being that the format is not even specified by POSIX [1]. They only say,
which defines must exist, not what their values are. And in fact, these
even differ between Zephyr and Linux.
Thus, I think it's best to remove the implementation to prevent people from
using this, which may even lead to memory safety issues, depending on the
length of CONFIG_MQTT_SN_LIB_MAX_ADDR_SIZE. If we were to receive an
updated specification, all we'd have to do is to convert between `struct
sockaddr` and mqtt-sn addresses both ways.
[0] https://groups.oasis-open.org/higherlogic/ws/public/download/66091/MQTT-SN_spec_v1.2.pdf
[1] https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_socket.h.html
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
When the response comes from a gateway, the address length is 0. I renamed
the test which tests a gwinfo from another client to make this more clear.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Also build the latency monitor support code.
As a sideeffect, we run out of bits in the kernel objects per thread
permissions tracking field. So let's increase it to 6 bytes.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Replace legacy Mbed TLS crypto support with PSA API.
RSA key exchange dependency was removed because all certificates and
keys used in the test are EC.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This is done to avoid this error
Too many thread objects (38)
Increase CONFIG_MAX_THREAD_BYTES to 5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The platform_allow line in common: overrides the setting in
individual tests, so add the platform_allow line to each test
separately so that OpenThread tests are run with proper platform.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
It's been periodically reported that the default connect timeout shared
with regular TCP sockets (3 seconds) is not enough for the TLS handshake
to complete. Therefore, it'd make sense to increase the default value
for TLS sockets specifically. However currently the option is used by
both TCP and TLS connections, which makes this impractical.
Therefore, introduce a separate CONFIG_NET_SOCKETS_TLS_CONNECT_TIMEOUT
Kconfig option for TLS sockets specifically, and set the default to 10
seconds. For samples/tests that modified the old option for TLS-specific
purpose, update the new option value as well.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Verify that dns_unpack_name() generates a valid DNS name when unpacking
records and that it returns an error in case of overflow.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Verify that if the application triggers asynchronous connect with
non-blocking sockets, and starts to monitor the socket with poll()
immediately but with POLLIN only set, the poll() is still able to
report an error if the connection fails. As no POLLOUT is monitored, the
application won't know when the connection is done in case of success,
but it should still be notified in case of errors.
To achieve this, modify the existing test case to allow to specify what
events should be monitored by poll(). Additionally monitor the time
spent in poll() - an error should cause poll() to exit immediately,
not after the specified timeout.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
According to the compiler, the ret variable might be uninitialized
in the function (looks like a false positive but fix it anyway).
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Some CID-related functionalities of the DTLS sockets are conditionally
compiled, make sure that code is built with tests/net/all test suite.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The file descriptor table is used in every area that expects to work on
files through descriptor indices. It can only be operated on through
functions whose names indicate a relationship with ZVFS (`zvfs_*fd*`).
The integer file descriptor mechanism shouldn't be separate from ZVFS.
This will make cooperation between different file access APIs much
simpler. This commit also makes preparations for the fdtable becoming
optional.
Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com>
Make sure we test coap client/server, MQTT SN, telnet and
logging network backend when testing all network options.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
We need certain network related Posix header files so that the
network tests using Posix symbols compiles ok.
Previously the Posix symbols were introduced by network stack
automatically, but that is no longer the case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
It shouldn't be needed to execute UDP sockets tests in a fixed order
(currently enforced by embedding the test number into the test case
name). In fact, this was only needed, as two test cases worked as
prerequisites for other tests, that should've been done in the setup()
function though.
Therefore, consolidate the two test cases which pre-configured the test
interface into a proper setup() function executed before the test
suite, and get rid of the confusing test case numbering.
There also was a race in TX time test due to incorrect mutex use, so fix
that by using semaphore instead.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>