Commit graph

1929 commits

Author SHA1 Message Date
Greg Leach
2aff40b1b1 tests: Add BL54L15/L15u DVK support
Adds support for the BL54L15 and BL54L15u DVK boards.

Signed-off-by: Greg Leach <greg.leach@ezurio.com>
2025-04-23 15:02:20 +02:00
Christoph Winklhofer
3b29b9fa3b tests: logging: restore userspace testing
Restore userspace testing that was removed with commit 'aa2b72d32a
(tests: logging: remove userspace testing, 2024-04-10)' and reported in
the issue #49213.

For the tests running with threads in user space (with ZTEST_USER),
the memory partitions are configured in the test-suite setup.

Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
2025-04-23 02:15:25 +02:00
Eric Ackermann
f9331854c8 tests: coredump: Add exception for cva6
The nullpointer address (0x0) is mapped to the debug module in cva6,
making it a valid address.
Thus, in the coredump test, trigger an exception using k_panic()
instead.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2025-04-18 17:46:30 +02:00
Krzysztof Chruściński
ecabcf5db5 pm: Use pointers for current and forced power states
Use power state pointers instead of copies which improves performance.

Align power_mgmt_multicore test which was creating pm states in
runtime.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-04-17 21:17:18 +02:00
Jordan Yates
ab34a9df48 zbus: remove k_malloc dependency for ZBUS_RUNTIME_OBSERVERS
Remove the dependency on the system heap existing when enabling
`ZBUS_RUNTIME_OBSERVERS`. Instead the previously allocated memory is
required to be provided to `zbus_chan_add_obs` (which can still be
allocated through malloc).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-14 20:03:09 +02:00
Fin Maaß
1c788ba74d tests: storage: flash_map: add test for flash_area_copy()
add test for flash_area_copy().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-04-14 16:07:35 +02:00
Andrej Butok
c4b92123d3 tests: littlefs: add .conf and .overlay for nxp boards
Adds littlefs test .conf and .overlay files for 18 nxp boards.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-11 22:07:03 +02:00
Jordan Yates
52415ed94f tests: pm: device_driver_init: test state_get during init
Test the value returned by `pm_device_state_get` during device driver
initialisation.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-11 14:53:53 +02:00
Utsav Munendra
12cba7addf portability: cmsis: Bugfix osThreadFlagsWait behavior
The osFlagsWaitAny option is not handled correctly.  It returns once any
flag at all is set, whereas it is supposed to only return once one of
the flags specified in flags is set.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-04-11 06:34:06 +02:00
Tomasz Moń
b3eb6f2d11 usb: device_next: Reduce code size on Full-Speed only configuration
Allow compiler optimizations to remove High-Speed handling code. Knowing
that maximum operating speed is Full-Speed allows to reduce bulk buffers
from 512 to 64 bytes. More RAM optimizations are possible but this
commit only gets the low hanging fruits.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-04-10 12:57:19 +02:00
Andrej Butok
8f2f97ce32 tests: littlefs: fix large partition mounting
Fixes a large partition mounting error
for flashes with erase size > 32KB
(e.g. s26ks512s0 has 256KB erase size).

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-07 15:18:30 +02:00
Anas Nashif
5c8cf1c18c tests: fix various test ids and use existing scheme
Fix IDs and match them to what we have in the MAINTAINERS file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-07 11:22:36 +02:00
Anas Nashif
65551f2a99 tests: move NRFS tests under tests/boards/nrf
This is not a Zephyr subsystem. It is unique to NRF.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-07 11:22:36 +02:00
Andrej Butok
d4682ff5c9 tests: littlefs: fix test_lfs_basic for medium and large partitions
Fixes failed test_lfs_basic for medium partition > 960KB
and for large partition > 3MB.
Flashes with large erase size require larger test partition sizes
(e.g. s26ks512s0 has 256KB erase size).

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-04 18:17:48 +02:00
Tom Hughes
11e3aa8952 tests: mgmt: mcumgr: Disable clang warning
When building with clang it reports:

tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:69:22: error: variable
'test_response_read_data_start' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t test_response_read_data_start[5] = {
                     ^
tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:73:22: error: variable
'test_response_read_data_end' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t test_response_read_data_end[1] = {
                     ^

The values of test_response_read_data_start and
test_response_read_data_end are not actually used anywhere in the tests.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-04-03 21:06:02 +02:00
Riadh Ghaddab
e8e7290aba tests: zms: decrease verbosity
disable by default the LOG_DBG messages

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2025-04-03 17:48:09 +02:00
Dmitrii Golovanov
315ff5dadc tests: logging: logging.thread: add missed LF in logs
Add missed line feed chars at the test's output to fix Ztest's
following status messages corrupted.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2025-04-03 13:16:26 +02:00
Dmitrii Golovanov
125de99433 tests: logging: logging.thread: fix Ztest log corruption
Flush test log messages before waiting for the processing
thread to avoid delayed log output messing with the Ztest's
log output on the test complete.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2025-04-03 13:16:26 +02:00
Dmitrii Golovanov
fc2ea3027d tests: logging: logging.thread: fix race condition
Fix race condition in tests/subsys/logging/log_core_additional
logging.thread test configuration released semaphore before
log message output.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2025-04-03 13:16:26 +02:00
Matthias Hauser
941a5489d3 dts: boards: we: add board Ophelia-IV
add new board Ophelia-IV

Signed-off-by: Matthias Hauser <matthias.hauser@we-online.de>
2025-04-03 13:16:05 +02:00
Andrej Butok
172811b69c tests: nvs: allow to build & run on real platforms
- Allows to build and run NVS tests on real platforms.
- Enables NVS tests designed for a flash-simulator only when
  built for qemu_x86, mps2_an385 or native_sim targets.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-02 12:55:33 +02:00
Andrej Butok
a12f71d5e5 tests: littlefs: fix test_fs_mkfs_custom littlefs_init_cfg() fail
Fixes the littleFS test_fs_mkfs_custom test fail
in littlefs_init_cfg(): "erase size must be multiple of write size".
It happens for platforms with erase size < 2*write size (e.g. lpc55s).

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-02 12:55:18 +02:00
Andrej Butok
b477a60a9c tests: littlefs: fix false negative test_lfs_basic
Fixes the false negative littlefs.test_lfs_basic test that can occur
if the small_partition size > 64KB, and for
platforms with CONFIG_FS_LITTLEFS_PROG_SIZE > 64 (e.g. lpc55s, mcxn).

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-02 12:55:12 +02:00
Tom Hughes
785e36520f tests: subsys: usb: bos: Remove dummy_descriptor struct
When building with clang, it warns:

tests/subsys/usb/bos/src/test_bos.c:24:22: error: variable
'dummy_descriptor' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t dummy_descriptor[] = {
                     ^

Only the size of dummy_descriptor is used, not the contents. Replace the
struct with a constant for the size.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-04-01 11:54:20 +02:00
Andrej Butok
efbe756b62 tests: ext2: reduce ram disk size for small.overlay
- Reduces the ram disc sector count from 400 to 220.
- Saves about 90KB of RAM. All tests still passed.
- Allows platforms with less RAM to run
  the ramdisc_small.overlay test.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-01 11:52:34 +02:00
Arkadiusz Cholewinski
9a4104dc28 tests: power_wakeup_timer: Tests the RTC alarm’s ability to wake the CPU
As above, the test verify the ability to wake up CPU
from the lowest power state. The test has been
prepared for stm32l562e_dk board.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-03-31 08:06:25 +02:00
Arkadiusz Cholewinski
21f7e5fc28 tests: power_residency_time: Tests the residency time of each power state
This test evaluates the residency time of different power states
on the stm32l562e_dk board and calculates the
RMS (Root Mean Square) current for every detected state.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-03-31 08:06:25 +02:00
Arkadiusz Cholewinski
513eb43377 tests: power_states: Verifies the transition to all available power states
During the test, pytest detects each step and calculates
the RMS (Root Mean Square) current for every detected state.
The test then compares the calculated RMS values
against the expected values.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-03-31 08:06:25 +02:00
Tomasz Bursztyka
f17f6af5e6 tests: debug: Add in-memory coredump backend test scenario
Providing the right config options and a new test scenario,
coredump_backends test will run under the in-memory backend.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Anas Nashif
3d4c7736e1 tests: logging: remove inactive test
This test is being skipped for the last 3 years, had lots of issues when
it was introduced. No need to keep it in the tree.

If fixed and made to work again, we can always add it back.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-28 21:52:13 +01:00
Andrej Butok
235a28318b tests: fat_fs_api: fix main-stack overflow for the RAM-disk case
- Fixes the main stack overflow for the fat_fs_api
  RAM disk configuration on real platforms.
- Sets CONFIG_MAIN_STACK_SIZE=3072. By default it is 1KB,
  but the stack usage is about 2KB.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-03-27 14:02:03 +01:00
Seppo Takalo
c78081e5cf modem: modem_cellular: Configurable MTU for CMUX
Allow configuring MTU for CMUX.
Some AT manual and specification define this as a
frame size. Linux ldattach default to 127 bytes,
3GPP TS 27.010 defaults to 31.

We should limit our CMUX frames to a size that
remote end is capable of handling.
Linux silently drops oversized frames.

Also, remove MODEM_CELLULAR_CMUX_MAX_FRAME_SIZE as
this was only limiting a buffer sizes, and resulted
CMUX frames to be capped to same value.
Use MODEM_CMUX_WORK_BUFFER_SIZE and MODEM_CMUX_MTU instead.

Also rename CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZES to
CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZE as it is now
only used as a Chat module. DLCI pipes use
CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-03-24 19:33:07 +01:00
Mahesh Mahadevan
97f1fd832d tests: pm: Enable standby power mode support on NXP RW612 Boards
Enable PM mode 3 on NXP FRDM_RW612 and RD_RW612 boards.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-03-21 09:51:38 +01:00
Krzysztof Chruściński
29bc28a09a tests: debug: cpu_load: Extend filtering with riscv
Allow test execution for riscv since it now supports cpu_load module.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-20 17:14:52 +01:00
Martin Hoff
eeb709927f tests: drivers: add overlay/testcase for silabs xg29_rb4412a board
Add some overlay files for the silabs xg29_rb4412a board to enable tests
on the board. Also add the platform to some testcase.yaml files.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-03-20 17:14:35 +01:00
Luca Burelli
a6584d5b2b llext: add test for section and symbol alignment
Add a test case for the alignment support in loadable extensions. This
test case creates a set of constants with specific alignment requirements
and verifies that they are placed in memory as expected.

Fix the detached section test to use a more standard syntax for the
section attribute, avoiding issues with different toolchains.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-03-17 19:58:15 +01:00
Jukka Rissanen
ac3cb9dac0 net: Change the net_linkaddr struct to not use pointers
Previously the net_linkaddr struct had pointers to the link address.
This is error prone and difficult to handle if cloning the packet as
those pointers can point to wrong place. Mitigate this issue by
allocating the space for link address in net_linkaddr struct. This will
increase the size of the net_pkt by 4 octets for IEEE 802.15.4 where the
link address length is 8, but there no increase in size if link address
is 6 bytes like in Ethernet/Wi-Fi.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-17 16:25:22 +01:00
Utsav Munendra
9379c35dbf portability: cmsis: Clarify Kconfig set max limit on dynamic objects
Clarify that all max limit on RTOS objects set by Kconfig only apply
to objects whose control blocks were dynamically allocated. The
CMSIS-RTOSv2 impl layer itself does not restrict the number of
statically created RTOS objects.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-03-17 02:21:15 +01:00
Utsav Munendra
c006922b22 portability: cmsis: Remove max limit on new statically created threads
Clarify thread Kconfigs to denote the maximum number of dynamically
allocated control blocks and stacks for threads. Allow application to
create any number of threads with statically allocated control block
and stack.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-03-17 02:21:15 +01:00
Daniel Leung
289f80f4a1 tests: zbus/hlp_priority_boost: use 1cpu setup
The zbus hlp_priority_boost test requires thread priority
boosting. If it is running SMP, it is possible that
the message has already been processed before the check
for priority boosting is done, thus failing the test.
So change the test to use 1 CPU only.

Fixes #79197

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-03-14 17:55:41 +01:00
Tomi Fontanilles
b920686812 tests: secure_storage: enable entropy driver if available
On top of enabling and allowing test entropy sources, enable
CONFIG_ENTROPY_GENERATOR so that a real driver and entropy source gets
used if available.
This is needed for some PSA Crypto implementations that have random number
generation conditionally compiled in.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
f50c3d9d26 tests: secure_storage: its: increase stack sizes
Some implementations require more stack than others.
Increase the Ztest and main stack sizes to accommodate them.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
eb1ed1205f secure_storage: use hybrid key store in samples/tests
Use dynamic allocation for key material for
better compatibility as a fully static key store is a new
feature that not all PSA Crypto implementations support.

Explicitly enable CONFIG_MBEDTLS_ENABLE_HEAP to ensure that Mbed TLS uses
heap for the PSA keys' data (instead of failing at runtime).
This will turn off CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS, making the
implementation default to dynamic key slots.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
25ad578694 secure_storage: enable CONFIG_ENTROPY_GENERATOR in samples/tests
Explicitly enable CONFIG_ENTROPY_GENERATOR instead of relying on the
build system's defaults.

This:
- Makes sure the filtering works properly between entropy_driver and
entropy_not_secure test scenarios for the samples.
- Helps with TF-M builds in certain scenarios where key generation (via
`psa_generate_key()`) would fail due to the RNG functionality being
disabled.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
744e9f70f4 tests: secure_storage: psa: crypto: improve compatibility
The psa_key_attributes_t type is implementation-defined according to
the PSA Crypto spec.
Compare its fields individually instead of doing a memcmp() over the
entire struct.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
62fe34dd02 secure_storage: improve tests' compatibility in TF-M-enabled scenarios
Explicitly set the TF-M profile to not rely on the build system defaults
which might differ.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Krzysztof Chruściński
688b561815 tests: debug: Add test for cpu_load
Add test for CPU load.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-12 14:03:48 +00:00
Alberto Escolar Piedras
a8b44fd1d1 dts: zephyr,native-posix-cpu changed to zephyr,native-sim-cpu
The old binding remains until 4.4 but is deprecated.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-12 02:27:36 +01:00
Anas Nashif
d1af028ec2 tests: use simulators in integration platforms
Where applicable, pick a simulator as the integration platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-11 11:35:15 +01:00
Anas Nashif
abb5f52898 tests: settings: where possible, use simulators for integration platforms
We want to be able to run tests and get results in CI, not just build
for platforms we do not have access to.
Where possible, use a simulator instead of hw platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-11 11:34:54 +01:00