Commit graph

16700 commits

Author SHA1 Message Date
Daniel Leung
ea109ce39b tests: logging/dictionary: filter for backend
Since only the UART backend supports output in hexidecimal form
with dictionary logging, so filter for that or else the pytest
would fail due to none, or wrong captured output.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-07-09 17:24:02 -04:00
Mathieu Choplain
1fd9dc85b2 tests: drivers: adc_api: use proper printf format
This commit changes the adc_api test to use the proper printf
format specifier when printing the ADC samplings. This ensures
that all values are printed on 16-bit. Without this specifier,
negative values are sign-extended and printed on full integer
size (e.g., 0x8000 -> "0xFFFF8000").

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-07-09 17:23:30 -04:00
Luis Ubieda
5686ac48cc tests: rtio: workq: Add testsuite to exercise RTIO work-queues
Basic tests demonstrating ability to decouple, batch-submit, preempt
and keep track of used items.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda
1f3a0910d7 tests: sensor: generic: Set thread priorities for back-to-back readings
In order to support back-to-back readings, it's required that the
RTIO workq threads priority is higher than the caller issuing the
back-to-back requests, otherwise the requests will fail as P4WQ won't
have the opportunity to clear the is_done semaphore, and the subsequent
request will be rejected.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Robert Lubos
b4cfee090d net: lib: http_server: Implement proper CONTINUATION frame processing
CONTINUATION frames are tricky, because individual header fields can be
split between HEADERS frame and CONTINUATION frame, or two CONTINUATION
frames. Therefore, some extra logic is needed when header parsing
returns -EAGAIN, as we may need to remove the CONTINUATION frame header
from the stream before proceeding with headers parsing.

This commit implements the above logic and additionally adds more checks
to detect when CONTINUATION frame is expected. Not receiving a
CONTINUATION frame when expect should be treated as a protocol error.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
adfdc54434 net: lib: http_server: Update HTTP2-specific structs/enums naming
For HTTP2-specific structures and enums, use "http2_" prefix to clearly
indicate the distinction from the generic HTTP stuff.

Additionally, some structures/enums describing HTTP2 protocol details
had "server" in the name, while in reality they describe nothing
server-specific. Hence, drop the "server" part where applicable.

Remove unused macros.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Bjarki Arge Andreasen
cdff2575a7 tests: rtc: time_incrementing: set nsec member
The rtc test suite uses timegm to convert a unix
timestamp to datetime, specifically struct tm which has no
nsec field, so the nsec field is not initialized properly.

Update tests to init nsec and isdst members of struct rtc_time.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-07-09 19:03:49 +02:00
Francois Ramu
f3c70b4ab8 tests: drivers: clock control testing on the stm32h7 serie
Disable the pll2 when clearing the clock config prior to
testing the clock_control driver for the stm32h7

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-07-09 19:03:10 +02:00
Krzysztof Chruściński
44c2b19d5e tests: kernel: timer: behavior: pytest: Adjust max stddev
Like in C test. If MAX STDDEV is lower than single clock cycle then
set it to a single clock cycle.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 19:02:51 +02:00
Krzysztof Chruściński
1968cdf556 tests: kernel: timer: timer_behavior: Tweak expected std deviation
If frequency of the system clock is lower then deviation may exceed
default value (10us). Instead of adjusting the default value, test is
rounding up expected standard deviation to a single clock cycle.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 19:02:51 +02:00
Mykyta Poturai
ddb3234884 json: test: Add test for array elements alignment
Add test to check that alignment and offsets of object array elements
are calculated correctly.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
2024-07-09 19:02:25 +02:00
Krzysztof Chruściński
4a53c69fa5 tests: logging: log_api: Fix logging.frontend.only.rt_filtering
When NO_BACKENDS was not defined then log backends were
initialized (even though not used). During the initialization
filters for that backends were configured and because of that
messages were not filtered out as expected.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 14:01:56 +02:00
Pieter De Gendt
5e4e51de78 tests: zbus: unittests: Add CMAKE_LINKER_GENERATOR case
Add a test case where the CMAKE_LINKER_GENERATOR is used.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 12:02:51 +02:00
Evgeniy Paltsev
4b9828c2a8 tests: logging: fix build error
Currently we get the build error when building
'tests/subsys/logging/log_backend_uart':

error: static_assert expression is not an integral constant expression
BUILD_ASSERT(strlen(TEST_DATA) < SAMPLE_DATA_SIZE);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It can be easily workarounded by using sizeof instead of strlen
to calculate string size.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-09 08:49:05 +02:00
Evgeniy Paltsev
edfb690587 test: logging: dictionary: fix build error
In `tests/subsys/logging/dictionary` we don't include stdio.h
header but use standard stream definitions (i.e. `stdout`)
which cause build issues (if the minimal libc is used).

Fix that.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-09 08:48:24 +02:00
Marc Herbert
65f63622e2 tests: cpp: add C++ coverage for pm/device.h
Note CONFIG_PM_* affects device.h too. Even if not compiled, the more
code the pre-processor sees the better.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Marc Herbert
c25b9b240e tests: cpp: add some C++ coverage for device.h / Device Tree
This provides C++ build test coverage for device.h (notably:
Z_DEVICE_INIT() fixed in the previous commit) and for some other Device
Tree macros.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Zhaoxiang Jin
5b8bac37d0 tests: adc: Add 'zephyr,vref-mv' property.
Add 'zephyr,vref-mv' property to frdm_mcxn947 overlay file.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-07-08 14:57:55 -04:00
Zhaoxiang Jin
599fddc867 tests: Add frdm_mcxn947 into regulator and adc test scope
Add frdm_mcxn947 into regulator and adc test scope

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-07-08 14:57:55 -04:00
Szymon Janc
7bfd6b6256 test: bluetooth: Update ICS to TCRL 2024-1
This ICS was generated with new Qualification Workspace tool.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-07-08 14:57:12 -04:00
Szymon Janc
8665117411 test: bluetooth: Remove qualification project BLS file
With new BT SIG Qualification Workspace it is no longer possible to
export/import full project. Only ICS export/import is possible.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-07-08 14:57:12 -04:00
Alberto Escolar Piedras
bf53b06a06 tests/drivers pwm_clock: Build fix sam_v71_xult
Fix build error due to cmake requiring a separate
overlay for each of this target's SOCs.

Error being fixed:
```
-- Board: sam_v71_xult, qualifiers: samv71q21
CMake Error at cmake/modules/extensions.cmake:2742 (message):
  Board sam_v71_xult defines multiple SoCs.

  Shortened file name (sam_v71_xult.overlay) not allowed, use
  '<board>_<soc>.overlay' naming
```

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-08 14:55:15 -04:00
Alberto Escolar Piedras
a912bb6f14 tests/subsys/ipc/pbuf: Filter out partial native/posix arch builds
Some AMP native simulator targets (like the nrf5340bsim net core)
will not produce a final executable if only one of the core images
is built, when IPC is enabled, as those images require the other
core image to be able to link.
So this test cannot be run when targetting that core alone
(without using sysbuild to build the other).

Let's filter out these targets to avoid twister building
but finding itself with no executable and error out badly
as it cannot run the test.

The filter condition is effectively:
If building for a native target, there must be an .exe being
produced.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-06 17:03:26 +02:00
Emil Gydesen
d05f211289 tests: Bluetooth: tester: Re-add support for checksum
The bug should be fixed now, so it possible to have it enabled as
long as OTS is not registered with the feature flag.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-06 17:02:23 +02:00
Daniel Leung
4ffb813110 tests: logging/dictionary: wait longer for first output
Some hardware takes longer to boot before any output is visible
from the app. So lengthen the initial timeout on waiting for
any output.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-07-04 18:00:47 -04:00
Daniel Leung
ddfc39bd63 tests: logging/dictionary: fix pytest log parsing regex
When doing device testing, there may be some other characters
being printed before the dictionary logging header string.
Also the delay boot banner may also be there. So change
the regex to ignore those them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-07-04 18:00:47 -04:00
Daniel Leung
04c9637db7 tests: logging/dictionary: fix pytest when built with sysbuild
With sysbuild, the test app is actually built under another
layer of directory where the dictionary JSON file will reside.
Instead of simply using dut.device_config.build_dir, use
dut.devive_config.app_build_dir instead, which takes into
account of that.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-07-04 18:00:47 -04:00
Jonathan Rico
3af358d6fd Bluetooth: remove host/adv/resume test
This test verifies a convoluted interaction between the scanner and the
resumable advertiser feature in the host.

That feature is going away, see #72567.

Prepare that work by removing this test that's in the way.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-07-04 18:01:03 +02:00
Aleksander Wasaznik
c33e721c01 Bluetooth: host: test: remove adv/resume2
I am the original author of the test that is being removed. The test was
added in https://github.com/zephyrproject-rtos/zephyr/pull/70670 to try
to specify the behavior of automatic advertiser resuming in the Host.

It turns out now that the behavior of this feature depends on which
Controller is in use and can fail incorrectly.

The test assumes the DUT will be able to create `CONFIG_BT_MAX_CONN`
peripheral connections. But this is not necessarily true. E.g. Some
Controllers, like the SoftDevice Controller, may reserve some Host
connection slots for central roles, making the max number of peripheral
connections smaller.

In conclusion, the test is not correct and should be removed.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-07-04 13:26:01 +02:00
Alberto Escolar Piedras
1df86af309 Revert "net: sockets: move poll implementation to zvfs"
This reverts commit 93973e2ead.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
14e4de6415 Revert "net: sockets: move select() implementation to zvfs"
This reverts commit 49ac1912b2.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
1a2d508e68 Revert "posix: device_io: implement pselect()"
This reverts commit 305ec62a6b.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
ade54b35ca Revert "posix: device_io: use mode argument correctly in open()"
This reverts commit 499a633976.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
0642737847 Revert "tests: posix: headers: add checks for posix signals option group"
This reverts commit 308322e9b9.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Mathieu Choplain
38ab4b38db tests: dma/chan_blen_transfer: place TX buf in RAM
This commit removes the const qualifier from TX (source) buffer
of the chan_blen_transfer DMA test to ensure it gets placed in
RAM rather than flash. This ensures the test can pass on hardware
where the DMA controller is unable to access flash.

Fixes #75125.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-07-03 15:27:26 +02:00
Tahsin Mutlugun
700ebe1b55 tests: drivers: i2c: i2c_target_api: Use address-width property
Boards that use 1024 byte EEPROM buffers need 16-bit address widths
otherwise eeprom_target driver will cause build failure.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-07-02 19:24:13 -04:00
Tahsin Mutlugun
223447262c tests: drivers: i2c: i2c_target_api: Support 16-bit word addresses
Existing tests fail when 16-bit address width is used. Adjust the code
to support 16-bit addresses as well.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-07-02 19:24:13 -04:00
Sreeram Tatapudi
d0474cefde tests: bluetooth: shell: Enable flow control
Enabling UART flow control for CYW20829

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-07-02 09:35:33 +02:00
Declan Snyder
94815e7955 tests: arm_irq_vector_table: Fix RT/WXXX
Fix preprocessor expression for custom vector table due
to OS timer isr being needed. The parentheses are missing.
Also add RW6xx to the list which has the same isr needed for ostimer.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-02 09:19:46 +02:00
Gerson Fernando Budke
768b8bbca3 scripts: west robot & simulation: Fix OOT
The current version of scipts do not consider OOT boards use cases and
the tests with robot now are strict to only one robot file, which is
not realistic for real environment. This address those issues and allow
multiple testsuits at command line and lists at tests entries. It add
another test parameter to allow configure robotframework options.

Fixes: #74563

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2024-07-01 16:10:35 -04:00
Krzysztof Chruściński
7a6b355535 tests: boards: nrf: dmm: Adjust test to dmm changes
After changing dmm to not apply data cache line alignment for all
regions test needs to be aligned.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-01 16:08:39 -04:00
Krzysztof Chruściński
ce157c689d tests: lib: spsc_pbuf: Do not run test with cache
Test was using a configuration which enforces cache management in the
packet buffer. However it shall not be used if producer and consumer
is the same core. Testing this configuration on a single core does
not make sense as it actually fails on cores with data cache.

Making this configuration build_only so it is checked against
compilation errors.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-01 16:07:30 -04:00
Krzysztof Chruściński
e367231f29 drivers: uart: uart_elementary: Add missing pull-ups to nrf54h20dk
Add missing pull-up for RX pin in nrf54h20dk dual uart configuration.
Lack of pull-up was causing test failures.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-01 09:05:33 -04:00
Bjarki Arge Andreasen
5343ae6817 tests: drivers: rtc: rtc_api: add config for alarm time mask
RTCs support a variety of combinations of alarm time fields, set
by the alarm time mask. Until now, alarm tests have selected
only the minute and hour fields, as these are always supported,
but some RTCs require setting every supported field when setting
the alarm time, while other RTCs don't support setting every field.

To support all RTCs in the test suite, a configuration has been
added which makes the alarm time mask configurable. Boards can now
define the specific alarm time mask they want to test within
their boards .conf files.

Additionally, the alarm tests have been refactored to not depend
on the time.h library to determine the struct rtc_time times to
set as these are constant, so they are now provided as const
structs instead.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-28 20:58:22 -04:00
Johann Fischer
a79700623d tests: drivers: udc: add build_only test case
nRF54H20 USB device controller cannot be enabled without VBUS, but the
device should not be connected to the host during testing. Add it to
build_only section.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-28 20:56:47 -04:00
Johann Fischer
ef512305fb tests: drivers: udc: updates to pass testing on supported platforms
Do not halt control endpoint, control endpoint may not be enabled when
there no host is connected. Yield after buffer is queued to allow the
driver to work.

Tweak pool size and number of buffers to pass the test with high-speed
drivers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-28 20:56:47 -04:00
Henrik Brix Andersen
1c0f241b92 tests: drivers: can: api: restore default bitrates
Restore the default CAN bitrates after having tested setting bitrate and
timing. This ensures the arbitration phase bitrate is proportional to the
data phase bitrate, allowing CAN FD transmission tests to complete.

Fixes: #73723

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-28 20:55:53 -04:00
Daniel Leung
9a08fdc1df tests: logging/dictionary: enable pytest to test output
Add pytest to test the output of dictionary logging to make sure
the encoded logs can be decoded back into strings, and to also
make sure the decoded logs have the expected strings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-28 21:14:14 +02:00
Daniel Leung
d1c222a7c7 tests: logging: copy dictionary logging sample into tests
This is in preparation for introducing pytest to test the output
of dictionary logging. Code is the same, but the testcase.yaml
is trimmed to only those that can be tested.

Note that a copy is made instead of moving the whole sample over
is simply due to various documentation having references to
the sample. Since RST files under tests/ are not parsed for
zephyr:code-sample:<name>, the linking would have been vanished.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-28 21:14:14 +02:00
Jordan Yates
3905e8d6be tests: lib: cmsis_nn: add missing filter dimension
Specify the missing filter dimension that was the reason for the v6.0.0
version bump.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-28 07:50:12 -04:00