Commit graph

16700 commits

Author SHA1 Message Date
Luis Ubieda
ae114f175f tests: modem_ubx: Fix clang failure by removing static keyword
Reported on latest clang-build run (250530).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-05-31 05:56:01 -04:00
Declan Snyder
481711e5a6 tests: spi_loopback: Fix fail handle of thread test
Right now the thread test case does not handle when the test fails, the
test will be aborted by ztest in one of the spawned threads, and cause
desynchronization which messes up the rest of the test. Fix by
synchronizing in the case of fails and return fail from main test thread
instead of the spawned ones.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-05-31 03:36:33 +02:00
Declan Snyder
c10c13b961 tests: spi_loopback: Handle overflow of print latency
The test that checks latency also prints a measurement of the latency
which is just a visual information for the test output. However, this
print uses a subtraction which can have an overflow in the case where
the kernel timer is behind, so just clamp to 0 in that case where there
is an overflow. This change does not affect the test pass/fail logic.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-05-31 03:36:33 +02:00
Grzegorz Chwierut
c6a41a47d9 tests: boot: Update imgtool path in west_sign_wrapper
Fixes tests/boot/with_mcumgr in case, when imgtool is
not installed. Added imgtool path to west sign wrapper.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-05-30 19:40:44 +02:00
Dipak Shetty
f5d1803eca tests: drivers: build_all: stepper: add uart configuration for tmc51xx
Now added a node to test builds with tmc51xx on uart.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
2025-05-30 19:40:34 +02:00
Luis Ubieda
94a7f028ef ubx: Refactor codebase in order to improve usability
During testing and code inspection, there were various anti-patterns
on this (and U-Blox driver) codebase(s), including obfuscation, and
lack of data validation. This made it increasingly difficult to
introduce further variants of u-blox GNSS modems.

With this patch, both the UBX modem and the M8 driver have been
refactored to ease the reliability and maintainability of these
codebases. Here are some highlights:

WRT UBX modem:
- Helper macros to easily create UBX frames, (including checksum
calculation), at compile time; thus, making it easier to extend UBX
commands.
- Logic validation by the inclusion of the modem_ubx testsuite, used to
refactor the code through TDD.
- Ability to receive unsolicited messages, in order to enable U-Blox
drivers to rely on modem_ubx to transceive all commands, and avoid
hopping between modem_ubx and modem_chat.

WRT M8 driver:
- Remove GNSS specific protocol header files. Instead, unify them under
modem/ubx/protocol.h. Background: After a survey and looking at ubxlib
SDK I conclude the UBX protocol is by definition a GNSS protocol (there
are non-GNSS u-blox modems, but they're not interfaced through UBX
protocol).
- Establish pattern to create and send/receive commands using new
foundations on modem ubx.
- Remove dependency of Modem chat, and instead use UBX unsolicited
messages to get Navigation and Satellites data.
- Switch from the auto-baudrate detection pattern to a pattern of
transitioning between an initial known baudrate to a desired baudrate,
in order to improve initialization time.
- Add dts property to configure default fix-rate.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-05-30 19:40:19 +02:00
Jordan Yates
3aa61a9503 tests: wifi: nrf_wifi: reduce config overrides
Reduce the number of config overrides needed for the various testcases
by only enabling the options if needed in the first place.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-05-30 19:40:01 +02:00
Bjarki Arge Andreasen
3d24070890 kernel: work: add k_work_queue_run()
Add the ability to block and process a work queue by invoking
`k_work_queue_run` from an existing thread. This can be particularly useful
for using the main thread to process work items, in the same vein as the
system work queue, but from a lower priority/preemptible thread.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2025-05-30 16:37:02 +02:00
Adrian Gielniewski
e04f679093 openthread: Add Kconfigs for packet TX time and carrier functions
Add new Kconfig options to enable platform-specific features in
OpenThread:

- CONFIG_OPENTHREAD_PLATFORM_PKT_TXTIME enables support for packet TX
time when CONFIG_NET_PKT_TXTIME is selected.
- CONFIG_OPENTHREAD_PLATFORM_CARRIER_FUNCTIONS enables modulated and
continuous carrier functions when CONFIG_OPENTHREAD_DIAG and
CONFIG_IEEE802154_CARRIER_FUNCTIONS are enabled.

Update preprocessor conditionals to use the new options instead of
relying directly on CONFIG_NET_PKT_TXTIME and
CONFIG_IEEE802154_CARRIER_FUNCTIONS.

This change improves configurability and allows to reuse the platform
implementation when not using Zephyr networking.

Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
2025-05-30 16:35:39 +02:00
Sebastian Głąb
af434877ec tests: boards: nrf: i2s: i2s_divider: Confirm CLK divider value
Frame rate selected by the user may not be obtained due to
PCLK frequency and finite number of clock divider values.
In such case, driver shall select divider that results in
frame clock rate closest to the requested value.
There was a bug that was discarding perfect match divider.

Add test which confirms correct clock divider selection.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-05-30 16:35:22 +02:00
Sebastian Głąb
b9916322cb tests: drivers: i2s: i2s_speed: Fix typo in Kconfig file
Fix typo in the Kconfig file.
Change 'per socond' to 'per second'.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-05-30 16:35:22 +02:00
Jiawei Yang
b2340babdf tests: Bluetooth: BR: Add test suite gap_client
IUT works as a Bluetooth GAP Client. The peer device (tester) is
configured to respond to inquiries and process connection requests.

Add tests to verify GAP client functionality for inquiry, connection,
and disconnection scenarios.

In the test suite, there are six test cases:
Case 1: General Inquiry followed by Connection and Active Disconnection.
Verifies that DUT can perform general inquiry, establish connection, and
actively disconnect from tester.
Case 2: General Inquiry followed by Connection and Passive
Disconnection. Verifies that DUT can perform general inquiry, establish
connection, and handle disconnection initiated by tester.
Case 3: General Inquiry followed by Rejected Connection Request.
Verifies that DUT can perform general inquiry and handle connection
rejection from tester.
Case 4: Limited Inquiry followed by Connection and Active Disconnection.
Verifies that DUT can perform limited inquiry, establish connection, and
actively disconnect from tester.
Case 5: Limited Inquiry followed by Connection and Passive
Disconnection. Verifies that DUT can perform limited inquiry, establish
connection, and handle disconnection initiated by tester.
Case 6: Limited Inquiry followed by Rejected Connection Request.
Verifies that DUT can perform limited inquiry and handle connection
rejection from tester.

Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
2025-05-29 20:21:50 -04:00
Jiawei Yang
38a6fc5e6f tests: Bluetooth: BR: Add GAP Server role test suite
IUT works as a GAP Server (Peripheral) in the Bluetooth system. The peer
device, GAP Client,
is a PC running Bumble as a test tool.

This test suite implements the following test cases:
Case 1, Non-connectable Mode Testing. Verifies DUT can operate in
non-connectable mode without allowing connections.
Case 2, Connectable Non-discoverable Mode with Active Disconnection.
Verifies DUT can accept connections and initiate disconnection.
Case 3, Connectable Non-discoverable Mode with Passive Disconnection.
Verifies DUT can accept connections and handle passive disconnection.
Case 4, Connectable Non-discoverable Mode with Connection Rejection.
Verifies DUT can reject connection requests.
Case 5, Limited Discoverable Mode with Active Disconnection. Verifies
DUT in limited discoverable mode can be discovered, accept connections
and initiate disconnection.
Case 6, Limited Discoverable Mode with Passive Disconnection. Verifies
DUT can be discovered, accept connections and handle passive
disconnection.
Case 7, Limited Discoverable Mode with Connection Rejection. Verifies
DUT can be discovered but reject connection requests.
Case 8, General Discoverable Mode with Active Disconnection. Verifies
DUT in general discoverable mode can be discovered, accept connections
and initiate disconnection.
Case 9, General Discoverable Mode with Passive Disconnection. Verifies
DUT can be discovered, accept connections and handle passive
disconnection.
Case 10, General Discoverable Mode with Connection Rejection. Verifies
DUT can be discovered but reject connection requests.

Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
2025-05-29 20:21:40 -04:00
Andrej Butok
d34cb70449 tests: littlefs: add mimxrt1064/1160-evk support
Adds support for mimxrt1064-evk and mimxrt1160-evk boards
to the littlefs test.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-05-29 20:19:05 -04:00
Daniel Leung
8970009e39 tests: logging/log_syst: fix unused var warnings
When CONFIG_ZTEST_ASSERT_VERBOS is 0, syst_headers_name[] is
not exactly being used by zassert_mem_equal(). Mark it as
__maybe_unused to avoid compiler warnings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-05-29 20:18:34 -04:00
Daniel Leung
ee8bb8d473 tests: timer_api: unused var when CONFIG_ZTEST_ASSERT_VERBOSE=0
When CONFIG_ZTEST_ASSERT_VERBOSE is 0, the array round_s is not
being used by zassert_true(). So mark it __maybe_unused to
avoid compiler warnings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-05-29 20:18:34 -04:00
Dominik Ermel
53c79c61b9 tests/flash_map: Allow custom maps to opt out from some scenarios
The commit modifies the Flash Map test, providing Kconfigs that
allow to opt out from testing disabled partitions and testing
DTS node access.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-05-29 23:26:04 +02:00
Alberto Escolar Piedras
13fa0c5ebc tests/c_lib/common/src/test_sqrt: Fix code compliance issues
Fix several code compliance issues.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-29 15:17:32 +01:00
Alberto Escolar Piedras
37089cfc03 tests/c_lib/common/src/test_sqrt: Fix when double is not 64 bits
The combination of
3231269244
74c9e7afab
broke this test, when __SIZEOF_DOUBLE__ != 8.
In that case the test will fail to build,
as the variables the code uses are left ifdef'ed out.

Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-29 15:17:32 +01:00
Joel Guittet
9d4530fb79 drivers: counter: introduce counter node in esp32 timers
Add counter device tree node to the esp32 timers.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2025-05-29 08:41:59 +02:00
Sreeram Tatapudi
b3067bde98 board: infineon: add XMC7200 Eval board support
- Support for kit_xmc72_evk

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
Signed-off-by: Yurii Lozynskyi <yurii.lozynskyi@infineon.com>
2025-05-28 21:29:20 +02:00
Brandon Allen
979933cfb4 drivers: current_sense_amplifier: add zero-current-voltage binding
some current sense amplifiers have a non zero offset voltage
that correlates to zero current. adding this offset voltage binding
allows the driver to be used with this type of circuitry.

Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
2025-05-28 17:48:47 +02:00
Furkan Akkiz
43a1e68b56 tests: subsys: pm: Enable power_mgmt_soc for MAX78002EVKIT
Enables power management test for MAX78002EVKIT.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2025-05-28 01:46:50 +02:00
Sadik Ozer
ec9ac2308a tests: subsysm: pm: Enable power_mgmt_soc for MAX32655
This commit enables power_mgmt_soc test for MAX32655 boards
- max32655evkit
- max32655fthr

RTC clocked in most low power modes so that this timer
is linked with idle timer. By this way device able to wakeup
from low power modes.

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2025-05-28 01:46:50 +02:00
Sadik Ozer
6f98b8cbbe tests: subsysm: pm: Enable power_mgmt_soc for MAX32690
This commit enables power_mgmt_soc test for MAX32690 board

Low power timer is used as idle timer that will wakeup device
from sleep modes. Lowpower timer clocked with RTC clock which
always on.

RTC can be used as idle clock timer too, in that case below
line need to be added in overlay file

/ {
    chosen {
    	zephyr,cortex-m-idle-timer = &rtc;
    };
};

&rtc {
    status = okay;
    wakeup-source;
};

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2025-05-28 01:46:50 +02:00
Nathan Olff
2ac316465f tests: drivers: sensor: add ad2s1210 to build_all test
add ad2s1210 to build_all test in spi.dtsi

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2025-05-27 23:43:56 +02:00
Magpie Embedded
74ef345dc1 drivers: sensor: Add sensor driver for BH1790
This commit adds a driver for the BH1790 Heart Rate Monitor IC.

Based on the approach used by the MAX30101 driver, an existing optical
heart rate sensor with a sample in Zephyr.

Signed-off-by: Magpie Embedded <magpieembedded@gmail.com>
2025-05-27 23:43:43 +02:00
Robert Lubos
17c00ce868 tests: net: http_client: Increase ztest stack size
The ztest stack was too small on some platforms (e.g. nRF52840), so
increase the stack size.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-05-27 16:49:01 +02:00
Valerio Setti
a03b06fd04 tests: modules: uoscore: remove unnecessary dependencies
PSA Crypto dependencies are automatically selected in the uOSCORE's
Kconfig.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-05-27 16:45:13 +02:00
Mark Wang
38fce64e6a bluetooth: shell: the setting is forced as disabled for mimxrt1170_evkb
delete the default configs of disabling the setting on mimxrt1170_evkb.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-05-27 16:44:45 +02:00
Tomi Fontanilles
001d054bc3 secure_storage: its: make definitions available outside of transform.h
Some ITS store module implementations may make use of them.
This is the case of the custom one in the
secure_storage.psa.its.secure_storage.custom.store test.

Instead of making transform.h conditionally available, move the definitions
to common.h and simply make them available whenever the ITS transform
module is enabled.

At the same time, remove unneeded/redundant includes/build asserts.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-05-27 15:46:37 +02:00
Emil Gydesen
52f089af23 Bluetooth: CSIP: Set member: Fix issue with re-registration
The bt_csip_set_member_register kept a counter that was not
decreased when bt_csip_set_member_unregister was called.
This meant that we could register and unregister CSIS,
but we could not re-register once it had been unregistered.

This commit fixes this by removing the counter and instead
rely on the service instance state, which also requires restoring
the original service definition, as well as adding a test that would
have failed with the previous version.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-05-27 14:45:15 +02:00
Flavio Ceolin
437b56d22e pm: device_runtime: Make async optional
Async now uses its own work queue, which means it consumes more
resources. Since not all applications need the async API, we can make
it optional without any penalty for those applications.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-05-27 14:45:07 +02:00
Flavio Ceolin
64e38bab55 pm: device_runtime: Allow to use a dedicated wq
Device runtime is using the system workqueue to do operations
that are mostly blockers (suspend a device). This should not happen.

This commit adds an option to use dedicated queue for the device runtime
async operations.

The test for this API was assuming that the system workqueue
priority (which is cooperative) so we need to change the test priority
to be lower than the device runtime workqueue priority.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-05-27 14:45:07 +02:00
Emil Gydesen
60e9f99582 tests: Bluetooth: Split CAP and GMAP AC tests into separate scripts
This commit splits the CAP and GMAP audio configuration (AC)
tests into separate scripts. The purpose of this is to reduce
the runtime of the individual scripts (some, like the cap_ac_11,
tests takes a long time to run all combinations).
This split also improves support for running them in parallel.

An additional, positive, side effect of this is that the logs will
also be smaller per run.

The new scripts can be run directly, or via the e.g. _cap_ac_X.sh
scripts that run entire audio configuration for all presets.

The design of how the parameters are passed around, are based
on variable instead of function arguments. Effectively they can
be used for the same thing, but variables have the advantage
that it is easier to deal with longer names,
and that any of the test scripts can be called with additional
arguments that can, when using variables, easily be forwarded
to the call to Execute for the PHY in the
_ac_common.sh.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-05-27 12:01:59 +01:00
The Nguyen
47f7fc9a45 tests: counter: add support for renesas,ra-agt-counter
Enable test support for renesas,ra-agt-counter

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2025-05-27 11:50:37 +02:00
The Nguyen
37b4cff8f2 tests: counter: correct checkpoint for downward counter
Modify the expected ticks check to adapt with a downward counter
instance

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2025-05-27 11:50:37 +02:00
Jianxiong Gu
a505a43626 tests: drivers: Add FUSB307 driver
Add a build test to verify fusb307 driver builds correctly.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-05-27 11:50:29 +02:00
Krzysztof Chruściński
5acd29e651 tests: all: Fix remaining issues reported by string validation
Fix issues reported by string validation which was added to strings
used in zassert macros.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-05-27 09:16:08 +02:00
Keith Packard
3231269244 tests/c_lib: Skip double sqrt test when double is not 64 bits
This test only works for 64-bit values. On targets which use 32 bits for
double, skip this version. The float test will check the 32-bit math for
that.

This is the 'nicer' version of this fix which uses sizeof rather than
relying on __SIZEOF_DOUBLE__.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-05-26 19:40:06 -04:00
Bjarki Arge Andreasen
d265dadf1c tests: drivers: spi: spi_loopback: skip tests if invalid config
The spi_loopback_transceive() helper currently only prints a
message if a configuration is invalid, continuing the test
case as if it succeeded. This results in the test case using the
helper trying to validate the result from a spi transaction that
was skipped.

Fix this by explicitly skipping the test using the ztest
framework's ztest_test_skip() function, which skips the entire
test case.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-05-26 23:35:42 +02:00
Andrzej Głąbek
da74ae83cf tests: arch: arm_interrupt: Fix stack overflows in .no_optimizations
With e337b7b65d, the test started to
fail with stack overflows in the no_optimizations scenario, so give
the ztest thread a little more space.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-05-26 17:59:34 +02:00
Pavel Vasilyev
9cb00bee6a tests: bsim: bluetooth: mesh: Remove bsim tests with TinyCrypt
As TinyCrypt gets deprecated, we need to remove all bsim tests that use
it. This commit switches all Bluetooth mesh bsim tests to PSA as a
default crypto backend.

This includes:
- removing `CONFIG_BT_MESH_USES_TINYCRYPT` as PSA is default crypto
  backend for mesh. `CONFIG_BT_MESH_USES_MBEDTLS_PSA` is not required to
  be enabled;
- merging `overlay_psa.conf` into `prj.conf` as this configuration
  becomes default for all mesh bsim tests;
- merging `overlay_ss.conf` into `overlay_pst.conf` as secure storage is
  required for running persistent storage bsim tests with PSA;

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-05-26 13:17:08 +02:00
Pavel Vasilyev
b965128f0f tests: bsim: bluetooth: mesh: Run low latency adv tests with PSA
This is a preparation commit for switching all bsim tests to PSA as
TinyCrypt will be removed soon.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-05-26 13:17:08 +02:00
Sylvio Alves
dba2d7bfc1 tests: counter: add esp32 timer in cancel test case
Allow ESP32 devices to test the scenario where
when alarm should not be triggered after being cancelled.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-05-26 13:16:53 +02:00
Sylvio Alves
d48e10a44c drivers: counter: esp32: remove rtc counter test
As part of counter API updates, RTC timer will be removed from
counter API driver and can be removed from the test list.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-05-26 13:16:53 +02:00
Sebastian Głąb
691816d213 tests: drivers: spi: spi_loopback: Test fast spi on slow GPIO port
Add test configuration where fast SPI instance operates at slow
GPIO port 2.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-05-26 09:19:45 +02:00
Sreeram Tatapudi
968704e6b7 soc: cyw20829: add support of Secure LCS
Enable support of SECURE LCS stage. In this stage, the protection
state is set to “secure”. A secured device will boot only when the
authentication of its flash boot and application code succeeds

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-05-24 06:00:57 +02:00
Keith Packard
3cdc5a9f9a tests/kernel: Disable -Werror when testing deprecated pipe APIs
These two tests are validating that deprecated APIs still work
correctly. Which means they will definitely generate compile warnings.

To disable -Werror while letting it be enabled for other tests, create a
new Kconfig variable, DEPRECATION_TEST and make
COMPILER_WARNINGS_AS_ERRORS depend on that option being unselected. Add
this option to the two tests so that the resulting configuration
disables -Werror.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-23 17:41:40 -04:00
Keith Packard
74c9e7afab tests/c_lib: Skip double sqrt test when double is not 64 bits
This test only works for 64-bit values. On targets which use 32 bits for
double, skip this version. The float test will check the 32-bit math for
that.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-23 17:41:40 -04:00