Commit graph

1929 commits

Author SHA1 Message Date
Anas Nashif
7c985dea67 tests: zms: remove bogus filter using depends_on
zms is not something to be used with depends_on, it is a software
feature. looks like it was a copy/paste from an nvs test. This test was
always fitlered out and never built or ran on anything....

Use filter instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-11 11:34:54 +01:00
Alberto Escolar Piedras
78f800642a drivers/ethernet/eth_native_posix: Rename to eth_native_tap
Rename this driver to eth_native_tap, including renaming all its
options.
The old options remain until v4.4, but as deprecated.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 20:10:38 +01:00
Andrej Butok
b826d46632 tests: zms: allow to build & run on real platforms
- Allows to build and run ZMS tests on real platforms.
- Enables ZMS tests designed for a flash-simulator only when
  built for qemu_x86 or native_sim targets.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-03-07 19:53:27 +01:00
Utsav Munendra
2b48ef62ba portability: cmsis: Implement osThreadJoin using Zephyr k_thread_join
Bugfix previous `osThreadJoin()` implementation where a thread which
exited with `osThreadExit()` could not be joined upon by other threads.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-03-07 19:51:50 +01:00
Eric Ackermann
7293f59a05 tests: llext: Test RISC-V non-paired relocation
Tests an edge case in the RISC-V PSABI: In the medany and the medlow code
models, the compiler emits auipc/lui (U-type) and ld/sw (I-type/S-type)
instruction pairs for accessing a non-local symbol.
The U-type instruction sets the upper 20 bits, the I/S-type the lower 12.
The U-type and I-type/S-type instruction pairs are often adjacent in code.
This is also what the current llext architecture-specific relocations
expect.
However, this need not be the case - compilers can re-use the upper 20
bits set by the U-type instruction with multiple I/S-type instructions,
which is a useful optimization for multiple loads/stores of or within
the same symbol.
This commit adds a unit test for this behavior, which currently fails
for RISC-V.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2025-03-07 19:44:54 +01:00
Alberto Escolar Piedras
db62135de2 tests/subsys/settings/functional/fcb: Remove native_posix overlay
native_posix is being removed as it has reached its end of life in 4.2,
after being deprecated since 4.0.

So this overlay will not serve any purpose anymore.

Note native_sim did not have an overlay of its own.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Alberto Escolar Piedras
6c38bc8ec4 boards native_posix: Remove twister support
native_posix is being removed as it has reached its end of life in 4.2,
after being deprecated since 4.0.

Remove the twister support for native_posix[//64] and therefore all
references to them from the testcases and samples yamls, so twister
does not error out.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Riadh Ghaddab
f020720a80 fs: zms: fix Copyright notice
Add missing Copyright from derived files and fix the Copyright year for
some files to keep the original Copyright notice

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2025-03-04 12:17:02 +00:00
Alberto Escolar Piedras
414996f880 tests/subsys/fs/nvs: Fix flakiness due to not init'ed data
This test has been seen failing at random (though not often).
A valgrind check showed the nvs_ate structures were being
CRC'ed with not-initialized data, and checked later (assuming
the CRC would be different than a constant).
This maybe have been the cause of the test failures, so let's
initialize the whole structure to prevent the CRC value
from depending on random memory/stack content.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-02-27 13:28:12 +00:00
Jordan Yates
c0ef487a38 tests: secure_storage: add dependencies
Now that `SECURE_STORAGE` does not `select` dependencies, they need to
be enabled explicitly by the tests.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-02-27 09:07:56 +00:00
Anas Nashif
15c5541324 tests: shell_backend_uart: do not filter
Filtering on something we set in the prj..conf does not do anything. We
have filter on platforms already.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-02-20 21:06:00 +01:00
Anas Nashif
a8ce2dbe15 tests: tests should not enable mmu directly
MMU is enabled via the arch specific MMU option and by the platform.
i.e. X86_MMU or ARM_MMU selects MMU.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-02-19 04:59:19 +01:00
Dominik Kilian
0e4efdb2a6 tests: ipc_service: Test restarting session in different scenarios
This commit adds a test that checks if disconnecting
and restarting the IPC session works correctly. The
test is also focused on the "unbound" callback.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
Co-authored-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2025-02-14 13:34:49 +01:00
Utsav Munendra
66c43a8f77 tests: portability: cmsis: Add tests for CMSIS-RTOSv2 static cb
Every CMSIS-RTOSv2 now supports static allocation
control blocks. Add tests for this.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-02-14 03:13:35 +01:00
Utsav Munendra
137c7cb149 tests: portability: cmsis: Run clang-format on CMSIS-RTOSv2 tests
clang-format -i tests/subsys/portability/cmsis_rtos_v2/src/*.c

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-02-14 03:13:35 +01:00
Tomi Fontanilles
0c368e85b1 secure_storage: add a global registry header file for PSA key IDs
We need to make sure that within Zephyr different users of the PSA APIs
don't interfere with each other because of using the same numerical IDs
for persistent assets.

This takes care of the PSA key IDs when using persistent keys through
the PSA Crypto API.
See the comments in `<zephyr/psa/key_ids.h>` for more information.

This removes the recently-introduced Kconfig options that allowed changing
the base IDs subsystems were using for their persistent keys.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-02-13 20:22:09 +01:00
Luca Burelli
fe29c40a93 llext: add inspection API test suite
This patch adds a test suite for the inspection API. The test checks
that the symbols exported by the 'inspect_ext' extension are correctly
mapped inside their corresponding regions and sections.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-02-13 16:43:29 +01:00
Omkar Kulkarni
97166a5c11 tests: settings: Performance test for settings
This adds a on target performance test for Settings SS. Using this test
performance of the Setting SS + NVS/ZMS backend can be benchmarked.

The test repeatedly write 128 settings entries. Each setting entry
has a size of 4 bytes, and path length of 16 bytes (excluding the
null-terminator).

The test has two variants, with and without Bluetooth scan running.
This is useful to benchmark performance along with some component
of BT subsystem activated.

The test could be enhanced in future to include or create combinations
of different functionalities running, when agreesive store operations
are happening.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2025-02-13 16:40:41 +01:00
Riadh Ghaddab
ef4e8dd5c3 settings: ZMS: add a backend for ZMS (Zephyr Memory Storage)
This adds the initial backend support for the ZMS storage system.

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2025-02-13 16:40:41 +01:00
Mahesh Mahadevan
3b43cb3139 tests: pm: Test the SoC State Change Power Domain driver
The SoC State Change Power Domain driver issues TURN_ON/
TURN_OFF actions to all devices registered with it for
certain power states that can be specified via device tree.
This test exercises the functionality of this driver.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-02-13 16:40:10 +01:00
Tom Burdick
2a046004b9 rtio: Correctly handle completion count wraps
Prior to this change a wrap of the completion count (without SUBMIT_SEM)
would result in looping indefinitely waiting for completions.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-02-12 12:23:06 +01:00
Jordan Yates
13220aa939 tests: rtio: rtio_api: test cq_count overflow
Add a test for the behaviour of `rtio_submit` with
`CONFIG_RTIO_SUBMIT_SEM=n` when the `cq_count` variable overflows.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-02-12 12:23:06 +01:00
Sebastian Głąb
5eff0c1cd7 tests: subsys: logging: Test with CONFIG_LOG disabled
Developer reports build error when he uses LOG_RAW in his code
and disables logging in prj.conf using CONFIG_LOG=n.

Add test case for above described scenario.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-02-11 15:41:21 +01:00
Bartosz Miller
9d20c5c382 tests: susbys: Implement performance test for the NRFS
Add NRFS service handling performance test.

Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2025-02-10 11:30:36 +01:00
Manuel Argüelles
55d3deb030 tests: logging: log_backend_fs: add missing include
Include explicitly `logging/log_backend.h` header so that non POSIX
boards can build this test. For POSIX boards, this headers was indirectly
included through `ztest.h`->`ztest_assert.h`->`tc_util.h`->`log_ctrl.h`.

Fixes #85441

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2025-02-10 09:03:13 +01:00
Johann Fischer
c8f3a2eb2d usb: host: allow dynamic allocation of USB devices
Allow dynamic allocation of USB devices on connected event.
Add very basic USB device validation and configuration.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Andrej Butok
68977fa57c tests: flash_map: Increase the maximum number of supported sectors
Fix test_flash_area_get_sectors test for platforms
with maximum number of sectors per image slot > 1024.
Increase the support value to 2048.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-02-08 00:32:09 +01:00
Kamil Krzyzanowski
41f2c64e97 logging: fs backend: only fs_sync when done with a batch of logs
The previous behavior was to call `fs_sync` on the file after every log
item written. In many cases, log messages come in bursts, and `log_core`
already operates in batches, configurable using
`CONFIG_LOG_PROCESS_THREAD_SLEEP_MS` and
`CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD`. Once the batch is done, the
backends get notified with `LOG_BACKEND_EVT_PROCESS_THREAD_DONE` if any
logs were processed. This is a nice time to `fs_sync` the written changes.

This change both speeds up the time spent writing logs and reduces the
amount of block erases done on the flash, as the previous implementation
erased blocks after each individual log message.

Signed-off-by: Kamil Krzyzanowski <kamnxt@kamnxt.com>
2025-02-07 14:32:06 +01:00
Joakim Andersson
dc97cc0cd5 tests: logging: Convert unit test to include the full FS backend
Convert testing of the logging backend for file-system to include the
full implementation.
Need to disable logging and just include the unit under test to make
this simpler.
The API functions for the backend can then be called on the backend
object.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2025-02-07 14:32:06 +01:00
Bjarki Arge Andreasen
816a7a09ac tests: subsys: llext: filter by ram/rom size
The LLEXT test suites are quite large, and should not be built
for "small" SoCs. Filter the tests based on RAM and ROM/flash
size. The following test sizes built for nrf52840 where used
to determine min sizes:

Name:                       Flash:   RAM:
llext.loader_build          105      80
llext.readonly              105      79
llext.readonly_mpu          140      95
llext.readonly_mmu          106      145
llext.writable              123      125
llext.writable_relocatable  117      129
llext.writable_slid_linking 108	     125

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-05 21:02:33 +01:00
Lauren Murphy
f0eb7ebc83 llext: arc: enforce bitness match
Enforces bitness match of ARC compilers and linkers invoked
building LLEXT apps by inheriting -mcpu flag from Zephyr.
The ARC toolchain becomes confused without the -mcpu flag.
On qemu_hs5x we see GCC select elf32-littlearc64 for
linking an object previously compiled as elf64-littlearc64.

Fixes #80949

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-02-05 21:01:01 +01:00
Johann Fischer
3bfe163811 usb: device_next: implement blocklist for classes
In the usbd_register_all_classes(), we may need to skip some instances
as they may have very specific function like USB DFU "DFU mode" which
should not be available by default.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-04 11:55:25 +01:00
Dominik Ermel
56ef352f17 tests/stream_flash: Prepare for stream_flash_erase_page removal
Keep on testing the function but fix logic where applicable
and remove last_erased_page_start_offset which has been replaced
with erased_up_to in stream_flash_ctx.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-01-30 14:13:42 +01:00
Piotr Kosycarz
d19c940b53 tests: subsys: storage: stream: stream_flash: add tags
Missing tags.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2025-01-30 02:02:06 +01:00
Piotr Kosycarz
0d641bb828 tests: subsys: logging: log_frontend_stmesp_demux: add coresight_stm tag
coresight_stm tag.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2025-01-28 09:50:38 +01:00
Hake Huang
a88e429f79 tests: fat: fat_fs_api reduce the wipe partition sectors
As SD partition tables, GPT or MBT, is positioned at
the beginning of a device, it is enough to wipe first 64 sectors,
of 512 bytes. Wipe of entire SD card is very slow and unnecessary.

fixes: #84428

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-01-27 13:25:31 +01:00
Sadik Ozer
6932885996 tests: subsys: secure_storage: Add filter for small profile
TF-M small profile does not support secure storage (know as Protected
storage), this commit add filter for tfm test case to pass it
incase of small profile been set, see tf-m profiles in below link

https://tf-m-user-guide.trustedfirmware.org/configuration/profiles/index.html

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2025-01-27 11:03:17 +01:00
Luca Burelli
8660020205 llext: group LLEXT output files in a subdirectory
LLEXT-related files are currently scattered in multiple locations in the
build directory. For easier access, this patch groups the outputs in a
subdirectory named 'llext' at the root of the build binaries, alongside
the 'zephyr' directory. This directory will thus contain the generated
debug ELF and the final .llext file for each compiled extension.

Note that this does not affect out-of-tree projects that use LLEXT,
since they already pass the full LLEXT file path to add_llext_target().

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Ederson de Souza
3bbe42f789 tests/subsys/tracing: Async tracing API test fix
Test `tracing.transport.uart.async.test` was working only due sheer
serendipity: one of the tracing strings checked,
sys_trace_k_mutex_lock_exit, was never being registered on the tracing
buffer. However, the check never got to check this string, so the test
was passing.

Why wasn't it being registered? Tracing buffer size was a bit small for the
flurry of messages - increasing it solves the problem, and is what this
patch does.

Why did the check never got to the missing string? Tracing thread has a
lower priority, so when the k_sleep of test thread expired, it was
preempted. Indeed, if the sleep was changed by any number of ticks, the
test would fail. Even changing order - and thus number - of instructions
executed could make this test fail.

While at it, fixed some typos and an imprecise commentary on code.

Fixes: #84169

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-01-23 00:13:46 +01:00
Guennadi Liakhovetski
76e1e1b804 llext: fix Z_GENERIC_SECTION() usage
Z_GENERIC_SECTION() uses STRINGIFY() to convert its argument to a
string, therefore the argument shouldn't contain additional quotes.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2025-01-22 20:50:00 +01:00
Luca Burelli
b0dbbb7782 device: add CONFIG_LLEXT_EXPORT_DEV_IDS_BY_HASH option
This new option allows to export devices using identifiers generated
from the hash of the devicetree node path, instead of the device's
ordinal number. Identifiers generated this way are stable across
rebuilds.

Add new test cases to test this new option.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-22 15:49:10 +01:00
Brandon Allen
e0173d9b8e zbus: assert when inside an ISR and time out is not zero
Currently various zbus functions silently change the timeout
to zero  when inside an ISR. If a developer is not aware
of this it could lead to unexpected behaviour or a
publish/read failing.

Also in the zbus docs it states to only use a timeout of
zero when inside a ISR multiple times.

Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
2025-01-21 19:30:20 +01:00
David Leach
d29e2f342d boards: nxp: add RT1060 EVKC support
MIMXRT1060 EVK rev C initial support files.

Signed-off-by: David Leach <david.leach@nxp.com>
2025-01-21 19:27:39 +01:00
Cong Nguyen Huu
c4d1c55319 tests: enable flash tests for s32z board
Enable flash tests for s32z board

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2025-01-21 19:26:45 +01:00
Jordan Yates
b6f8eff2f3 tests: fs: lib_link: added
Add a test validating that Zephyr can compile with the 3 underlying
filesystems enabled with only `CONFIG_FILE_SYSTEM_LIB_LINK` enabled.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-01-21 15:13:05 +01:00
Alberto Escolar Piedras
64d4fcd8cb tests/subsys/lorawan/frag_decoder: Change random seed
These tests are quite sensitive to the exact random sequence.
After a change of the native_sim entropy generation 2 of them
started failing. Let's set a random seed which avoids the failure.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-01-20 20:55:48 +01:00
Samuel Chee
8d6d4de79d boards: arm: mps2: Add support for mps2/an383
Added new mps2 board an383 to enable testing with ARM FVP.
Qualifier to build/run is mps2/an383

Signed-off-by: Samuel Chee <samche01@arm.com>
2025-01-20 11:15:32 +01:00
Rafał Kuźnia
6f419cd6fb tests: nrf: enable twister tests for nrf54l09pdk
Enabled tests:
- clock_control_api
- nrf_clock_calibration
- nrf_lf_clock_start
- clock_control/onoff
- counter_basic_api
- flash/common
- flahs/negative_tests
- retained_mem/api
- nrf_grtc_timer
- wdt_error_cases
- fs/fcb
- stream/stream_flash

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2025-01-15 11:52:03 +01:00
Eric Ackermann
4921ce2118 tests: llext: Add RISC-V CB-Type edge case test
All immediates in RISC-V are encoded as two's complement. This commit
adds a test for relocating jumps that utilize the full range of the
immediate, in both positive and negative direction.
To this end, the test uses the compressed b-type (CB) instruction to
branch to its maximum negative (-256) and maximum positive (+254)
targets.
In case of test failure, expect relocating the corresponding llext to
fail.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2025-01-10 14:47:39 +01:00
Nicolas Pitre
46aa6717ff Revert "arch: deprecate _current"
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").

This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.

The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.

Hence this revert.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-10 07:49:08 +01:00