Commit graph

16700 commits

Author SHA1 Message Date
Jonathan Rico
edeb529c9f Bluetooth: Host: Add advertising events stress test
More information in the test description.

Why: At the time of writing, this test exposes a bug in the Bluetooth stack
where all the RX buffers are in use, and the controller driver fails to
synchronously allocate a command response buffer.

This is manifested in an assertion failure in `hci_common.c`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-09-17 17:45:50 +01:00
Rubin Gerritsen
f6712c43d4 tests: Bluetooth: Add some more tests for bt_le_create_conn()
Adds coverage for attempting to connect while already connecting
or connecting to a device that already exists.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-09-17 09:09:56 -05:00
Yuval Peress
53dd8e884b cpp: Fix warnings
Fix warnings caught by running west build. Another fix will have to go
in to see why twister was missing these.

#78348

Signed-off-by: Yuval Peress <peress@google.com>
2024-09-17 09:03:55 -05:00
Anas Nashif
ac808d13dc doc: kernel: define additional doxygen groups
Some groups are used by multiple files/tests, define them globally in
doc/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-17 05:24:09 -04:00
Anas Nashif
3744dd828f tests: kernel: fix test groups for semaphore/mutex
define groups for semaphores and mutexes

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-17 05:24:09 -04:00
Ingar Kulbrandstad
d41e834bbe tests: bluetooth: mesh: Removed native_posix and renamed sim_ids
Removed deprecated native_posix as test platform.
Added unique sim_ids for tests with the psa as a overlay.
Fixed clang-format issues.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev
e0f5f3acf4 bluetooth: mesh: brg_cfg_srv: ignore message with invalid parameters
When a message with invalid parameters is received, we must ignore it.

In this commit we check invalid parameters first.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev
ed051cddb9 tests: bluetooth: mesh: add subnet bridge bsim tests
This commit adds the following tests:
- Simple test for bridging table
- Test bridging table state changes
- Test persistence storage of subnet bridge
- Test IV Index update with subnet bridge
- Test network key removal for subnet bridge

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev
b267da33d6 tests: bluetooth: mesh_shell: add brg_cfg_srv instance
This commit adds Bridge Configuration Server to the mesh_shell sample.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev
76f015b61f bluetooth: mesh: brg_cfg_cli: copy buf in synchronous api
When a synchronous API is used, the content of `buf` will not be
valid by the time the thread that called the synchronous API is woken up
again.

Therefore, the simplest way to solve this is when a user allocates the
buffer which will be filled up with the content of the buffer passed to
the model callback.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev
abf02719c4 bluetooth: mesh: rpl: fix rpl for subnet bridge
The initial implementation of RPL check for Subnet Bridge wasn't fully
correct. It decides whether to relay or not a PDU based on RPL of only
received messages. However, the spec section 3.9.8 says:

```
In addition, a Subnet Bridge node shall implement replay protection for
all Access and Transport Control messages that are sent to bridged
subnets.

A Subnet Bridge node shall maintain the most recent IVISeq value for
each source address authorized to send messages to bridged subnets.
Messages received by the Subnet Bridge node with the IVISeq value less
than or equal to the last stored value from that source address shall
be discarded immediately upon reception. When a message is retransmitted
to a bridged subnet, the stored IVISeq value shall be updated. In this
way, bridged subnets are protected against replay attacks from other
subnets.
```

This was noticed with MESH/NODE/SBR/NET/BV-02-C test. It passes when
PTS misses the message at step 3 and 4, and fails when PTS manages to
receive the message.

This commit fixes the wrong behavior by removing argument for
`bt_mesh_rpl_check` function making store a new message and bypassing
`local_match` check in case of Subnet Bridge node.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev
f06f69a8b8 bluetooth: mesh: brg_cfg: store tbl when changed only
Though nvs backend checks whether the data passed to it is identical to
the stored one, this isn't guaranteed by other the settings api. We can
also avoid going into the settings subsystem since we know what was
actually changed.

This commit adds 2 flags that allow to control whether Subnet Bridge
or Bridging Table states were changed and skips storing if the certain
state was not changed.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Ingar Kulbrandstad
21fa5c81d2 Bluetooth: Tester: Mesh: Added support for Bridge client/server
Added support for the Bridge Configuration client and server
to the tester application.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Omkar Kulkarni
8210d2da1b Bluetooth: Mesh: Populate Bridge Config Server
Adds implementation for the Bridge Configuration Server model.

Updates `brg_cfg` module to add sanity check for
bt_mesh_brg_cfg_tbl_remove() API. Also, updates the unit test
accordingly.

Adds documentation for the Bridge Configuration Server model

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Håvard Reierstad
50a4c2d17a Bluetooth: Mesh: Add brg_cfg_cli commands to shell
Adds the Bridge Configuration Client commands to Mesh shell.

Unifies documentation for shell Kconfig options.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Omkar Kulkarni
092f808ea4 Bluetooth: Mesh: Adds subnet bridge states
The `brg_cfg` module implements the states needed for subnet bridge
feature. It provides two states - enable state, and bridging table
state. APIs are provided to access and modify the states. The module
handles responsibility of persistence of the states.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Ingar Kulbrandstad
709c006b58 Bluetooth: Mesh: Bridge Configuration Client/Server API
Adding documentation and function calles for the API's
in Bridge Configuration Client model and Bridge
Configuration Server model.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Emil Gydesen
eb22e1fc98 Bluetooth: TBS: Make GTBS mandatory
Any places that checked for GTBS is now always enabled
as GTBS is mandatory to support, and the Kconfig option
was removed.

Also removed a duplicate Kconfig option for TBS,
BT_TBS_SERVICE_COUNT, as it was unused.

The other Kconfig option BT_TBS_BEARER_COUNT is used
instead exclusively to set it if needed.

Since GTBS can now exist alone, it must also
support having its own calls and other values.
This means that the GTBS and TBS instances now share
the same underlying struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-17 09:45:48 +02:00
Anas Nashif
6cf12c1aa9 tests: gen_isr_table: remove misnamed platform
This platform does not exist, causing ci failures due to recent
additional checks added.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-16 14:53:58 -04:00
Fabrice DJIATSA
f7ebd61ae9 tests: drivers: dac: dac_api: src: update dac_api driver test
-add nucleo_u083rc and stm32u083c_dk  boards for testbench purpose.
- add min_ram property to skip test on boards with little ram size.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-16 20:19:01 +02:00
Nathan Olff
eb3f718b2c tests: drivers: add fracn test for stm32h7 clock configuration tests
add overlay to use fracn with HSI in clock configuration tests for
stm32h7

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2024-09-16 20:18:54 +02:00
Keith Packard
962e42cf1d tests, samples: Define _POSIX_C_SOURCE where needed
Various tests and samples use POSIX-only functions. Define _POSIX_C_SOURCE
to ensure they are visible.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-09-16 20:17:35 +02:00
Keith Packard
6e1210a09e tests/c_lib: Don't test undefined behavior of asctime and asctime_r
These functions requre non-null parameters; passing them NULL
values is undefined. Remove tests which are not valid.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-09-16 20:17:35 +02:00
Fabian Blatz
20b218985c tests: drivers: stepper: stepper_api: Fix UAF of poll signal
The test_target_position test used a stack allocated `poll_signal` which is
kept as a refrence inside the gpio driver. Since the time for polling the
signal was chosen pretty narrow, the function exited with the driver still
trying to signal the stack allocated value upon movement completion.
Fix by adding the structs to the test fixture and increase the timeout.

Resolves #78466.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-09-16 20:17:01 +02:00
Keith Packard
d7aaf9bee3 tests/c_lib: Ensure TZ value is UTC for ctime/ctime_r tests
When testing these functions with CONFIG_NATIVE_LIBC, force the TZ
environment variable to UTC to ensure they produce the expected results.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-09-16 13:51:50 +02:00
Anas Nashif
0bca19588a tests: remove misnamed platforms from platform_exclude
Few tests with wrongly names platforms. This section is now being
verified for correctness like all others.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-16 10:07:51 +02:00
Sean Madigan
aa67cb238a bluetooth: shell: Add CS to BT shell with set default settings command
Use a new file and command for this where all CS commands
can live.

Added support for bt_cs_set_default_settings command.

Added test case where shell is built with CS to ensure code
is built in CI.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2024-09-16 10:02:58 +02:00
Yong Cong Sin
475ff826d6 drivers: intc: plic: fix IRQ on every hart regardless of mapping
Allow IRQs to work on every hart regardless of the mapping
of the contexts.

Add a test to validate the hart-context mapping.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-16 10:02:08 +02:00
Benjamin Cabé
df294e34e1 doc: sphinx-lint: fix bad usage of "default role"
Fixes bad usage of single backticks in lieu of double backticks for
rendering inline literals, or simple '*' for italics.

When appropriate, a better construct than double backticks has been
selected (ex. :file:, :kconfig:option:, :c:func:, ...), or proper :ref:
have been used if the original intention was to have a link.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-13 11:42:51 -05:00
Tom Burdick
db22e1a3f0 tests: Fix the platform exclude board name
qemu_xtensa_dc233c didn't pan out like I expected, needed to be
qemu_xtensa/dc233c/mmu to be excluded.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-09-12 17:05:24 -04:00
Valerio Setti
91fa8a2b63 tests: net: socket_tls: test different TLS configurations with sockets
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>
2024-09-12 13:31:20 -04:00
Bartosz Miller
bb3efaa3f2 tests: drivers: Verify NRF GPIO driver with GPIO_NRFX_INTERRUPT=n
Verify NRF GPIO driver with NRFX interrupts disabled.
Verify that driver handles properly 'get' and 'set' api methods.
When calling interrupt enable driver should report
'function not implemented' error.

Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2024-09-12 13:03:21 -04:00
Guennadi Liakhovetski
96852bc45e llext: add a test for inter-extension linking
This test uses two LLEXT objects: one of them exports a symbol and
the other one calls the exported function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 13:02:59 -04:00
Guennadi Liakhovetski
697c5fd80e llext: test-simple: replace ARRAY_SIZE() with sizeof()
When identifying the size of an extension image we simply need its
size in bytes, not the number of array elements, that contain it.
Both happen to return the same value, because we use arrays of bytes,
but using sizeof() is clearer.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 13:02:59 -04:00
Emil Gydesen
ae6c20d324 Bluetooth: BAP: BA: Replace bools with atomic
Replace the boolean values for the BAP Broadcast Assistant
with an atomic value. This prevents a rare, but possible,
race condition.

The busy flag has been replaced with 3 atomic values which
provide better granularity in error handling, and allows for
some concurrent write and read requests.

To describe the new behavior, the return values in the documentation
has been updated, and the error handling in the API
functions has improved.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-12 13:01:48 -04:00
Yong Cong Sin
081aa2fc94 tests: build_all: plic: install second instance to 0x8(uei)
Install the second instance to 0x8(uei), because MSI is installed
to 0x3(msi) when SMP is enabled.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-12 13:01:37 -04:00
Hake Huang
826235c5c6 tests: gpio_basic_api: using header to unify tests
using arduino header to simplify test settings.
arduino_header D2 and D3 can be used by default.
alt: 118 platforms are enabled for this test.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-09-12 14:50:07 +02:00
Adam Wojasinski
3082b9c509 llext: Add aarch64 to LLEXT tests
Include `qemu_cortex_a53` (ARMv8-A ISA) target in intergation platforms
for LLEXT subsys tests.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-09-12 14:48:55 +02:00
Théo Battrel
54d1bb73dc Tests: bsim: Use correct compilation folder
If a test was written outside 'app_root' the 'app' path may contain
previous directory ('..') which would lead to the compilation file being
written outside the 'WORK_DIR'.

Fix the issue by checking if the 'app' is inside 'app_root', if it's
not, use the absolute path to the app for creating the 'this_dir'
variable.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-09-12 14:47:49 +02:00
Adam Kondraciuk
cc54480381 tests: drivers: nrf_grtc: Add nRF54H20 PPR target
Add nRF54H20 cpu PPR target to GRTC tests.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-09-12 10:09:19 +02:00
Karthikeyan Krishnasamy
12e8bc7f82 tests: posix: fs: add testsuite for open truncate
add tests for posix open() with truncate flag

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-09-12 10:02:57 +02:00
Valerio Setti
7fadfeec7c mbedtls: do not set PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC
Mbed TLS automatically sets PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC
whenever "_IMPORT || _EXPORT || _GENERATE || _DERIVE" operations
are set. Therefore we just set the proper actions where required.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-09-12 10:02:40 +02:00
Nicolas Pitre
7e847eca25 tests: demand_paging: add a test for on-demand sections
Exercises linker placement, the ondemand backing store, demand paging.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-11 20:18:51 -04:00
Nicolas Pitre
78cd836e2f tests: demand_paging: move existing test to a mem_map subdirectory
This test concerns itself mainly with anonymous memory mappings.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-11 20:18:51 -04:00
Nicolas Pitre
c99371e486 arm64: demand paging is supported
Test configs for UP and SMP are also included.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-11 20:18:51 -04:00
Sadik Ozer
6e36e9bfae tests: drivers: counter: Enable counter test for MAX32666
This commit enables counter test for MAX32666 boards.

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-11 20:18:33 -04:00
Anıl Kara
7f5fa21333 tests: drivers: counter: Enable counter test for MAX32680EVKIT
Add overlay files are added to run counter_basic_api test on
MAX32680EVKIT.

Signed-off-by: Anıl Kara <anil.kara@analog.com>
2024-09-11 20:18:33 -04:00
Sadik Ozer
6a34baae16 tests: drivers: counter: Enable counter test for MAX32672
This commit enables counter test for MAX32672 board.

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-11 20:18:33 -04:00
Sadik Ozer
10f507b7e4 tests: drivers: counter: Enable counter test for MAX32670
This commit enables counter test for MAX32670 board.

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-11 20:18:33 -04:00
Sadik Ozer
a24884a061 tests: drivers: counter: Enable counter test for MAX3290
This commit enables counter test for MAX32690evkit board.

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-11 20:18:33 -04:00