Commit graph

13543 commits

Author SHA1 Message Date
Jukka Rissanen
8363b8cfd9 samples: net: Increase CONFIG_NET_SOCKETS_POLL_MAX to pass checks
The number of suitable network IPv6/4 configurations in interfaces
affect the number of pollable sockets. So need to increase the value
from the default value of 3.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-03 09:49:01 +02:00
Emil Gydesen
f93b9dee5c Bluetooth: CSIP: Make set_member_by_conn a public function
The function is useful for application to lookup set
members from bt_conn pointers, e.g. when iterating on
connected devices.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-03 09:48:48 +02:00
Fengming Ye
a3034d1802 tests: net: socket: af_packet: fix TSN socket recv IP pkt
test_packet_sockets_dgram create ETH_P_TSN sockets but
send and recv ETH_P_IP packet.

Fix it by sending ETH_P_TSN packet.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-06-03 09:48:32 +02:00
Grzegorz Chwierut
76ff3afffe tests: Update pytest scenarios with sysbuild paths
Updated sample to test DFU with mcumgr.
Use paths to default domain build dir from device_config.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-06-02 00:42:54 +02:00
Andy Ross
4a6b8f27b8 tests/boards: Add mtk_adsp device test
Simple test of device-specific functionality: cpu frequency control
and host interrupts.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-01 05:40:05 -07:00
Aleksandar Cecaric
0f1d93cb4f include: riscv: add RISC-V arch atomic instructions
Add RISC-V architecture specific atomic instructions, not present in
atomic_builtin.h

Signed-off-by: Aleksandar Cecaric <aleksandar.cecaric@nextsilicon.com>
2024-06-01 10:27:32 +02:00
Seppo Takalo
85b60fcc12 Revert "test: lwm2m: Raise POSIX_MAX_FDS for native_sim"
This reverts commit 9473f60b80.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-06-01 10:24:03 +02:00
Henrik Brix Andersen
127cb9edb6 tests: drivers: can: add host communication test suite
Add test suite using python-can for testing Controller Area Network (CAN)
communication between a host PC and a device under test running Zephyr.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-31 16:40:01 -05:00
Mathieu Choplain
a07d493c9d llext: relocate all symbols regardless of type
In the current implementation, the LLEXT linker will only apply
relocations targeting a given symbol if it has a specfic symbol type.
This is overzealous and causes issues on some platforms, as some symbols
that need to be relocated are skipped due to being of a "bad" type.

Ignore the symbol type when performing relocation to solve this problem,
but also add checks to ensure we don't attempt to relocate symbols with
an invalid section index. If such a relocation is found, return an error
instead of ignoring the relocation entry to ensure that it is impossible
to execute code from a (partially) unrelocated LLEXT.

Also remove all hacks added to circumvent this issue:
* qemu_cortex_r5 exclusion from test cases
* unnecessary exclusion of some flags when building with LLEXT EDK

Fixes #72832.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-05-31 16:38:09 -05:00
Tomi Fontanilles
c1342b3aa9 modules: mbedtls: remove the default enabling of features
In an effort to shave off code size, remove out-of-the-box
enabling of crypto features (except SHA-256).

Configurations are adjusted to enable what they need.

Bonuses:

- When enabled, AES now defaults to using a smaller version
(`CONFIG_MBEDTLS_AES_ROM_TABLES` isn't default enabled anymore,
and if enabled, `CONFIG_MBEDTLS_AES_FEWER_TABLES` defaults to y).

- Conditions around Mbed TLS Kconfig options have been improved
to reflect the reality of the dependencies.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-31 16:33:06 -05:00
Anke Xiao
598ba32856 tests: drivers: gpio: test gpio_basic_api for frdm_ke17z
Added frdm_ke17z.overlay to support testing gpio_basic_api sample

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
2024-05-31 16:31:33 -05:00
Daniel DeGrasse
6e138c1500 tests: drivers: uart: uart_async_api: enable support for lpcxpresso55s69
Enable support for running uart async API test on LPCXpresso55s69 EVK.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-31 09:59:12 -05:00
Jukka Rissanen
ffbe0f2928 tests: net: http_server: Add wildcard resource path tests
Add tests that verify that wildcards in resource path strings
are matched correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-31 09:57:22 -05:00
Emil Gydesen
1bcc3d8efa samples: Bluetooth: Audio: Change names to <profile>_<role>
Modify the BAP and PBP samples to start with the profile name
(BAP or PBP) and the role of the sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-31 09:56:11 -05:00
Vinayak Kariappa Chettimada
4b6d3f1e16 Bluetooth: Controller: Fix missing conn update ind PDU validation
Fix missing validation of Connection Update Ind PDU. Ignore
invalid connection update parameters and force a silent
local connection termination.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-31 04:39:34 -07:00
TaiJu Wu
18d9ba4b82 test: Add a testcase for cpu affinity
Pin thread to a specific cpu. Once thread gets cpu, check
the cpu id is correct and then thread will give up cpu.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2024-05-31 08:07:46 +02:00
RAJAGOPALAN GANGADHARAN
65c4ca1f05 fs: open: Add Truncate flag to zfs open
This commit has added new flag FS_O_TRUNC to support truncation
during file open. Modified fs_open to handle truncation based on
provided flags. Included unit tests for flag behavior with common
filesystems.

Signed-off-by: RAJAGOPALAN GANGADHARAN <g.raju2000@gmail.com>
2024-05-31 08:06:05 +02:00
Valerio Setti
c36d9ec3a8 test: mbedtls: do not enable USE_PSA and all PSA features
Before #72243 Mbed TLS was not using
USE_PSA and all PSA features were not enabled. After #72243
if BUILD_WITH_TFM is set:
- USE_PSA in Mbed TLS is enabled by default and
- all PSA features are enabled.

This commits reverts both changes for tests/crypto/mbedtls
test case.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-31 08:05:37 +02:00
Emil Gydesen
6b6107ccd1 Bluetooth: Audio: Rename set_sirk to just sirk
The S in SIRK is for set, so set_sirk was effectively
"set set".

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-31 08:05:24 +02:00
Yong Cong Sin
0f6272e5bc tests: debug: symtab: add test
Add test for symtab.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Ioannis Karachalios
816cf7051b tests: crypto: crypto_hash: Add support for Smartbond Pro DevKit
This commit should add support for the DA1469x Pro DevKit.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-05-30 16:51:03 -05:00
Flavio Ceolin
8c5806472e tests: random: Move and rename rng test
Random number generator is a subsystem and although it is mostly used
in crypto, this is not its only utility.

Move the current random number generator test to it is own space
(tests/subsys/random) and rename it to rng.

We need more and better tests for rng, this is an initial commit
to organize it and get ready for further tests.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-05-30 16:48:31 -05:00
Reto Schneider
134523d90c tests: drivers: dma: scatter_gather: Make transfer size configurable
Various SoCs have different limitations when it comes to DMA buffer
sizes. This change allows to chose a suitable value for them.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-05-30 16:45:30 -05:00
Bram Vlerick
52ee175be7 tests: i2c: i2c_target_api: fix test before size build assert addition
Fix the tests before a build time check is added to validate the
addressable size. Most tests have an eeprom size of 1024 defined but width
8-bit addressing, the majority of the eeprom cannot be addressed

Signed-off-by: Bram Vlerick <bram.vlerick@openpixelsystems.org>
2024-05-30 05:31:40 -07:00
Mathieu Choplain
42731a04cb tests: subsys: llext: exclude apollo4 platform
Exclude the Apollo4 platform from LLEXT tests for now,
as they currently break CI due to #72775.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-05-30 11:55:35 +01:00
Rubin Gerritsen
1aa33fe368 tests: bsim: Use the pre_init_f instead of post_init_f
When using the post_init_f to initialize the `bst_result`,
it is not possible to mark the test as
passed immediately as the `bst_result` will be
initialized after the test completes.

This change should overcome this limitation.

Bluetooth mesh tests are kept as is as we are not
sure if this will change the behavior.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-05-30 03:00:58 -07:00
Yong Cong Sin
c87dc641bc arch: generalize frame pointer via CONFIG_FRAME_POINTER introduction
Enabling `CONFIG_FRAME_POINTER` allows the users to build the
kernel with frame-pointer.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 03:00:40 -07:00
Seppo Takalo
9473f60b80 test: lwm2m: Raise POSIX_MAX_FDS for native_sim
LwM2M interoperability test binary requires a bit
more file descriptors than the default 4.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-05-30 02:59:29 -07:00
Sebastian Głąb
98d0fe4452 tests: drivers: spi: Remove inclusive language from SPI test
Rename SPI test to spi_controller_peripheral.
Remove iclusive language from that test.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-30 01:02:13 -07:00
Sebastian Głąb
b82946fba7 tests: drivers: spi: spi_slave: Extend test scope
Add possibility to test all four SPI modes (CPOL, CPHA).
Add possibility to test different bitrates.
Add tests that checks handling of zero length buffers on master.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-30 01:02:13 -07:00
Sebastian Głąb
74378f3d52 tests: drivers: spi: spi_error_cases: Enable test execution on nrf54h20
Add overlay file for nrf54h20.
Align code and DTS between spi_error_cases and spi_controller_peripheral.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-30 01:00:48 -07:00
Tom Burdick
d2ccc91d7d sensors: Add a blocking sensor_read call
Rename the current sensor_read to sensor_read_async_pool and create a
new blocking sensor_read helper.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-05-30 09:00:43 +02:00
Adrien Ricciardi
19f645edd4 tests: unit: crc: Add OpenPGP CRC-24 tests
Check CRC computation in a single step and in multiple steps.

Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
2024-05-29 10:51:21 -07:00
Andrej Butok
62fa3f729c tests: mcuboot: add boot_request_upgrade() return value check
- Adds boot_request_upgrade() return value check.
- Avoid repeating resets if the upgrade request fails.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-05-29 10:50:00 -07:00
Wilfried Chauveau
5d5c13feae samples: tfm: Remove old 'tfm' tag & update relevant boards
The 'tfm' tag was removed from the samples in in
7c80473e0a but it remained in use in other
parts of the project.
This change brings back consistency through out the project.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-05-29 10:49:31 -07:00
Bjarki Arge Andreasen
18a865355a tests: build_all: modem: remove gsm_ppp from test suite
The deprecated gsm_ppp modem driver will be removed. Remove
gsm_ppp modem driver from build_all test suite.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Jukka Rissanen
48aaa1ff40 tests: net: ieee802154: Remove extra newlines from prints
As the logger will add newlines to printed strings, do not
add them in the tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-29 10:48:34 -07:00
Jukka Rissanen
99693bee5f net: socket: Change the protocol field for AF_PACKET sockets
In order to be compatible with Linux AF_PACKET socket calls, the
protocol field needs to be in network byte order.
So for example, if user wants to receive all packets, then the
protocol field needs to be set as "htons(ETH_P_ALL)".
See Linux manual page at
https://www.man7.org/linux/man-pages/man7/packet.7.html
for details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-29 10:48:34 -07:00
Seppo Takalo
b76683e4cb net: lwm2m: Allow setting RD context without starting
When tests control the LwM2M client entirely through
shell, we should be able to set the RD client context
from the application without causing RD client to
start registration.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-05-29 10:47:57 -07:00
Valerio Setti
979ede8889 test: net: socket: do not enable USE_PSA and all PSA features
This commit fixes #73337.

Before #72243 Mbed TLS was not using
USE_PSA and all PSA features were not enabled. After #72243
if BUILD_WITH_TFM is set:
- USE_PSA in Mbed TLS is enabled by default and
- all PSA features are enabled.

This commits reverts both changes for net.socket.register.tls
test case.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-29 10:47:37 -07:00
Piotr Narajowski
20cb4c31ca bluetooth: tester: refactor CSIP btp command
Refactor CSIP btp commands by removing the 'count' parameter from
set_coordinator_lock and set_coordinator_release functions.
If we want to support lock/release procedure on subset of set members
in the future, 'count' param doesn't indicate a specific set member.
Instead, introduce 'address_count' and 'addr' array params, although their
usage is not yet implemented.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2024-05-29 14:02:33 +02:00
Alberto Escolar Piedras
b4d8b44d0f tests settings/file: Add missing overlay for native_sim//64
native_sim//64 is one of the allowed platforms
but lacks an overlay which causes the test to fail
to build.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-29 14:01:27 +02:00
Chaitanya Tata
ef533e2144 tests: spi_loopback: Fix high RAM usage
Display diff of contents for large buffers is not quite helpful and
takes up huge RAM, and if a board has less RAM then this causes the test
module build failures.

So, disable display of diff and just log a failure, small buffer tests
can be used to debug such basic issues and large buffer tests can act as
a smoke test for debugging other issues. This saves about 80K of RAM.

Fixes #72792.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-05-29 12:03:50 +02:00
Marcin Szymczyk
68c48cd116 tests: kernel: interrupt: account for table offset
When verifying sw_isr_table, take into account custom offset,
like `CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET` in some
RISC-V SoCs.

Relates to #71948 and #73232.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-05-29 11:58:44 +02:00
Jakub Zymelka
ae0822d0bf tests: drivers: uart: Add nrf54l15/cpuflpr overlays to test scope
Adding a separate overlay for nrf54l15 flpr is required because
running tests on console uart fails.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
2024-05-29 11:58:14 +02:00
Tom Burdick
054f453ea7 rtio: Callback chaining and testing
Callbacks were a bit neglected in terms of test coverage, especially
when used in chains. It was clear from the code that chained callbacks
may not actually work, and callback ordering then was hard to verify.
Test callbacks chained to transactions work as expected.

The test iodev had built up some cruft over time and in the process
showed a few bugs once callback chaining was fixed so the test iodev now
better matches typical iodev implementations at this point.

Cancellation testing now includes an added case for cancelling a the
second submission in the chain prior to calling submit noting that no
completions notifications should be given back for those.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-05-29 08:41:12 +02:00
Tomi Fontanilles
b9a7c18ce4 tests: mgmt: mcumgr: fs_mgmt_hash_supported: add unsupported platforms
- `stm32h745i_disco/stm32h745xx/m4` says "#error Flash driver on M4 core
  is not supported yet".
- `mpfs_icicle/polarfire/smp` fails in the compilation of the `spi_nor`
  flash driver.
- `cyw920829m2evk_02` fails to build because of undeclared
  `cyhal_nvm_*()` functions.

As a bonus, group the excluded platforms under the common part to
avoid repeating them.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 08:39:26 +02:00
Tomi Fontanilles
3efdbe6c0c modules: mbedtls: rename CONFIG_MBEDTLS_MAC_*_ENABLED and rm duplicates
Remove the `_MAC` part because those Kconfig options enable only hash
algorithms, nothing MAC-related, and the `_ENABLED` part to align the
naming to the Mbed TLS defines (plus we don't need such a part).

As a bonus, enabling SHA-256 does not automatically enable SHA-224
anymore.

See the migration guide entries for more details on the practical
changes.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 08:39:26 +02:00
Sadik Ozer
c121f405fe tests: drivers: gpio: Enable gpio driver tests for max32690evkit board
Enable gpio driver test for max32690evkit

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-05-29 07:30:12 +02:00
Yong Cong Sin
bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00