Commit graph

12908 commits

Author SHA1 Message Date
Alberto Escolar Piedras 1f4f307bd2 samples|tests/* yamls: Replace all nrf5340bsim hwmv1 names w hwmv2 version
Replace all instances of
nrf5340bsim_nrf5340_cpunet & nrf5340bsim_nrf5340_cpuapp
with
nrf5340bsim/nrf5340/cpunet & nrf5340bsim/nrf5340/cpuapp
In these samples/tests twister yamls definitions.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-21 15:23:56 +01:00
Alberto Escolar Piedras 4235efc7bd samples|tests several: Support using nrf5340bsim hwmv2 names
For all samples which handle the nrf5340bsim in some special way
(for example in sysbuild files, or by checking what samples are
supported) handle also building with the hwmv2 names.

Also, let's fix the cmake info message in these respective
samples which tells the user which board target is used for which
part of the app.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-21 15:23:56 +01:00
Alperen Şener de41005fe9 tests: bluetooth: Update ICS for Mesh v1.1, DFU v1.0 and MBT v1.0
Mesh v1.1, DFU v1.0 and MBT v1.0 are supported by default in the stack.
In this regard, this commit updates the ICS file and Launch Studio
Project file to reflect supported features.

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2024-03-21 12:40:07 +01:00
Aleksander Wasaznik 1e2b889bbb Bluetooth: tests: use global testlib in read_fill_buf
This deduplicates a copy of testlib from before testlib was a globally
available cmake library.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-21 10:08:01 +00:00
Jordan Yates 61ee9f4fbf tests: logging: log_api: test LOG_WRN_ONCE
Add a test for the `LOG_WRN_ONCE` wrapper around `LOG_WRN`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-03-21 10:07:36 +00:00
Declan Snyder 557e5969f3 boards: rd_rw612_bga: Enable counters
Enable CTimer0 and MRT0 channel 0 by default on the board,
and add more of the device instances in the counter api test overlay.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-03-21 09:06:48 +01:00
Dominik Ermel 4c8ed7dd9a devicetree.h: Rework DT_ANY_INST_HAS_PROP_STATUS_OKAY
The macro is searching for all instances of specific device
that contain specific property and evaluates to true (1) if
any device does.
The macro used to do that by generating, using
DT_ANY_INST_HAS_PROP_STATUS_OKAY, a logical expression
like (0 || 1 || 0), where each digit represented existence of
property (1) or lack of it (0).
Unfortunately other util macros, like IS_ENABLED, were
not able to evaluate such expression, as they often simply
expect something they can evaluate to 0 or 1.

The commit here changes DT_ANY_INST_HAS_PROP_STATUS_OKAY
to generate a list of tokens (1) where token is added to list
only for instance of a device that has the property;
then such list is processed using IS_EMPTY() macro and
in the end 0 or 1 is generated, depending on whether
any enabled instance of a device has the property or not.
This change allows result of DT_ANY_INST_HAS_PROP_STATUS_OKAY
to be used with macros like IS_ENABLED, IF_ENABLED or
COND_CODE_x.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-03-20 16:52:48 +00:00
Alberto Escolar Piedras f532937e92 tests|scripts/net: Change native_posix references to native_sim
* As we are replacing native_posix with native_sim, let's
  refer to native_sim instead of native_posix in the comments
  of why we have 1 extra interface.

* scripts/net/run-sample-tests.sh builds for native_sim now,
  not native_posix => let's fix it

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-20 15:43:05 +01:00
Pieter De Gendt 5f3a69fada tests: drivers: build_all: ethernet: Build without L2
Limit the number of files built when building ethernet device drivers.
Use the ETH_DRIVER_RAW_MODE to provide weak funtions for upper layer
handling.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-20 08:05:55 -05:00
Nithin Ramesh Myliattil 139a40098b Tests: Bluetooth: Host: update rpa expired bsim to cover more use cases
rpa expired bsim is refactored so that every rpa rotation, one of
the adv set belong to an adv_id returns false based on adv_index.
In turn all adv sets under the same adv_Id continues with old rpa.

Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
2024-03-20 07:55:49 -05:00
Benedikt Schmidt 370c977b4e tests: drivers: build_all: sensor: add sensors of MAX31790
Add instances for the senors of MAX31790 to the
build all tests.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-03-20 07:38:18 -05:00
Benedikt Schmidt 961c985ee4 drivers: pwm: split up driver for MAX31790 into a MFD
Split up the driver for the PWM controller MAX31790
into a multi function device driver.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-03-20 07:38:18 -05:00
Fabio Baltieri 2c5b992209 input: pmw3610: add few config options
Add config options for resolution, force awake and smart mode.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-20 09:02:50 +01:00
Guillaume Gautier edbfe9a4c7 tests: drivers: adc: adc_api: boards: add stm32 boards
Add STM32 boards overlays for all series supporting ADC DMA.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-20 09:02:04 +01:00
Guillaume Gautier 4102d3c452 tests: drivers: adc: remove adc_dma test
adc_dma test is now redundant with adc_api test, so it can be removed.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-20 09:02:04 +01:00
Guillaume Gautier 5eb045dc83 tests: drivers: adc: adc_api: add dma test
Move ADC DMA tests directly into adc_api test for Kinetis and STM32 boards.
Needs to disable CONFIG_TEST_USERSPACE for this subtest because of caching
issue for STM32H7 (as it was done dor adc_dma test).

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-20 09:02:04 +01:00
Daniel Leung aa09b41f29 tests: kernel/userspace: skip other thread tests if needed
With memory domain enabled, all threads within the same domain
have access to each other threads' stacks, especially with
CONFIG_ARCH_MEM_DOMAIN_SYNCHRONOUS_API enabled (as it is
expected behavior). So update the conditions to skip both
tests to read and write to other threads' stacks.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-19 22:17:34 -04:00
Daniel Leung 2fc55f3938 tests: kernel/mem_protect/userspace: support for Xtensa MPU
Add support to test for Xtensa MPU.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-19 22:17:34 -04:00
Aleksander Wasaznik f82a86c21b Bluetooth: testlib: bt_testlib_connect: better error logs
Changes to logging:
 - Don't log "Connected" if there was an error.
 - Identify the relevant bt_conn object in log messages by its index.
 - Special case non-fatal errors:
  - Failure due to out of free conn object is INF.
 - Improve transparancy of error messages:
  - For errno, include the name of the API.
  - For HCI errors, include the common prefix of the symbols
    'BT_HCI_ERR_' so they are easier to look up.

This change includes some light refactoring to make the code more
understandable, but does not change any behavior.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-19 21:15:44 -05:00
Alberto Escolar Piedras 6161207e30 tests/drivers/dma: Run on native_sim instead of native_posix
native_posix is being replaced with native_sim, let's
have this tests be run on native_sim instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-19 13:15:48 -05:00
Alberto Escolar Piedras ecf29a2f46 tests/bsim/bt l2cap/stress: Be more silent
This test was way too verbose (produced a log over 65000 lines
long).
Let's mute it a bit. If the test fails, developers
can raise the log level as needed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-19 10:25:07 -05:00
Alberto Escolar Piedras f4972347d4 tests/bsim/bt l2cap/stress: Increase runtime timeout
This test has been seen failing in the new runners
due to a (realtime) timeout.
Let's double the timeout so it does not.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-19 14:30:22 +01:00
Marc Herbert 7a21c6f16a tests: llext: fix conflict between BUILD_ONLY and "object" case
Fix conflict between commit ce24394437 ("llext: add object test case")
and commit 1408d1e5b8 ("tests: llext: compile architectures not
supported yet") which were tested separately but merged at the same
time.

Github "Merge Queues" can avoid this (and save resources) but:
- they're not used by Zephyr CI
- they provide confusing feedback

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-19 10:28:52 +01:00
Henrik Brix Andersen c6583e7672 tests: drivers: can: timing: enable all bitrates on select boards
Enable testing of all CiA recommended bitrates on the following boards:
  - stm32h735g_disco

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen a472870b6d tests: drivers: can: timing: enable all bitrates on simulators/emulators
Enable testing of all CiA recommended bitrates on the following
simulated/emulated boards:
- native_sim
- native_sim_64
- native_posix
- native_posix_64
- qemu_x86
- qemu_x86_64

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 91751f4fc2 drivers: can: fake: use CiA recommeded configurations ranges
Use the CAN clock and configuration ranges recommended by CAN in Automation
(CiA). Adjust the CAN shell test, which makes use of the fake CAN
controller driver, to match the new timing limits.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen cae4dd8e1a tests: drivers: can: timing: assert at least one bitrate test supported
Some CAN controllers may be unable to meet all bitrates due to timing
restrictions, but assert that at least one of the tested bitrates was
supported.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 9f174ec452 tests: drivers: can: timing: add tests for all CiA recommended bitrates
Add tests for all CAN bitrates recommended by CAN in Automation (CiA). The
newly added bitrate tests are guarded by new, local Kconfig option
(CONFIG_TEST_ALL_BITRATES) to avoid breaking existing board tests.

Some boards may need adjustments to their CAN core clock in order to pass
the newly added tests. Once a board is confirmed to meet these additional
checks, this Kconfig can be enabled for that board to avoid future
regressions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen f9dc6f7d13 tests: drivers: can: timing: do not test additional sample points
Remove tests for additional sample points as this does not provide any real
value.

The purpose of this test suite is to see if the selected CAN clock allows
meeting the standard bitrates and sample points used by Zephyr. Any
tweaking needed for a specific board or system design is left up to the
user and not something that can be covered by testing a few additional
sample point locations.

Change a few comments and remove an unneeded conditional while here.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 675ce0d255 tests: drivers: can: timing: remove support for invalid test configs
Remove now unused support for specifying invalid timing test
configurations.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen d0ec48cb60 tests: drivers: can: move tests for invalid sample points to API test suite
Move the tests for using invalid sample points from the CAN timing tests to
the CAN API tests as these are validating basic API behavior.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen fa00a73e76 tests: drivers: can: move tests for too high bitrates to API test suite
Move the tests for setting a too high bitrate from the CAN timing tests to
the CAN API tests as these are validating basic API behavior.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 8ccccbbb88 tests: drivers: can: move min/max timing tests to API test suite
Move the test for setting the minimum/maximum supported timing parameters
from the CAN timing tests to the CAN API tests as these are validating
basic API behavior.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Marc Herbert 1408d1e5b8 tests: llext: compile architectures not supported yet
For now llext supports a very limited number of architectures.  This
restriction is enforced by add_llext_target() in CMake at configuration
time.

Add a new `LOADER_BUILD_ONLY` conditional in tests/subsys/llext/simple/
and a new `llext.simple.loader_build`, `build_only` test that does not
invoke `add_llext_target()` and only compiles the llext framework code.

This helps find and fix bugs in `subsys/llext/*.c` and make it ready to
be used when add_llext_target() limitations are lifted.

Note this is pure `tests/` change without any change in the actual llext
framework code. The existing test is only modified to conditionally
invoke add_llext_target().

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-18 20:50:01 -05:00
Alberto Escolar Piedras 337769c7db tests/drivers/build_all/w1: Run on native_sim instead of native_posix
native_posix is being replaced with native_sim, let's
have these tests be run on native_sim instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-18 22:11:59 +01:00
Alberto Escolar Piedras 731ba72423 tests/bsim: Reorder tests to avoid failure in GATT/SR/GAS/BV-01-C
GATT/SR/GAS/BV-01-C has just broken due to what appears
like a minor timing change.
This indicates the test may be too time sensitive.
Just reordering the tests, it passes again.
So let's reorder the test list, and we get the minor
benefit of havign them move alphabetically ordered.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-18 19:11:53 +00:00
Andrzej Głąbek 787e245761 tests: Replace nRF54H20 PDK with nRF54H20 DK
nRF54H20 PDK is superseded by nRF54H20 DK and will no longer be
supported.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-03-18 19:11:36 +00:00
Daniel DeGrasse d921659d6a boards: nxp: rd_rw612_bga: enable DMA support
Enable support for dma controller on RD RW612 BGA board, and add overlay
to enable board in dma loop transfer test

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-18 18:57:03 +01:00
Gaetan Perrot 99f62a749c posix: Implement tests for set and get scope APIs for pthread attr
Add tests for `pthread_attr_setscope()`
and `pthread_attr_getscope()`

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-18 10:15:53 +01:00
Henrik Brix Andersen 41960ab366 dts: bindings: can: remove optional sample point properties
Remove all optional, initial CAN sample point properties and rely on the
CAN timing calculations to automatically pick the preferred sample point
location based on the initial bitrate.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-17 15:36:19 +01:00
Alberto Escolar Piedras 3981b9a560 tests/drivers/build_all/w1: Add gpio dependency
This driver enables CONFIG_GPIO, so if we try
to target a board which does not support it it
will fail.
Let's add the required tag in the testcase yaml.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-17 15:35:53 +01:00
Declan Snyder d1029da089 tests: spi_loopback: Support rd_rw612_bga
Add rd_rw612_bga to spi loopback test

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-03-15 18:07:45 -04:00
Jiafei Pan ee4131afc1 tests: gpio_basic_api: change imx93 evk board name
Updated according to hardware model v2 board name changes.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-03-15 17:13:41 -04:00
Daniel DeGrasse ec5df8a0e5 treewide: fix board identifier in overlays for lpcxpresso55s69
Fix board identifier in overlays for the lpcxpresso55s69_cpu0 target.
Board identifiers were renamed with the following command:

for file in $(find . -name "lpcxpresso55s69_cpu0.*"); do;
	mv $file ${file/_cpu0/_lpc55s69_cpu0};
done

Additionally, remove lpcxpresso55s69_ns overlay targets where they are
no longer needed (or rename them where they are)

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-15 17:12:08 -04:00
Flavio Ceolin 417747886c tests: sprintf: Avoid buffer overrun
fwrite parameters are "size_t size" and "size_t nmemb",
when writing a string we should set sizeof(char) and len(string).
The test is doing it wrongly and making the function read more
memory than it should.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-03-15 17:08:58 -04:00
Alberto Escolar Piedras 88e48375ec tests/modules/nanopb: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 0d5ac4ef11 tests/ztest: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 8abdc49664 tests/subsys several: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 94a8681527 tests/subsys/dfu: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 5ddb8d499e tests/subsys/fs: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00