Commit Graph

14767 Commits

Author SHA1 Message Date
Krzysztof Chruściński f82ffc9213 tests: lib: cbprintf_package: Extend test coverage
Add test for cbprintf_package_convert function which checks if
it correctly handles array that holds string lengths. When convert
function is used twice, at first to calculate size of the output
package and then to actually convert the package, array of string
lengths can be used to optimize operation by not calculating
string lengths twice. However, array may not be able to hold all
string lengths that are needed for that package. In that case,
string lengths that did not fit into the array will be calculated
twice, in both conversions.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-01 09:56:03 -05:00
Mert Vatansever 9cfd185ab0 tests: drivers: flash: Fix MAX32666 flash error
This commit fixes flash error by correcting flash size.

Signed-off-by: Mert Vatansever <mert.vatansever@analog.com>
2024-11-01 09:55:52 -05:00
Seppo Takalo 9c9dc9f760 tests: coap_client: Add tests for poll() errors
If we receive poll() error during a request, it must
be forwarded to application.

If instead receive poll() error later, it should not be
forwarded as it might be result of application closing the
socket.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-10-31 14:17:58 -05:00
Seppo Takalo 4c6dd4c7b7 net: lib: coap_client: check poll() condition before retrying CoAP msg
Refactor the CoAP retry handling into the handle_poll() function,
so that we only try to send retries if the socket reports POLLOUT.

Also move the receiving into same loop, so when poll() reports POLLIN
we recv() the message and handle it before proceeding to other sockets.

Also fix tests to handle POLLOUT flag and add support for testing
multiple clients.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-10-31 14:17:58 -05:00
Anas Nashif ac37ba8739 tests/samples: use platform_key on cmsis_rtos tests/samples
Coverage for cmsis rtos APIS should is provided using simulation, we
should not build those on every platform we have. Avoid failures due to
incompatiblities in requirements coming from various boards and also
reduce churn and noise during testing and CI.

Fixes #80215

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-10-31 09:23:30 -05:00
Emil Gydesen 5ebe1194be tests: Bluetooth: Tester: Fix use of uninitialized cig_id for CAP
The CAP tests used u_group->cig->index but the u_group->cig may
have been deleted when the stream is released, which meant
that u_group->cig == NULL when e.g. unicast_stop_complete_cb
was called and that could cause failing tests as the index
would just be a uninitialized value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-31 09:23:16 -05:00
Piotr Krzyzanowski 74a5599ac8 samples: sensor: qdec: change pins used for qdec nrf54h20dk
Change pins that are used for qdec nrf54h20dk to align with shield
(loopbacks) used in internal CI. This change is needed to start
qdec driver power management testing.

Signed-off-by: Piotr Krzyzanowski <piotr.krzyzanowski@nordicsemi.no>
2024-10-31 09:22:58 -05:00
Daniel Leung 38825c0ac5 tests: timer_behavior: use fabs() instead of abs()
abs() takes integer as argument but time_diff_us is of double.
So use fabs() instead.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-10-30 16:31:15 -05:00
Daniel Leung cc5adf2e92 tests: timer_behavior: change sqrtf() to sqrt()
sqrtf() is used for floats but the argument and resulting
variable are both doubles. LLVM would complain about
implicit conversion from float to double. So use sqrt()
instead as it is used with doubles.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-10-30 16:31:15 -05:00
Dominik Ermel d7765ccae7 tests/stream_flash: Disable SPI_NOR on nrf54l devices
The stream flash test has been written with SoC internal
storage in mind and its simplified structure does not take
into account possibility of existence of devices with
different erase characteristics, at run time.
The commit fixes the test failing with Nordic bords that
have CONFIG_SPI_NOR=y set by default, which made test
to behave like device with erase capability has been tested.

The commit sets CONFIG_SPI_NOR=n for nrf54l devices.

Fixes #79181

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-10-30 14:29:13 -05:00
Emil Gydesen 3a8ce6efb4 tests: Bluetooth: tester: Add logging of messages for BTP
Add log statements for each command, event and response
for debugging purposes.

Tests do not send enough of these to clutter the IUT logs
and it is useful for debugging to more easily determine
what command triggered a function call or when the
responses and events are sent to the AutoPTS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-30 14:27:23 -05:00
Filip Kokosinski b17156692f tests/kernel/device: add missing `#power-domain-cells` in overlays
This commits defines the `#power-domain-cells` properties for fakedomain
nodes in the HiFive Unmatched devicetree overlay file.

Without this change, this tests fails to build for the `hifive_unmatched`
Zephyr target.

Fixes #80503.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-10-30 08:53:49 -05:00
Raffael Rostagno dbebc9983a tests: wifi: esp32c2: esp8684: RAM adjustment config
RAM adjustments to fit smaller SRAM availability on ESP32C2/ESP8684

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-10-29 14:19:06 -05:00
Alberto Escolar Piedras 14e870d8d3 tests/bluetooth/host/keys/bt_keys_get_addr: Correct mock prototypes
In 82d8f09de1
the bt_conn_foreach prototype was changed, but these unit tests
kept using the old prototype which leads to a build warning.
Let's fix the prototype in the tests.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-29 09:24:13 -07:00
Riadh Ghaddab 46e1635773 fs: zms: multiple fixes from previous PR review
This resolves some addressed comments in this PR
https://github.com/zephyrproject-rtos/zephyr/pull/77930

It adds as well a section in the documentation about some
recommendations to increase ZMS performance.

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2024-10-29 07:07:13 -05:00
Vinayak Kariappa Chettimada bb4c44153b samples: Bluetooth: broadcaster_multiple: Refactor for reuse
Refactor the sample so that multiple advertising setup can
be reused in other sample if required. Bluetooth enable can
be in the sample that reuses the advertising setup.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-27 20:26:35 +00:00
Mathieu Choplain 5e7009a120 tests: adc: adc_api: add overlay for Nucleo-WB05KZ
Add an overlay to the test to allow build for this board (needed for CI).

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-27 01:08:25 +02:00
Mathieu Choplain 59b469725b tests: adc: adc_api: add overlay for Nucleo-WB09KE
Add an overlay to the test so that it can run on STM32WB0 series hardware.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-27 01:08:25 +02:00
Torsten Rasmussen f3151571ba tests: add twister tests for CMake board and SoC extension
This commit adds new tests for verifying the functionality of the board
and SoC extension feature.

It does so by defining:
- A new CPU cluster on an existing SoC
- Two new board variants on top of an existing board

The new board variants are defined on top of the existing `native_sim`
board, so that the following native_sim board targets are available for
the test.
Existing board targets:
- native_sim/native
- native_sim/native/64

Extended board targets:
- native_sim/native/one
- native_sim/native/64/two

The new CPU cluster is defined for the existing `an521` SoC.
Existing CPU Clusters on an521:
- cpu0
- cpu1

New CPU Cluster:
- cputest

For SoC tests the mps2 board is used.
This means that for testing, the following board targets using the an521
SoC are:
- mps2/an521/cpu0
- mps2/an521/cpu1
- mps2/an521/cputest

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-26 17:14:06 +02:00
Aleksander Wasaznik 47325f8df5 Bluetooth: Host: Test L2CAP -EINPROGRESS feature
The test implementation is based on a copy of the HFC multilink test.
The test verifies that the stack respects the reference counting of SDU
buffers when the L2CAP -EINPROGRESS feature is used.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-10-26 17:13:45 +02:00
Aleksander Wasaznik abeca24702 Bluetooth: testlib: Add `BT_TESTLIB_ADDR_LE_RANDOM_C0_00_00_00_00_`
This is shorthand for random static addresses. It's similar to
`bt_addr_le_from_str`, but is a macro that results in an object literal,
making it more versatile and less verbose.

This macro only gives access to the first 255 random static addresses,
but this ought to be enough addresses for testing.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-10-26 17:13:45 +02:00
Dominik Ermel 7b701a40d5 tests: fs: fcb: Make fixed endmarker test optional
The commit splits default FCB scenario into one with endmarker
enabled, the original one, and one with disabled.
This allows to test the FCB in cases when CONFIG_FCB_ALLOW_FIXED_ENDMARKER
is set and not set.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-10-26 11:31:25 +02:00
Jilay Pandya 367f853a4c drivers: stepper: rename compatible of gpio-stepper
This commit fixes minor copyright issues and corrects the compatible of
gpio-stepper with the vendor name as zephyr

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-10-26 11:29:57 +02:00
Sudan Landge 3092d96e5b boards: mps3: Add support for corstone300/an552
What is changed?
 - Added a new mps3 board an552 for the soc corstone300.
   The qualifier to build/run application with board mps3/an552 is
   `mps3/corstone300/an552` for secure and
   `mps3/corstone300/an552/ns` for non-secure.
 - Added FVP variant to enable FVP testing with corstone300
   and it uses the ARM FVP `FVP_Corstone_SSE-300_Ethos-U55`.
   The qualifier to build/run application with FVP is
   `mps3/corstone300/fvp` for secure and
   `mps3/corstone300/fvp/ns` for non-secure.
 - Note: the qualifier to build/run application with board mps3/an547
   is now changed to
   `mps3/corstone300/an547` for secure and
   `mps3/corstone300/an547/ns` for non-secure.

How is it changed?
 - Moved common code from mps3/an547 to corstone300.
 - Renamed soc for an547 to corstone300 and added
   a new soc corstone300/an552.

Why do we need this change?
 - This enables FVP support and testing for corstone300.
 - SOC/qualifier for mps3/an547 was renamed to reduce code redundancy
 - A separate FVP variant was added for AN552 because, the TFM board
   used for non-secure variant differs for FPGA and FVP.
   TFM board `arm/mps3/corstone300/fvp` should be used when testing
   AN552 with FVP and `arm/mps3/corstone300/an552` should be used when
   testing with AN552 FPGA.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2024-10-26 03:58:05 +01:00
Raffael Rostagno 5e3fe2765a tests: counter: overlays: Files cleanup
Moving overlay files from boards to socs as cleanup of
redundant configs.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-10-26 03:57:23 +01:00
Raffael Rostagno 891b946bc6 tests: counter: rtc: Change clock source for precision
Clock source is changed from RC_SLOW to RC_FAST_D256 in order
to improve clock precision and avoid tests failing due to
lower precision of RC clock (around 10%).

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-10-26 03:57:23 +01:00
Reto Schneider 17d9e75e3b bluetooth: shell: Test BT_CTLR_DTM
This ensures that enabling BT_CTLR_DTM does not break the compilation of
the Bluetooth shell.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-26 03:55:41 +01:00
Dominik Ermel 23805301b0 tests/storage/stream_flash: Add erase range check test
The commit adds test for stream_flash_erase_page range check.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-10-25 22:45:14 +01:00
Emil Gydesen 1dd59ea203 Bluetooth: Audio: Remove BT_AUDIO_BROADCAST_CODE_SIZE
Removed the LE Audio specific definition and instead
refer to the value defined by iso.h as it is ISO/Core
that defines this size, and not BAP/Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-25 22:43:40 +01:00
Jukka Rissanen ea099b039f tests: net: wifi: Disable native/64 from tests
There are issues with 64 bit compilation in hostap so disable
native_sim/native/64 board from the tests. The board will be
enabled again after updating the hostap from upstream and fixing
the issues.

Fixes #80437

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-25 22:42:28 +01:00
Declan Snyder 5f51b0acba boards: frdm_mcxw71: Enable ADC and tests/sample
Enable LPADC on the FRDM_MCXW71 and add overlays for tests and sample

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-10-25 18:52:10 +01:00
Alberto Escolar Piedras 28edb220cd tests: Support targeting unit_testing with and without qualifier
For tests that support both targeting unit_testing and
other targets, we check in the cmake code the BOARD variable.
Let's allow users to set this to either of unit_testing
or unit_testing/unit_testing so it behaves like for other
tests.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-25 18:51:10 +01:00
Alberto Escolar Piedras 9ceeb9bfef tests/ztest/fail: Fix yaml description
Fix filtering done in
22c3438f1b
Otherwise we end up with tests defined twice, as a .unit and .zerphyr
variant but both run in normal builds, and none for unit tests.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-25 18:51:10 +01:00
Alberto Escolar Piedras 99d7161e34 tests/ztest/fail: fix board name
Use full board name in cmake file.
Akin to the fix done in
https://github.com/zephyrproject-rtos/zephyr/pull/80270/
following the changes from
https://github.com/zephyrproject-rtos/zephyr/pull/77250/

Note after the Zephyr cmake code has been run the BOARD
variable is split into BOARD BOARD_QUALIFIERS,
where BOARD does not contain the qualifiers anymore
(see cmake/modules/boards.cmake for more info).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-25 18:51:10 +01:00
Mathieu Choplain 31fea97e05 tests: dma: loop_transfer: add overlay for Nucleo-WB09KE
Add an overlay to the test so that it can run on STM32WB0 series hardware.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-25 14:22:06 +02:00
Mathieu Choplain 35835f8d47 tests: dma: chan_blen_transfer: add overlay for Nucleo-WB09KE
Add an overlay to the test so that it can run on STM32WB0 series hardware.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-25 14:22:06 +02:00
Fredrik Danebjer f970b066d2 Bluetooth: audio: Add possibility to use static broadcast id
Removed the generation of broadcast id inside the stack. It is now up
to the application to generate this by itself. The CAP sample has
been modified to allow either a static broadcast, or a random one.
All of this is handled in the application.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2024-10-25 14:07:25 +02:00
Olivier Lesage 7e72d46e2e bluetooth: host: Add helper function for parsing PCTs
The 12-bit signed values for the results of PBR are a bit
cumbersome, so this adds a helper function to make it easier to work
with the HCI formatted steps.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-10-25 14:06:25 +02:00
Olivier Lesage 635d03b7e0 bluetooth: host: Unit tests for bt_le_cs_step_data_parse
Add unit tests for bt_le_cs_step_data_parse.
Also exit early (without calling the function pointer) if the next
step would seem to read out of bounds.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-10-25 14:06:25 +02:00
Krzysztof Chruściński a04c1db9a4 tests: drivers: uart: uart_async_api: Add nrf54l15dk//cpuapp overlay
Add overlay for nrf54l15dk/nrf54l15/cpuapp target.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-25 14:02:03 +02:00
Jamie McCrae d9312524eb tests: mgmt: mcumgr: Add transport_lorawan test
Adds a test to ensure that the LoRaWAN MCUmgr transport builds with
all options enabled and all options disabled

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-10-25 14:00:48 +02:00
Phi Bang Nguyen 59e253ed4a drivers: video: csi: Drop source device phandle reference
The peer remote device "source_dev" can be retrieved from the
remote-endpoint-label. Direct reference via phandle is not needed.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-25 08:54:57 +02:00
Trung Hieu Le a182394725 drivers: video: mipi_csi2rx: Set clocks according to pixel rate
Instead of fixing csi2rx clock frequencies, set them according to the
pixel rate got from the camera sensor.

Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-25 08:54:57 +02:00
Phi Bang Nguyen f82b0d5681 drivers: video: mipi_csi2rx: Drop sensor device phandle reference
The peer remote device "sensor_dev" can be retrieved from the
remote-endpoint-label. Direct reference via phandle is not needed.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-25 08:54:57 +02:00
Phi Bang Nguyen 328f40fddb dts-bindings: video: mipicsi2rx: Use video interfaces bindings
Switch to use the new video interfaces bindings

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-25 08:54:57 +02:00
Phi Bang Nguyen 30604a8a76 dts-bindings: video: ov5640: Use video interfaces binding
Switch to use the new video interfaces binding

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-25 08:54:57 +02:00
Krzysztof Chruściński d480093cd6 tests: drivers: uart: async_api: Use custom long buffer for nrf54h20
nrf54h20dk_nrf54h20_cpurad by default has less RAM dedicated for
DMA transfers and default 1k buffer cannot be used for
uart_async_long_buf case. Use custom value.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-25 08:53:15 +02:00
Krzysztof Chruściński d612982b14 tests: drivers: uart: async_api: Make long buffer configurable
One of the test case is performing long transfers using 1k buffers.
For some targets there may be not enough RAM to perform such
transfers. Make long buffer length configurable.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-25 08:53:15 +02:00
David Leach eb45e49a02 tests: mcuboot: remove twr_kv58f220m from allowed list.
mcuboot is not supported on twr_kv58f220m. Removing from
allowed list.

Fixes #78951

Signed-off-by: David Leach <david.leach@nxp.com>
2024-10-25 08:52:44 +02:00
Laczen JMS 435587d368 settings: Add test for settings commit priority
Add a test to validate settings commit priority

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2024-10-24 22:04:07 +01:00