Commit Graph

2840 Commits

Author SHA1 Message Date
Daniel Leung
44cce5968d tests: kernel/smp: disable torture test for Intel audio DSP sim
This sets the run factor for Intel audio DSP simulators to zero.
The simulator is pretty much serialized so SMP switching torture
does not really test concurrent operations, and they are taking
too much time causing timeouts on CI. So sets the run factor to
zero to disable the switch torture test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-09-15 10:30:31 +02:00
Flavio Ceolin
181405ffc3 tests: syscalls: Reduce sleep time on Intel audio DSP simulators
Reduce the sleep time in the torture test for Intel audio DSP
simulator. The current amount of time makes this test to take
a long long time to finish causing problems on CI.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-09-15 10:30:31 +02:00
TaiJu Wu
4f61e65193 test: add config to test msgq put front featrue
Add a config `CONFIG_TEST_MSGQ_PUT_FRONT` in mesgq_test to
enable message queue put front feature.

Also, add `test_msgq_pending` to test message queue behavior when
the caller is going to put and put front.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2025-09-13 21:22:52 -04:00
Benjamin Cabé
b1c7f9c126 scripts: do not install/recommend vulnerable python packages
requests < 2.32.4 is subject to GHSA-9hjg-9r4m-mvj7
pyyaml < 5.4 is subject to GHSA-8q59-q68h-6hv4
pyyaml < 5.1 is subject to GHSA-rprw-h62v-c2w7
protobuf < 5.29.5 is subject to GHSA-8qvm-5x2c-j2w7

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-12 14:23:18 -04:00
Mohamed Moawad
3f0112593b tests: kernel: fix thread_runtime_stats compiler optimization issue
Compilers may optimize away empty while(1){} loops in helper threads,
causing the idle thread to run instead and breaking runtime statistics
measurement.

Use volatile condition variable to prevent optimization.

Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
2025-09-09 21:59:42 +02:00
Benjamin Cabé
fcf13b59e3 tests: kernel: adopt new sys_count_bits util function
Adopt new sys_count_bits helper from util.h and avoid
having conflicting definition

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 17:27:15 +02:00
Anas Nashif
16aa0ef1de tests: interrupt: move under arch
Move under arch, as this is not a kernel feature really. arch also
matches the test idcentifier in place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-08 15:51:07 -04:00
Anas Nashif
e14833016f tests: gen_isr_table: move under arch
Move under arch, as this is not a kernel feature really. arch also
matches the test idcentifier in place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-08 15:51:07 -04:00
Anas Nashif
f15ea42fe9 tests: xip: move under arch
Move under arch, as this is not a kernel feature really. arch also
matches the test idcentifier in place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-08 15:51:07 -04:00
Kyle Micallef Bonnici
25bbbb51ae devicetree: format files in tests/kernel/mem_protect
Applying dts-linter results for files in

tests/kernel/mem_protect

Signed-off-by: Kyle Micallef Bonnici <kylebonnici@hotmail.com>
2025-09-08 10:28:48 +01:00
Kyle Micallef Bonnici
9459c634aa devicetree: format files in tests/kernel/interrupt
Applying dts-linter results for files in

tests/kernel/interrupt

Signed-off-by: Kyle Micallef Bonnici <kylebonnici@hotmail.com>
2025-09-08 10:28:48 +01:00
Krzysztof Chruściński
09634c9869 tests: kernel: common: Extend bitarray test
Add test for sys_bitarray_alloc and sys_bitarray_free with 32 bit
bitarray which is using an optimized algorithm.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-09-06 10:38:18 +02:00
Charles Hardin
81283c678a kernel: event api extensions to clear events and avoid phantom events
This is variation of the PR to handle phantom events and hopefully
this get merged into the PR to land.

See-also: https://github.com/zephyrproject-rtos/zephyr/pull/89624
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-09-05 16:50:28 -04:00
Anas Nashif
0c84cc5bc6 kernel: drop deprecated pipe API
This API was deprecated in 4.1, so drop it for the 4.3 release. Use new
PIPE API instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-05 17:13:05 +02:00
Loic Domaigne
d6ce2f4f41 tests: kernel: device: Add tests for deferred init failure
These tests verify the expected returned value and device state for
error cases (-EALREADY, -errno) conform to the device_init()
documentation.

Signed-off-by: Loic Domaigne <tech@domaigne.com>
2025-09-04 21:03:01 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Ederson de Souza
948c884054 tests/kernel/lifo/lifo_api: Don't reuse name for different thread stacks
A limitation on current HW shadow stack implementation for x86 is that
more than one thread stack can't share the same variable name, even if
they are static. To avoid skipping useful tests, for now, while this
limitation holds, change the name of the stack variable.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Ederson de Souza
53c7e9a3f8 tests/kernel/fifo/fifo_api: Don't reuse name for different thread stacks
A limitation on current HW shadow stack implementation for x86 is that
more than one thread stack can't share the same variable name, even if
they are static. To avoid skipping useful tests, for now, while this
limitation holds, change the name of the stack variable.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Ederson de Souza
d3d82a1159 tests/kernel/fatal/exception: Skip stack sentinel test with shadow stack
Test could trip shadow stack protections instead of normal stack
sentinel, thus requiring special handling for this case. Just avoid this
test instead, if CONFIG_HW_SHADOW_STACK=y.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-09-02 07:56:48 +02:00
Peter Mitsis
9bdb17aa32 tests: Add test for IPI work items
Adds a simple test case for IPI work items.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-08-25 09:12:31 +02:00
Keith Packard
3ab84aa2a7 tests/mem_protect: Adjust backing store size
This test is failing; perhaps we've shrunk the kernel enough to change what
this value needs to be?

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
a72b31b655 tests/kernel: Loosen bounds on timeslice schedule for slow clocked systems
RX consistently fails this test by a tiny amount. Loosen the tolerance to
let it work.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Keith Packard
302b192dd9 tests/kernel: Avoid C library calls from interrupt handlers
On arm64, GCC feels free to use floating point registers for essentially
anything unless we build with -mgeneral-regs-only. After the FPU gets used
in an interrupt handler, interrupts are disabled as there's no place to
save the registers during a nested exception. As the C library may be built
separately without this flag, we cannot use any of its functions or risk
having nested exceptions fail.

Switch printk usage to k_str_out and stick to (mostly) Zephyr internal
functions to ensure nested interrupts work correctly.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-08-18 22:01:08 +02:00
Łukasz Stępnicki
551805a829 tests: kernel: interrupt: generic ISR offset definition for nrf54h20 VPRs
All VPRs in nrf54h20 can have same ISR offset configuration.

Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
2025-08-18 22:00:44 +02:00
John Batch
291fed487c tests: kernel: timer tests for kit_psc3m5_evk board
Adding overlays for Infineon kit_psc3m5_evk board to kernel/common,
kernel/timer/timer_error_case and kernel/timer/timer_api tests
when run in secure mode.  These tests require more memory than
the board assigns to secure mode by default.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-08-13 22:11:42 -04:00
Abderrahmane JARMOUNI
cafc00cc74 tests: kernel: mem_heap: enhance k_heap_free() API coverage
Enhance k_heap_free() API coverage by testing NULL free & double free
edge cases

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-08-12 12:35:38 +02:00
Abderrahmane JARMOUNI
e79be024e4 tests: kernel: mem_heap: enhance k_heap_calloc() API coverage
Enhance k_heap_calloc() API coverage by testing overflow and zero-size
edge cases

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-08-12 12:35:38 +02:00
Abderrahmane JARMOUNI
7f57759f9d tests: kernel: mem_heap: add k_heap_aligned_alloc() coverage
add test coverage for k_heap_aligned_alloc() k_heap API

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-08-12 12:35:38 +02:00
Chris Friedt
41120bf07c tests: kernel: mem_map: reduce reserved pages for qemu_x86 tiny
A recent change caused tests to start failing for qemu_x86_tiny/atom .

Similarly to bda38f033a, reduce the number of
reserved pages so that the test suite can pass for this platform.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-08-09 12:38:58 +03:00
Sebastian Głąb
d673851ec8 tests: Remove nrf54l09pdk from supported boards
Remove possibility to run tests on nrf54l09pdk as this is
an obsolete board that is going to be removed.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-08-05 10:24:48 +01:00
Michał Stasiak
3a871b6b4b tests: kernel: obj_tracking: fix typo
Fixed typo in assertion.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2025-08-04 19:54:58 +01:00
Bjarki Arge Andreasen
2b0d1ae4d0 soc: nordic: nrf54h: transition from gpd to zephyr pinctrl and pds
Transition nrf54h away from the soc specific gpd
(global power domain) driver which mixed power domains, pinctrl
and gpio pin retention into a non scalable solution, forcing soc
specific logic to bleed into nrf drivers.

The new solution uses zephyrs PM_DEVICE based power domains to
properly model the hardware layout of device and pin power domains,
and moves pin retention logic out of drivers into pinctrl and
gpio, which are the components which manage pins (pads).

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-29 09:03:37 -04:00
Daniel Leung
4b15936329 tests: kernel/smp_boot_delay: workaround occassionally failures
test_smp_boot_delay sometimes fails due to thread started by IPI
not having started or not finished running:

* Using CPU mask to explicitly state which CPU to start the thread
  seems to fix the issue where the thread is not started quickly
  enough.
* When the host  system is under heavy load (e.g. twister-ing),
  emulators may not get enough CPU time to run the newly created
  thread. So extend the IPI delay a bit more to allow for this.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-07-28 21:03:43 -04:00
Daniel Leung
95c3b8e085 tests: kernel/smp: more timeout
The concurrency and switching tests take quite some time to
finish (relatively speaking). When running in emulator and
under a heavily loaded system (e.g. twister-ing), it may
time out as the emulator is not getting much CPU time. So
make the base timeout longer, which can then be further
adjusted by the board timeout multiplier.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-07-25 08:08:09 -04:00
Krzysztof Chruściński
26fe43dd36 tests: kernel: timer: timer_behavior: Fix max_stddev calculation
max_stddev calculation was previously patched to be more at least
1 system clock cycle to cover for platforms that use higher frequency
system clock (32kHz). On that platform (nRF52) system clock frequency
was the same as tick frequency but on nRF54x that is no longer true.
Initially, the intention was to use 1 system tick and not cycle.
Fixing it now.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-07-22 19:31:31 -04:00
Sebastian Głąb
1cf511edd9 tests: kernel: timer: timer_behavior: Cleanup after nRF54LM20 rename
Remove duplicated test configuration after
nrf54l20pdk/nrf54l20/cpuxxx was renamed to
nrf54lm20dk/nrf54lm20a/cpuxxx.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-07-21 13:04:27 -04:00
Jimmy Zheng
74ded5884f tests: kernel: gen_isr_table: add available IRQ number for AE350 CLIC
RISC-V CLIC can trigger edge-triggered interrupts by software, but the
available IRQ sources depend on the hardware implementation.
Clarifies the IRQ source for GD32VF103 and adds support for AE350 CLIC.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-07-19 15:28:58 -04:00
Jimmy Zheng
24a1baeda3 tests: kernel: interrupt: adjust test for clic
For RISC-V CLIC, only edge-triggered interrupts can be triggered by
software. Add IRQ flag to set the trigger type for RISC-V CLIC.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-07-19 15:28:58 -04:00
Tom Hughes
d732a51d56 tests: kernel: gen_isr_table: Don't use IRQ1 if already used
IRQ 1 is used by the LiteX timer, so we can't use it for the test:

gen_isr_tables.py: error: multiple registrations at table_index 1 for
irq 1 (0x1)

Existing section
['.irq.WEST_TOPDIR/zephyr/tests/kernel/gen_isr_table/src/main.c.0'],
new section .irq.WEST_TOPDIR/zephyr/drivers/timer/litex_timer.c.0

Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the
same irq multiple times?

Issue #92194

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-07-02 17:58:08 -05:00
Grzegorz Swiderski
d9c5545804 tests: kernel: interrupt: Fix for nRF54H20 FLPR
Use designated IRQ numbers, instead of generic defaults.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-02 17:57:45 -05:00
Abderrahmane JARMOUNI
dd594d54f5 tests: kernel: device: expand device api coverage
Enhance device z_device_get_all_static API test

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-07-01 19:03:40 -05:00
Abderrahmane JARMOUNI
ddbc7efed6 tests: kernel: device: expand device api coverage
Add test coverage for device device_get_by_dt_nodelabel() API

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-07-01 19:03:40 -05:00
Abderrahmane JARMOUNI
1f4e78eb33 tests: kernel: device: add dev deinit api coverage
Add test coverage for device de-initialization API

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-07-01 19:03:40 -05:00
Łukasz Stępnicki
d7fd99ecc6 tests: kernel: interrupt: generic ISR offset definition for nrf54h20 VPRs
All VPRs in nrf54h20 can have same ISR offset configuration.

Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
2025-07-01 05:55:36 -10:00
Karol Lasończyk
061036f9e3 tests: samples: Extend support for nRF54LM20A
Extends support and adds new overlays.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-06-27 18:26:57 -05:00
Duy Nguyen
f2d30ab55b tests: kernel_workq: Excluding test for qemu_rx
Excluding this test for qemu_rx because it's failing randomly
Root cause not identified yet, #92213 is created to keep track
of this
This test case is working fine on actual RX HW so issue might be
in the inside the qemu environment

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-06-26 14:07:03 +02:00
Benjamin Cabé
f21f3b0d92 tests: do not use "sanity" word
Fix to align with guidelines regarding the use of inclusive language.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-25 16:00:10 -10:00
Carles Cufi
892ac07a4a cmake: Add a new no_deprecation_warning compiler flag
Commit be40d854c2 introduced the ability
of building Zephyr with deprecation warnings enabled, by making
COMPILER_WARNINGS_AS_ERRORS depend on the newly added DEPRECATION_TEST
Kconfig option. This has the downside of disabling **all** warnings, not
only the deprecation ones.

This patch instead makes DEPRECATION_TEST disable only the deprecation
warning, but leaves COMPILER_WARNINGS_AS_ERRORS enabled.
This has the advantage of being able to see other unrelated warnings
(and fail if they appear) but has the disadvantage of not printing out
the deprecation warnings themselves (since they are disabled).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-06-23 12:38:07 -07:00
Benjamin Cabé
524e44fd79 tests: kernel: k_heap: add tests for k_heap_realloc
There was zero test for this new-ish kernel API so add them.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 12:35:33 -07:00
Benjamin Cabé
487bdb311e tests: kernel: k_heap: cleanup doxygen
Remove redundant wording from doxygen brief

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 12:35:33 -07:00