Commit graph zephyr/tests
Author SHA1 Message Date
Alberto Escolar Piedras
d5aef8a98b tests zbus proxy_agent ipc_backend: Exclude nrf5340bsim//cpunet
To build for the nrf5340bsim//cpunet with the IPC service, one
needs to  build also with the cpuapp image.
Without it no workable final executable/image is produced.

Let's just platform_exclude it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit b5e39d57cd)
2026-05-27 10:31:19 -05:00
Jukka Rissanen
b4d26cf134 tests: net: utils: Enable ASAN
Run address sanitizer to catch any undefined behavior issues
in the code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit d5ced71a8c)
2026-05-19 15:13:25 -05:00
Jukka Rissanen
765fe6e427 tests: net: utils: Check empty value using memcmp()
Use memcmp() to compare values instead of direct comparison.
Without this, some of the tests were failing because this
comparison "" != "" was true when ASAN was enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 007a274258)
2026-05-19 15:13:25 -05:00
Jukka Rissanen
bafe43f032 tests: net: utils: Fix test case having a buffer overflow
The test code accessed buffer outside of limits. Fix it by
setting the string length properly in the test.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 2df51049e4)
2026-05-19 15:13:25 -05:00
Jukka Rissanen
9ff8efda24 tests: net: utils: Add IPv6 tests for address parser
Make sure that IPv6 address parsing works as expected.

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 1c79d0c467)
2026-05-19 15:13:25 -05:00
Jukka Rissanen
0efe0894ff tests: net: utils: Add IPv4 tests for address parser
Make sure that IPv4 address parsing works as expected.

Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit d1b52d078f)
2026-05-19 15:13:25 -05:00
Alberto Escolar Piedras
f1e7bd895e tests devicetree api_ext: Add missing kconfig
Enable CONFIG_DAC as this test references the driver DT spec structure
and therefore needs the driver built as it is the one instantiating it.

The test builds in typical platforms because the use of the structure is
being optimized out at build time.
But when this is not the case, the test fails to link.

The issue can be reproduced with for ex.
```
cmake -GNinja -DBOARD=native_sim/native ../tests/lib/devicetree/api_ext/ \
  -DCONFIG_NO_OPTIMIZATIONS=y
ninja
```
But will fail for other boards with the default configuration intree.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit 8d9859e2e9)
2026-05-13 14:28:05 -05:00
Jamie McCrae
28e1c448ec mgmt: mcumgr: grp: os_mgmt: Fix MPSTAT invalid map
Fixes wrongly having an extra map entry for this response

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit a64883ef5d)
2026-05-07 17:59:42 -05:00
Robert Lubos
7af6d02616 tests: net: Add few tests for bad ND packets validation
Add a few new tests covering the bug discovered in ND packet
headers validation on input. Packets with invalid hop limit
should be dropped instead of silently being passed through only
if the ICMPv6 code is correct.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 137d08f879)
2026-05-01 16:25:23 -05:00
Etienne Carriere
0c132406ea tests: drivers: rtc: rtc_api: test alarm and calib on ST H7Sxx boards
Enable RTC_ALARM and RTC_CALIBRATION in rtc_api tests for stm32h7s*
based ST boards: stm32h7s78_dk and nucleo_h7s3l8.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
(cherry picked from commit 0b3b601e75)
2026-04-27 20:25:04 -05:00
Sylvio Alves
741411cf1c tests: drivers: uart: fix uart_elementary for esp32c5
Add missing SoC overlay with UART1 loopback pin
configuration and add esp32c5_devkitc to the
platform_allow list.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
(cherry picked from commit 401b45abee)
2026-04-27 20:18:24 -05:00
Mohamed Moawad
b74911bcf6 tests: debug: coredump: fix timeout on nsim_arc_v platforms
nSIM simulates the full address space, so dereferencing a NULL
pointer (writing to address 0) does not generate a fault. This
caused the coredump test to hang and timeout on nsim_arc_v/rmx100.

Add CONFIG_SOC_FAMILY_NSIM_ARC_V to the list of platforms that use
k_panic() instead of a NULL pointer dereference to trigger the
fatal error.

Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
2026-04-07 15:34:29 -04:00
Robert Lubos
4e830615a2 tests: net: socket: tcp: Add test for socket close during async connect
Add a test case which verifies that if a client socket is closed during
an async handshake, the TCP context is properly cleaned up on close,
i.e. it no longer tries to establish the connection.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-04-07 11:38:18 -05:00
Vytautas Virvičius
1ea30bf774 net: http_client: Fix body_frag_len overcounting with chunked TE
body_frag_len was computed using a raw buffer offset formula:

  body_frag_len = data_len - (body_frag_start - recv_buf)

This is correct for Content-Length responses: the recv buffer contains
only decoded body bytes after the headers, so the offset arithmetic
gives the exact body byte count.

It is broken for Transfer-Encoding: chunked.  RFC 7230 §3.3.2 makes
the two mutually exclusive, so chunked TE never comes with a
Content-Length.  With chunked TE, the recv buffer contains both the
decoded body bytes and the chunk framing bytes (chunk-size line, CRLF
body-terminator, terminal chunk "0\r\n\r\n") side by side.  The
formula counts everything from body_frag_start to the end of the
buffer fill, so it includes the framing bytes that follow the body,
causing body_frag_len to overcount.

http_parser already knows the exact decoded body byte count: it passes
it as the length argument to on_body(). Use that instead.

Add a regression test that sends a single chunked 206 response from a
raw loopback TCP server in one write, so the chunk terminator and
terminal chunk land in the same recv buffer as the body.  The test
asserts body_frag_len equals the decoded body size, not body size + 7
framing bytes.

Signed-off-by: Vytautas Virvičius <vytautas@virvicius.dev>
2026-04-07 11:37:19 -05:00
John Batch
1b75bfd1d4 tests: devicetree: api_ext: removing unneeded platform_exclude
The root cause of the build failure in this test on kit_psc3m5_evk has
been addressed.  The platform_exclude for this board is no longer
necessary.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-04-07 08:36:58 -05:00
Jamie McCrae
e6b27b3492 dfu: img_util: Fix partition detection
Fixes the logic in detecting which partition is being executed
from, also fixes a test for this feature

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-04-07 08:32:23 -05:00
Jordan Yates
ae9f38d896 tests: lorawan: frag_decoder: test multi-packet handling
Add tests for the fragment transporter multi packet handling, including
under error conditions.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-07 08:31:51 -05:00
David J. Leach, Jr.
d64b1a4b67 tests: net: ocpp: Fix build warning
Fix a build warning with %d and zassert_equal()

Signed-off-by: David J. Leach, Jr. <tasmar@gmail.com>
2026-04-04 10:55:08 -05:00
Nikhil Namjoshi
41082f40fc net: Initialize chksum variable to avoid clang build errors
This addresses clang build failure seen in
https://github.com/zephyrproject-rtos/zephyr/runs/69856219528

after PR #106578 was merged.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-03 14:58:06 -05:00
Nikhil Namjoshi
f98624455c net: Update net_calc_chksum to return err code on failure
`net_calc_chksum` is designed to return uint16_t checksum.
Its current behavior is to return 0 checksum on error
(or on an empty payload) and a valid non zero checksum for non empty
payloads. 0 could be a valid checksum for empty payload.

So update the `net_calc_chksum` and its wrapper's definition to
return error codes.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-03 23:14:47 +09:00
Jordan Yates
07f1481906 storage: stream: stream_flash: check size overflow
Add an initialisation time check for stream flash that the requested
offset and size does not overflow `size_t`. This in turn ensures that
`inspect_device` doesn't erroneously return `0` if the addition would
have overflowed.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-03 23:11:34 +09:00
Matthias Hauser
e2b7e6f063 boards: we: move UART30 pins to port P0
UART30 is only supported on P0 pins

Signed-off-by: Matthias Hauser <matthias.hauser@we-online.de>
2026-04-02 08:52:08 -05:00
Anand Kumar
27cf607152 tests: clock_control: allow double-start success or -EALREADY
Second clock_control_on() may return 0 or -EALREADY when the clock is
already on; assert it stays ON. Prepares for ESP32 clock_control
returning success when already enabled.

Signed-off-by: Anand Kumar <anandvtu16158@gmail.com>
2026-04-02 08:51:00 -05:00
Krzysztof Chruściński
e3dde01027 tests: drivers: uart: async_api: Improve variable buffer length test
Test was skipped if baudrate was too high. Test can actually
reconfigure the DUT device to use lower baudrate and run the test.
Initial baudrate is restored once test is completed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-02 08:42:54 -05:00
Krzysztof Chruściński
c8fec1bdf0 tests: drivers: uart: async_api: Extend to test various data bits
Extend the most basic test (single read) to check supported data
bits sizes (5-8 bits). If driver does not support given configuration
then test is skipped.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-02 08:42:54 -05:00
Szymon Janc
58e7e432a2 tests: bluetooth: host: Add bt_addr_le_create_nrpa to ID mocks
This is now required for bluetooth/host/id.c compilation.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-04-01 15:12:17 -05:00
Artur Dobrynin
976cb70a54 tests: bluetooth: tester: support NRPA
Adding support for setting of NRPA.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
2026-04-01 15:12:17 -05:00
Trond F. Christiansen
7b03b0d3fa tests: zbus: add multidomain proxy agent test suite
Add test suite for the zbus multidomain proxy agent
implementation.
adds a mock backend to enable isolated testing without requiring
actual hardware.

Signed-off-by: Trond F. Christiansen <trond.christiansen@nordicsemi.no>
2026-04-01 11:49:39 -05:00
Trond F. Christiansen
3aa3b96a93 zbus: proxy agent: Remove unused code
Remove unused code related to zbus_proxy_agent_backend_desc and run-time
backend registration left over from early development.

Signed-off-by: Trond F. Christiansen <trond.christiansen@nordicsemi.no>
2026-04-01 11:49:39 -05:00
Tim Pambor
21c3722f73 tests: drivers: flash: add fixture for flash 5 click shield
Prevent execution on devices without MikroElektronika Flash 5 Click
shield attached

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-04-01 11:48:28 -05:00
Ren Chen
57956c7d57 tests: watchdog: wdt_error_cases: add it51xxx soc test support
as title.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-04-01 09:17:29 -05:00
Liam Ogletree
70d1db5713 tests: application_development: Exclude invalid platform
Commit 71aa3be37b breaks
ram_context_for_isr build tests for CRD40L50. Exclude
CRD40L50 from the build test.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2026-04-01 09:15:47 -05:00
Felix Wang
304ffce894 tests: drivers: counter: set GPT run-mode to free-run for NXP boards
Configure the GPT (General Purpose Timer) instances to use "free-run"
mode in the counter basic API test overlays for NXP i.MX RT and i.MX 8
boards. This ensures consistent timer behavior across the test suite.

Changes apply to:
- mimxrt1170_evk (GPT2-6)
- mimxrt1180_evk cm33 and cm7 (GPT2)
- imx8mp_evk, imx8mn_evk, imx8mm_evk (GPT1)

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2026-04-01 09:13:29 -05:00
Adrian Bieri
77517213c2 version: add extraversion in version.h
This commit adds EXTRAVERSION to code through version.h.
This aligns the symbols available in code with those available
in the VERSION file.

Signed-off-by: Adrian Bieri <adrian.bieri@loepfe.com>
2026-04-01 09:12:15 -05:00
Ederson de Souza
99bdef5ae9 tests/subsys/pmci/mctp: Add "big message" test for I3C
This test ensures that the MCTP I3C binding can handle big messages,
that are split into several MCTP packets.

Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2026-03-31 14:58:06 -04:00
Ederson de Souza
66a74a2385 tests/subsys/pmci/mctp: Add "big message" test for I2C+GPIO
This test ensures that the MCTP I2C+GPIO binding can handle big messages,
that are split into several MCTP packets.

Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2026-03-31 14:58:06 -04:00
Ederson de Souza
caedcd4655 tests/subsys/pmci/mctp: Add "big message" test for UART
This test ensures that the MCTP UART binding can handle big messages,
that are split into several MCTP packets.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2026-03-31 14:58:06 -04:00
Fabrice DJIATSA
196d6ddc78 tests: drivers: dac: dac_loopback: fix regression on stm32f3
Avoid initialization failure by Updating channel information
to match the <dac1 1> configuration.

Also reduce ADC resolution to 10 bits to prevents the test from failing
due to ADC sampling value being outside the valid range.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-03-31 13:53:34 -05:00
Valerio Setti
e35b29c782 tests: crypto: mbedtls_psa: adjust main stack size
Increase main stack size because when TF-PSA-Crypto is initialized through
psa_crypto_init() the stack being used is the main one not the test one.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-03-31 13:50:34 -05:00
Szymon Janc
2f5145b34f test: bluetooth: tester: Fix GAP/CONN/DCON/BV-05-C test
For GAP/CONN/DCON/BV-05-C PTS expects IUT to fail operation
if the peer does not support Central Address Resolution.

In Test Set there is ALT to start undirected advertising instead
but PTS interpretation is that IUT shall reject directed request
regardless and may then later on follow up with underected
advertising (which PTS doesn't validate). To keep this simple
just reject here.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-03-31 10:26:54 -05:00
Pete Johanson
c7d65aa6d2 tests: drivers: spi: Set up SPI testing for MAX32690 RV32
Necessary setup for doing SPI loopback testing on MAX32690EVKIT RV32 core,
to verify that peripheral on the secondary core.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-03-31 10:26:07 -05:00
Nikhil Namjoshi
83d4a298f0 net: ipv6: Fix extention length header validation
The exthdr_len was previously validated against the total
packet length, which did not account for the header's offset.
This could allow a crafted packet to cause an out-of-bounds
read by claiming a length that exceeds the remaining buffer.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/106331

This commit:
1. Validates exthdr_len against (pkt_len - start_offset).
2. Adds strict bounds checking for sub-options (PADN/others)
   to ensure they do not exceed the extension header boundary.
3. Validates the return value of net_pkt_skip().

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-03-30 10:08:20 -05:00
Scott Worley
013d39c101 tests: drivers: spi: spi_loopback: Fix build error MEC174x/5x
We fixed oversight that did not update the compatible in the
SPI loopback driver test for Microchip MEC174x/5x boards when
the SPI driver was last updated.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2026-03-27 20:19:43 -04:00
Kyle Bonnici
d13cc59c92 dts: Remove duplicate properties in closure
This PR removes duplicate properties in the same closure. The last
instance is the one the is keept.

This PR only cleans up current instances a separate PR will be done to
update the dts-linter to enforce this in the compliance check.

Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
2026-03-27 13:59:59 -05:00
Pierre-Henry Moussay
325150ed06 tests: subsys: debug: coredump_threads: update tests filter
coredump_thread have a limitation and can only work if
CONFIG_MP_MAX_NUM_CPUS == 1.
This cause build issue of the test harness otherwise.

Signed-off-by: Pierre-Henry Moussay <pierre-henry.moussay@microchip.com>
2026-03-27 13:56:42 -05:00
Benjamin Cabé
c588da98e5 tests: input: add single tap timeout test for double tap detection
Implement a new test case to verify that a single tap does not trigger
a double tap event and that the event count resets after the timeout
period.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-03-26 19:29:09 -04:00
Mohamed Moawad
f4e5c9a583 tests: kernel: timer: Fix timer_behavior test for ARC boards
ARC hardware boards set CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 in their
defconfig, giving a 10 ms tick period. The timer_behavior test uses a
1 ms timer period by default, which is smaller than the tick period,
so the kernel rounds up to the next tick boundary and the test fails.

Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
2026-03-26 19:28:51 -04:00
Valerio Setti
49c3f3a636 tests: crypto: mbedtls_psa: enable Kconfigs for MLDSA-87
Just enable Kconfigs for MLDSA-87. This is not tested because it's still
an internal driver for TF-PSA-Crypto and it's not exported yet through
PSA API.
This is necessary to validate "mldsa-native" module integration in Zephyr.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-03-26 14:02:52 -04:00
Shreyas Shankar
7a06d15ab4 tests: kernel/cache: flush dcache before re-enable in setup
Enabling D-cache in test setup without a prior flush can corrupt the
active stack when executing from cacheable memory.

Use a safe sequence (disable ->flush ->enable) for D-cache in
test setup.

Signed-off-by: Shreyas Shankar <shreyas.shankar2018@gmail.com>
2026-03-26 14:02:09 -04:00
Srikanth Boyapally
79904d5ff2 tests: boards: versalnet_rpu: add flash support and test overlay
Add flash to the supported feature list for versalnet_rpu and introduce
a board overlay to enable running flash common tests.

Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com>
2026-03-25 15:08:03 -04:00