Commit graph

7830 commits

Author SHA1 Message Date
Erik Brockhoff 9498310c53 Bluetooth: controller: Implement cross connection CPR mutual exclusion
Porting mechanism as used in legacy LLCP to refactored CPR.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Erik Brockhoff 84a8294624 Bluetooth: test: Implementing mechanism to emulate multiple connections
Expanding the test helpers for unit tests to allow for emulation of
multiple connections.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Jordan Yates 782480313e tests: pm: device_runtime: test PM unsupported behaviour
Test the behaviour of the PM device_runtime API on devices that do not
support power management.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-15 21:34:46 +02:00
Anas Nashif a6f924db7f twister: add support for platform_type filter
Instead of relying on runtime filter to limit scope to emulation
platforms, use the type attribute for each platform and do the filtering
very early on. This will speed things up for tests where we only run on
emulation platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00
Anas Nashif 8faca29fea tests/samples: fix usage of integration_platforms
integration platforms can't be filtered out, adapt tests so that those
platforms are always available for testing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00
Emil Gydesen 3f247b212b Bluetooth: ISO: Add Kconfig for ISO central/peripheral
Add two new Kconfigs: BT_ISO_CENTRAL and BT_ISO_PERIPHERAL
that is used to do central or peripheral only builds,
similar to the BT_CENTRAL or BT_PERIPHERAL Kconfigs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-13 12:44:47 -07:00
Rico Ganahl 1cf7361f44 tests/posix/fs: extend readdir test
Test Zephyr POSIX readdir implementation for native POSIX behavior.

Signed-off-by: Rico Ganahl <rico.ganahl@bytesatwork.ch>
2022-05-13 11:10:04 -07:00
Anas Nashif 9276f30bdd tests: smf: use integration_platforms and list tests
list testcase in yaml file to workaround conditional testsuite
definition.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 8235ce6931 tests: newlib: define testcases in yaml
Define all testcases in the yaml for consistency and issue parsing
them during setup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 2a47391b3c tests: sprintf: define testcases in yaml
Define all testcases in the yaml for consistency and issue parsing
them during setup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 84410f57b2 tests: mem_protect: define testcases in yaml
Define all testcases in the yaml for consistency and issue parsing
them during setup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 9c15407ccc tests: c lib: define tests in yaml file
Define all testcases in the yaml for consistency and issue parsing
them during setup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif d61eb2bd47 tests: mutex: define testcases in yaml
Define testcases in yaml to workaround inconsistencies in parsing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 09d565e72c tests: bluetooth: define testcases in yaml file
Define testcases in yaml to workaround inconsistencies in parsing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Anas Nashif 936c88e066 tests: logging: define testcases
Define testcases in yaml to workaround inconsistencies in parsing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Mariusz Skamra b86355b2e6 tests: bsim: Add HAS test for reading of preset list
This adds Read Presets operation bsim test.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-13 08:46:21 -07:00
Mariusz Skamra 305d5bc119 tests: shell: Add shell for HAS client
This adds shell module for HAS client with it's initial functionality.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-13 08:46:21 -07:00
Piotr Pryga e1c441d4c4 tests: Bluetooth: cte_req: Set missing is_enabled flag
CTE request tests were not working because there was missing
a code that sets conn.llcp.cte_req.is_enabled flag.
If the flag is not set, then the CTE request state machine
comletes its execution immediately as if the request was
disabled by Host in the meantime.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-13 10:25:39 -05:00
Piotr Pryga e81414d28f Bluetooth: Controller: Fix CTE_REQ disable lock if there is no CTE_RSP
The periodic CTE_REQ disable command, requested by Host, may be locked
until connection is dropped due to missing CTE_RSP from peer device.
That is caused by implementation of CTE_REQ disable and CTE_REQ
control procedure handling.

The procedure is marked as active when CTE request was send to peer
device. It is marked as inactive after completion of the procedure.
That caused locking of CTE disable on a semaphore.

The BT 5.3 Core Spec, Vol 4, Part E, section 7.8.85 says the HCI_LE_-
Connection_CTE_Request_Enable should be considered active on a conne-
ction from when Host successfully issues the command with Enable=0x1
until a command is issued with Enable=0x0 or single LLCP CTE request
has finished (CTE_Request_Interval=0x0). Also there is a clarification
from BT SIG that the command with Enable=0x0 does not affect any
initiated LLCP CTE request. That means Controller is allowed to finish
already started procedure and it is not allowed to start new LLCP CTE
request procedure after completion of the command with Enable=0x0.

Taking that into account, there is no need to synchronize ULL and LLL
in regard of disable the LLCP CTE request while the procedure is
pending. Controller is free to complete the procedure or terminate it.

The change removes all code related with cte_req.is_active, disable
callback and waiting of ULL for LLL to finish the LLCP CTE request.

The ULL will complete the HCI_LE_Connection_Request_Enable with
Enable=0x0 immediately. In case the procedure is disabled in before
the response arrives, then further processing of the response is
dropped and the procedure context released.

The context is not released by the code responsible for disable
handling, to have single place where it is done.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-13 10:25:39 -05:00
Peter Mitsis e83dde1628 tests: runtime threads stats
Adds tests to verify the gathering of thread runtime stats.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-05-13 10:19:53 -05:00
Robert Lubos d63cb79383 tests: net: socket: Increase ztest stack size for offload_dispatcher
The test suite is failing on qemu_cotext_a9 due to stack overflow.
Apparently this issue can also be observed on main after enabling
STACK_SENTINEL, however the test only started crashing after TCP
changes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-05-13 15:42:01 +02:00
Christoph Coenen b3dfc244ad arch: arm: Add support for multiple zero-latency irq priorities
Add the ability to have multiple irq priority levels which are not
masked by irq_lock() by adding CONFIG_ZERO_LATENCY_LEVELS.

If CONFIG_ZERO_LATENCY_LEVELS is set to a value > 1 then multiple zero
latency irqs are reserved by the kernel (and not only one). The priority
of the zero-latency interrupt can be configured by IRQ_CONNECT.

To be backwards compatible the prio argument in IRQ_CONNECT is still
ignored and the target prio set to zero if CONFIG_ZERO_LATENCY_LEVELS
is 1 (default).

Implements #45276

Signed-off-by: Christoph Coenen <ccoenen@baumer.com>
2022-05-13 08:38:28 -05:00
Jordan Yates 1772dc24a3 tests: devicetree: api: new STRING_TOKEN macros
Add tests for the new `STRING_TOKEN` macros.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-13 14:17:08 +02:00
Andrey Dodonov bc0cf10757 net: tcp: Remove unused config NET_TCP_BACKLOG_SIZE
Remove NET_TCP_BACKLOG_SIZE from KConfig and from test,
because it's not present anymore in current version of TCP stack.

Signed-off-by: Andrey Dodonov <Andrey.Dodonov@endress.com>
2022-05-13 13:04:59 +02:00
Stephanos Ioannidis 84089d30eb tests: sprintf: Fix incorrect message for 1234.56789 test
This commit fixes the test message showing an incorrect input value of
-1 when the actual input value is 1234.56789.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-12 15:26:29 -04:00
Daniel Leung 33e87270e4 tests: logging/log_msg2: add a missing test to suite
The test test_mode_size_str_with_strings() is defined but was not
added to the test suite, so it never ran before. Add this to
the suite so this can be tested.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-05-12 15:25:59 -04:00
Mahesh Mahadevan 95b65a4da5 tests: Add MIPI API tests
Unit tests to test the MIPI API

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-05-12 09:26:50 -05:00
Aastha Grover 3358c6392a tests: logging: syst: Add testcases for mipi syst.
Adding testcases for mipi syst logging format. Excluding
problem architectures from the testcase as SYS-T does not
support 64-bit or big endian architectures. The posix arch
is excluded as it generates numerous anomalous runtime messages
because it does not have the means to determine when data
resides in the rodata section.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-05-12 07:39:06 -04:00
Gerard Marull-Paretas 9678bd6970 pinctrl: nrf: prefix custom drive-mode property
The drive-mode property is nRF specific, so prefix it with `nordic,`,
same as the `nordic,invert` property.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-12 09:22:12 +02:00
Al Semjonovs 47850a301c ztest: Add config to shuffle test order
Enable ZTEST_DO_THE_SHUFFLE to shuffle the order tests are ran.
Additional configs ZTEST_DO_THE_SHUFFLE_SUITE_REPEAT_COUNT
ZTEST_DO_THE_SHUFFLE_TEST_REPEAT_COUNT specify the number of times
the test or suite is executed.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2022-05-11 12:14:31 -04:00
Henrik Brix Andersen 9bd97eb0b8 drivers: can: add CAN_MODE_FD
Add support for enabling/disabling CAN-FD frame transmission/reception at
run-time.

Fixes: #45303

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-11 10:47:54 +02:00
Henrik Brix Andersen 6a0f3fffb5 tests: drivers: can: canfd: verify FD bit in received frames
Verify that the received frames are of the same type (CAN classic
vs. CAN-FD) as the ones sent.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-11 10:47:54 +02:00
Henrik Brix Andersen 3f97d11afd drivers: can: convert enum can_mode to a bit field
Convert the can_mode enum to a bit field to prepare for future extensions
(CAN-FD mode, transmitter delay compensation, one-shot mode, 3-samples
mode, ...).

Rename the existing modes:
- CAN_NORMAL_MODE   -> CAN_MODE_NORMAL
- CAN_SILENT_MODE   -> CAN_MODE_LISTENONLY
- CAN_LOOPBACK_MODE -> CAN_MODE_LOOPBACK

These mode names align with the Linux naming for CAN control modes.

The old CAN_SILENT_LOOPBACK_MODE can be set with the bitmask
(CAN_MODE_LISTENONLY | CAN_MODE_LOOPBACK).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-11 10:47:54 +02:00
Henrik Brix Andersen 2f7c01ba21 drivers: can: rename API functions from timing_*_data to timing_data_*
Rename the CAN data phase API functions to timing_data_* for consistency:
- can_get_timing_min_data() -> can_get_timing_data_min()
- can_get_timing_max_data() -> can_get_timing_data_max()
- .timing_min_data -> timing_data_min
- .timing_max_data -> timing_data_max

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-11 10:47:54 +02:00
Henrik Brix Andersen 18890828b8 drivers: can: split CAN classic and CAN-FD syscalls
Split CAN classic and CAN-FD syscalls into two:
- can_set_timing() -> can_set_timing() + can_set_timing_data()
- can_set_bitrate() -> can_set_bitrate() + can_set_bitrate_data()

Fixes: #45303

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-11 10:47:54 +02:00
Sylvio Alves 54aa7a9a56 samples: tests: exclude esp32 platform
Remove ESP32 and ESP32S2 from not working samples
and tests. Reason for not working is not enough memory
space in RAM to execute it. This can be worked out as next steps.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-05-11 10:47:27 +02:00
Keith Packard 7955624d1f tests/benchmarks/sys_kernel: Use K_THREAD_STACK_EXTERN in header file
K_THREAD_STACK_DEFINE is not correct in a header file as it may conflict
with K_THREAD_STACK_DEFINE usage in the source file.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-05-10 13:55:24 -04:00
Emil Gydesen 83c7baf34a Bluetooth: Audio: Add recv_info to audio recv callback
The audio stream receive callback now contains a
recv_info struct, which contain crucial information
such as timestamps and packet validity.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:28 +02:00
Emil Gydesen 6191a76f55 Bluetooth: Audio: Add _DIR_ infix to BT_AUDIO_SINK/SOURCE
The values represent an enum, and it makes sense for the
enum values to follow the enum type name, so an
_DIR_ infix was added to the values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen 19d7420f07 Bluetooth: Audio: Standadize the use of enum bt_audio_dir
Many functions and struct fields had the directory/type
value, but named in different ways and stored in different ways.

This change updates all uses of it to use the same name
and type.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen 6b41e9991d Bluetooth: Audio: Rename enum bt_audio_pac_type
The enum bt_audio_pac_type does not fully
represent the what the value is used for.

The typical use of it is not for just published
audio capabilities (PAC), but rather describes the
type, or direction, of audio endpoints.

For the unicast client, the type/direction is
relative to the unicast server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Morten Priess ffc07e0293 tests: bluetooth: Added VS RX data path to ISO test
Verifies ISOAL functionality for VS RX data path by implementing weak
function ll_data_path_sink_create, and implementing sink callbacks.

Test verifies construction of sink and checks that SDUs are emitted in
VS sink implementation.

Test relies on the Nordic synchronous receiver implementation, and is
compiled under CONFIG_BT_CTLR_ISO_VENDOR_DATA_PATH, which is enabled in
the project file.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-05-10 18:55:35 +02:00
Erwan Gouriou b52021189b tests/drivers/clock_control: stm32: Migrate includes to <zephyr/...>
Follow up of what was done in main branch during this development.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou d9b9e12cd3 dts/bindings/clocks: stm32: 'clock-names' optional for source clock setting
Since implementation of clock source selection in consumer device drivers
could be achieved without usage of a clock-names property and no
example of usage is provided up to now, remove this property from existing
examples.
Additionally, make it clear in stm32 clock control binding that it is
driver's responsibility to correctly access clock source information
and use it as required.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou ac61ea9e44 tests/drivers/clock_control: stm32: Add stm32_common_devices tests
Add a test section to enable device clock source selection testing.
Test targets I2C1 device which supports clock source selection
on all SOCs using this driver except L1
Initial test done on wb target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 17ace929f9 tests/drivers/clock_control: stm32_common: Move to stm32_common_core
Move stm32_common tests to stm32_common_core before adding new folder
for device source selection tests.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou bc2a0b65a6 tests/drivers/clock_control: stm32u5: Fix pll_msis_80 test config
PLL input should be between 4 and 16MHz, so when MSI is set to 4MHz
fix PLLM can't be higher than 1.
Fix PLL1-NQR in consequence.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou b821599abc tests/drivers/clock_control: stm32u5: Add a _devices test
Add a stm32u5_devices test which aims at testing devices
clock control configuration on stm32u5 targets

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou c0238a7af3 tests/drivers/clock_control: stm32h7_device: Add test for CKPER source
Add 2 scenarios to test CKPER used as a clock source.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 3f503e87cc boards: nucleo_h723zg: Enable SPI
Enable SPI on nucleo_h723zg board

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou f61c4ae838 tests/drivers/clock_control: stm32h7_device: Use STM32_DT_CLOCKS_FOO
Make use of STM32_DT_CLOCKS_ macros to have the test work conditionally
based on alt clock presence.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 78f40773b8 tests/drivers/clock_control: stm32h7: Add test for devices clock cfg
Add 2 clocks tests around device clock configuration on stm32h7.
For now, 'spi1_pllq_2_d1ppre_4' test variant is failed, which
illustrates issue reported in #41650.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Lucas Dietrich 616efeb2f2 tests: workq: Add a regression test for issue #45267
When an object availability event triggers a k_work_poll
item, the object lock should not be held anymore
during the execution of the work callback.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2022-05-10 18:39:51 +02:00
TLIG Dhaou 4de1d01956 boards: stm32: use size helpers to describe size of storage partition
The goal of this commit is to update existing STM32 boards descriptions
to use these size "DT_SIZE" macros to enhance readability. To realize this
i used a python script, which will detect the STM32 Boards
/zephyr/board/arm, and then will update in the dts files the partition
description using "DT_SIZE_K" and "DT_SIZE_M" macros.
Check manually and modify in .overlay files in samples and tests.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-05-10 09:22:43 -05:00
Jordan Yates 523cd60a77 tests: build_all: modem: test esp-at
Add build tests for the `espressif,esp-at` driver, together with both
the interrupt and async variants of modem_ifact_uart.

Only build the async API variant for emulated platforms, as many
platforms do not build cleanly when `UART_ASYNC_API` is enabled without
custom setup of DMA nodes.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 10:44:04 +02:00
Jordan Yates e66864e088 tests: build_all: modem: remove custom serial
Remove a custom Kconfig symbol that was used to indicate serial
interrupt support, as the test serial driver now selects the appropriate
symbols.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 10:44:04 +02:00
Hu Zhenyu 7d20857e4f test: Remove usec test for pwm_api
As the pwm interface only takes nanosecond for parameter,
the original test case for mircosecond is not needed.
Check github issue 44887 for more info.

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-05-09 11:50:40 -05:00
Henrik Brix Andersen eaed9d13b2 tests: canbus: isotp: implementation: allow data to propagate
Allow transmitted data to propagate in test_bind_unbind().

Fixes: #44557

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-09 11:46:25 -05:00
Henrik Brix Andersen cc3b984df8 tests: canbus: isotp: implementation: remove random_data_len variable
Do not rely on hardcoded array size. Use sizeof() instead.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-09 11:46:25 -05:00
Henrik Brix Andersen 79429c448c tests: canbus: isotp: conformance: remove unused random_data_len variable
Remove unused random_data_len variable.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-09 11:46:25 -05:00
Gerard Marull-Paretas 4b91c2d79f asm: update files with <zephyr/...> include prefix
Assembler files were not migrated with the new <zephyr/...> prefix.
Note that the conversion has been scripted, refer to #45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Gerard Marull-Paretas d342e4c4c1 linker: update files with <zephyr/...> include prefix
Linker files were not migrated with the new <zephyr/...> prefix.  Note
that the conversion has been scripted, refer to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Erwan Gouriou eb2e718556 tests: Migrate overlay includes to <zephyr/...>
Leftover of work done on #45420 and #45417.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-09 10:34:42 -04:00
Vinayak Kariappa Chettimada 7fff64f65a tests: Bluetooth: bsim: Assign BT_CTLR_ADV_DATA_LEN_MAX value
Assign BT_CTLR_ADV_DATA_LEN_MAX value to 255 to match the
corresponding BT_CTLR_SCAN_DATA_LEN_MAX value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-09 09:28:34 +02:00
Emil Gydesen 5628b29b01 Bluetooth: Audio: broadcast_source_create array of stream pointers
The bt_audio_broadcast_source_create function will now
take an array of stream pointers, instead of an array
of streams. This is to make the API more flexible as
well as more consistent with the unicast API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-09 09:28:14 +02:00
Emil Gydesen 6e60451e09 Bluetooth: Audio: Change array of unicast streams to array of pointers
In bt_audio_unicast_group_create, bt_audio_unicast_group_add_streams
and bt_audio_unicast_group_remove_streams to use an array
of pointers, instead of an array of streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-09 09:28:14 +02:00
Gerard Marull-Paretas ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Piotr Pryga 41a05e707d tests: Bluetooth: llcp: Add tests to check instant if no PHY change
There were no unit tests that verify if instant value send in
LL_PHY_UPDATE_IND PDU are correct. The commit adds missing tests.

Besides that there is a small update to all ull_cp_phy_update calls,
to improve readability of the code. Magic number was changed to
HOST_INITIATED macro.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-06 11:50:59 +02:00
Jordan Yates 775030e6f1 tests: kernel: validate k_can_yield
Validate the behaviour of `k_can_yield` in pre-kernel, ISR, and idle
thread and standard thread contexts.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-06 11:33:10 +02:00
Morten Priess 112c38e757 tests: bluetooth: Updates for ISOAL unittest
Minor adjustments due to implementation changes.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-05-06 11:32:30 +02:00
Maureen Helm f4a0854481 drivers: dai: Use dt_compat_enabled for Intel SSP driver default
Enables the Intel SSP driver by default when the DAI driver class is
enabled (CONFIG_DAI=y) and a compatible devicetree node
("intel,ssp-dai") is enabled.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-05-06 11:32:04 +02:00
Sjors Hettinga 11288cdbdd tests: net: socket: tcp: Make test_vX_msg_waitall more robust
The close function on a TCP socket can return before the complete
socket has been closed, as there might be packets still in flight.
Add a wait at the end of the test so we are sure all sockets have
been closed before the next test starts.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-05-05 14:45:02 -05:00
Sjors Hettinga cf3466ff74 tests: net: socket: tcp: Make test_open_close_immediately more robust
The close function on a TCP socket can return before the complete
socket has been closed, as there might be packets still in flight.
Modify the test to wait briefly (less then the retransmit time), before
counting the number of still open net_contexts. This makes the test
outcome not dependent on the scheduling order of the different tasks.

Secondly the test actually checks the number of open contexts to be zero
so there is no need to wait for any open contexts to still close.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-05-05 14:45:02 -05:00
Sjors Hettinga 40ee401dd2 tests: net: socket: tcp: Add test to validate connect timeout
When there is no response from the server, a client side connect
should return a ETIMEOUT. This tests breaks the connection and validates
this behavior.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-05-05 14:45:02 -05:00
Piotr Pryga fecc193630 tests: Bluetooth: df: Enable refactored LLCPs for df conn test
There was missing kconfig option that enables refactored LLCPs.
That caused build error in Direction Finding connection_cte_tx_params.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-05 14:41:59 -05:00
Piotr Pryga ccbe5a56e8 tests: Bluetooth: df: Fix ref to renamed ll_scan_set member
The ll_scan_set::per_sync was renamed to ll_scan_set::periodic.
Direction finding connectionless_cte_rx test didn't build.

The commit fixes the issue.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-05 14:41:59 -05:00
Herman Berget 29e3188703 Bluetooth: Tests: Mark test scripts as executable.
The mode change was showing up in the git diff after running all bsim
tests.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-05 14:40:21 -05:00
Herman Berget 51dde9e87a Bluetooth: Tests: Reduce simulation time for L2CAP test
The test was running for unnecessarily long.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-05 14:40:21 -05:00
Bradley Bolen afef64e236 tests: fpu_sharing: Support FPU disable test for Cortex-A/R
For testing, assume that the Cortex-A/R platforms are using a GIC
interrupt controller.  Use the last GIC SGI to trigger an interrupt for
the test.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2022-05-05 12:03:27 +09:00
Bradley Bolen 90b1c6a3e8 tests: fpu_sharing: Enable support for Cortex-R
Reuse the Cortex-M paths for testing the floating point unit.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2022-05-05 12:03:27 +09:00
Stephanos Ioannidis 6a35a793b5 tests: cmsis_dsp: Add mps3_an547 as integration platform for FPU tests
This commit adds the `mps3_an547` board, a Cortex-M55 platform, as an
integration platform for all CMSIS-DSP FPU test cases so that the
M-Profile Vector Extension (MVE) vector function implementations are
tested in the CI.

With this change the FPU-enabled test coverage is as follows:

* mps2_an521_remote (Cortex-M33) tests FPU/DSP-enabled scalar function
  implementations.

* mps3_an547 (Cortex-M55) tests FPU/DSP-enabled MVE vector function
  implementations.

This also has a side effect of comprehensively exercising the M-Profile
Vector Extension support in the ARM architecture port, thereby ensuring
the arch-level FPU/DSP/MVE support is not broken.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Stephanos Ioannidis a38e68b97c tests: lib: cmsis_nn: Enable testing on mps3_an547
Zephyr SDK 0.14.1 now includes QEMU 6.2, which supports the emulation
of the MVE instructions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Stephanos Ioannidis 5790c5923f Revert "tests: lib: cmsis_dsp: Disable testing on mps3_an547"
This reverts commit 96c7f6ab75.

Zephyr SDK 0.14.1 now includes QEMU 6.2, which supports the emulation
of the MVE instructions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Stephanos Ioannidis 8c160e0d5a tests: lib: cmsis_dsp: filtering: Test vector FIR functions
This commit adds support for testing the vector implementation of the
FIR filter functions when the MVE is enabled.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Stephanos Ioannidis 4e379f9215 tests: lib: cmsis_dsp: filtering: Test vector Biquad functions
This commit adds support for testing the vector implementation of the
Biquad filter functions when the MVE is enabled.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Stephanos Ioannidis db56091560 tests: lib: cmsis_dsp: statistics: Adjust error threshold for MVE
The MVE vector version of the statistics functions are slightly less
accurate than the scalar equivalents, so allow a higher relative error
threshold when the MVE is enabled.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Stephanos Ioannidis f560eebd86 tests: lib: cmsis_dsp: fastmath: Adjust error threshold for MVE
The MVE vector version of the `vinverse` function is slightly less
accurate than the scalar version, so allow a higher relative error
threshold when the MVE is enabled.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-05 11:58:11 +09:00
Krzysztof Chruscinski 6f5cf3042d tests: lib: cbprintf_packaged: Add test for cbprintf_package_convert
Add test for the new function in the API.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-04 18:56:55 -04:00
Krzysztof Chruscinski 64ac44ad10 tests: logging: log_stack: Align stack usage
Align stack usage threshold for x86 after changes in cbprintf.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-04 18:56:55 -04:00
Tom Burdick 6913da9ddd logging: cAVS HDA based logger
Adds a log backend that maintains a ringbuffer in coordination
with cAVS HDA.

The DMA channel is expected to be given some time after the logger
starts so a seperate step to initialize the dma channel is required.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-05-04 18:56:13 -04:00
Daniel Leung 5a38451332 tests: x86/info: make it work with CONFIG_COUNTER_CMOS=n
There are boards without CMOS RTC, where blind accesses to
the RTC registers will freeze the system. So make the test
works with these boards if CONFIG_COUNTER_CMOS=n.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-05-04 09:42:26 -05:00
Stephanos Ioannidis 5135b9cd29 tests: lib: cmsis_nn: Fix test filter
This commit corrects the reference to a non-existent Kconfig symbol
`CPU_CORTEX_M` in the filter, which effectively disabled this test for
all platforms, to `CONFIG_CPU_CORTEX_M`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-04 21:07:15 +09:00
Herman Berget e73d530cb4 Bluetooth: Host: Add test for EATT reconfigure callback
Check that the att_mtu_updated callback is called when receiving a
reconfigure request.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-04 10:35:31 +03:00
Jan Peters 88ca4fb533 tests: drivers: counter: add mimxrt QTMR to counter_basic_api test
to test basic functionality of the new mcux_qtmr counter driver.

Signed-off-by: Jan Peters <peters@kt-elektronik.de>
2022-05-03 20:41:23 -05:00
Daniel DeGrasse 409cc23022 drivers: disk: remove legacy nxp USDHC driver
all in tree SOCs with the USDHC peripheral have now been converted to
use the new SD host controller USDHC driver, so remove legacy NXP disk
USDHC driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 14:21:36 -05:00
Daniel DeGrasse aadcc97c68 tests: subsys: sd: Add SDMMC subsystem test
Add SDMMC subsystem test, to verify functionality of SDMMC portion of
subsystem.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 14:21:36 -05:00
Daniel DeGrasse 5b5e01bc69 tests: sdhc: Add SD host controller driver test
SD host controller driver runs basic SD host controller tests, including
checking SD presence, and sending commands to SD card. No data transfer
is performed.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 14:21:36 -05:00
Nicolas Pitre 2fece49a14 riscv: pmp: switch over to the new implementation
Add the appropriate hooks effectively replacing the old implementation
with the new one.

Also the stackguard wasn't properly enforced especially with the
usermode combination. This is now fixed.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Krzysztof Chruscinski a15274839a tests: shell: Add test for section commands
Added test for new macros in the API for adding subcommands:
SHELL_SUBCMD_SET_CREATE, SHELL_SUBCMD_ADD and SHELL_SUBCMD_COND_ADD.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-29 14:54:08 +02:00
Leonard Pollak f7171e20b3 tests: drivers: Add bme680-spi to build_all
Add BME680 (SPI) sensor driver to build_all tests.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2022-04-28 18:11:50 +02:00
Carlo Caione 69b28bfd07 pm: policy: Consider substates for state lock functions
Extend the current pm_policy_state_lock_*() functions to support
substates.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-28 16:32:23 +02:00
Emil Gydesen 0ceb27553f Tests: Bluetooth: Audio: Update unicast bsim tests with release procedure
Add the release procedure for the unicast audio tests.
This also run the existing tests multiple times to ensure
that the states are properly changed across multiple
attempts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-28 14:18:11 +02:00
Emil Gydesen 84e923cea3 Bluetooth: Audio: Group and cleanup test steps in unicast client bsim test
Move the test steps into functions for more reusability and
readability.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-28 14:18:11 +02:00
Derek Snell 6115cf0a4d tests: drivers: i2s_speed: enable testing on mimxrt1170_evk board
Readme instructions for connecting SAI4 as TX to SAI1 as RX on this
board.  Also includes overlay and Kconfig settings to run this test
on the board.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2022-04-28 14:18:00 +02:00
Derek Snell 0356a70397 tests: drivers: i2s_speed: place mem_slab's in non-cacheable region
If platform supports non-cacheable region, place mem_slab's for I2S
driver buffers there.  This enables drivers using DMA without cache
coherency issues.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2022-04-28 14:18:00 +02:00
Thomas Ebert Hansen 20cb60ecd2 Bluetooth: controller: Fix central enc termination
Terminate connection with a MIC failure if an unexpected control PDU
is received during the Encryption Start procedure.

Add a greedy option to pdu_is_expected() to make sure the procedure
processes all unexpected control PDU in all cases.

Add unit test inspired by Bluetooth Qualification test
LL/SEC/CEN/BV-14-C,
Central Receiving unexpected PDU during encryption start

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Thomas Ebert Hansen 70e38b1cbb Bluetooth: controller: Fix central enc reject
Add support for both LL_REJECT_IND and LL_REJECT_EXT_IND when waiting
for the the response to the LL_ENC_REQ and LL_START_ENC_REQ.

Add unit test to test both LL_REJECT_IND and LL_REJECT_EXT_IND as
responses to LL_ENC_REQ.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Thomas Ebert Hansen 268d00623b Bluetooth: controller: Fix periph enc reject
Chose correct rejection PDU based on features supported on remote peer
when rejecting due to missing LTK.

Update unit test setup with faking that a feature exchange procedure
has run.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Thomas Ebert Hansen 06feb0202c Bluetooth: controller: Fix periph enc termination
Terminate connection with a MIC failure if an unexpected control PDU
is received during the Encryption Start procedure.

Add unit test inspired by Bluetooth Qualification test
LL/SEC/PER/BI-05-C,
Peripheral Receiving unexpected PDU during encryption start

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Szymon Janc 6ac7bda97d tests: Bluetooth: Add test for invalid LLCP PDU sized
This verifies that invalid size PDUs are detected.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-04-28 12:52:57 +02:00
Gerard Marull-Paretas ae91933c4a drivers: pwm: always use nanoseconds for set
In order to be consistent with what is possible in Devicetree, always
take a period in nanoseconds. Other scales or units may be specified by
using, e.g., the PWM_MSEC() macros (all of them converting down to
nanoseconds). This change then deletes the "_nsec" and "_usec" versions
of the pwm_set call.

Note that this change limits the period to UINT32_MAX nanoseconds,
~4.3s. PWM is, in generali, used with periods below the second so it
should not be a problem.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Gerard Marull-Paretas 10ee44c94b drivers/samples/tests: remove usage of deprecated PWM APIs
Use the new API calls that remove pin naming.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Mahesh Mahadevan 6a66493703 tests: counter: Update test_multiple_alarms test
Set the top value relative to the current time. This is
so that we avoid the case of setting the top value that
is prior to the current value.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-04-28 10:26:54 +02:00
Henrik Brix Andersen dcf833d971 tests: drivers: spi: loopback: add olimex_esp32_evb configuration
Add configuration for testing SPI loopback on the Olimex ESP32-EVB
board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-04-28 10:26:40 +02:00
Keith Packard 6f9f8c1e32 samples, tests: Add z_libc_partition to all test domains
When a memory domain is initialized, the z_libc_partition must be
included so that critical libc-related data can be accessed.

On ARM processors without TPIDRURO when THREAD_LOCAL_STORAGE is enabled,
this includes the TLS base pointer, which is used for several
thread-local variables in the kernel.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-28 11:09:01 +09:00
Keith Packard 19c8956946 tests: Disable HW stack protection for some mpu tests
When active, z_libc_partition consumes an MPU region which leaves too
few for some MPU tests. Free up one by disabling HW stack protection.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-28 11:09:01 +09:00
Keith Packard b03b2e0403 tests/kernel/mem_protect: Check for thread_userspace_local_data
When using THREAD_LOCAL_STORAGE the thread_userspace_local_data stuff
isn't used, so these tests wouldn't build.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-28 11:09:01 +09:00
Flavio Ceolin d490358e28 tests: ipv6: Fix DAD timeout test
DAD timeout was wrongly checking the reply order. The code will always
assign sequentially the reply to 0-2 with the current uptime. This means
that we will always have dad[0] < dad[1] < dad[2]. Check it is useless.
Instead, let just check if we got all replies.

The test checking the time between the first and last request is to
fragile. It is testing a constant independently of the tested platform
failing in several of them. Just remove it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-04-27 12:35:34 -04:00
Anas Nashif 97a55d6a25 tests: uart: fix integration platforms
Fix usage of integration_platforms and apply it individually instead of
the common section.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-27 12:26:22 -04:00
Hake Huang 07d6adde51 driver: adc: fix build error for adc_dma
fsl_sim.h is not required as SDK upgrade

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-04-27 11:15:43 -05:00
Erik Brockhoff 26f6941048 Bluetooth: controller: using REJECT_IND when EXT_IND was not negotiated
Unless a feature exchange determines support for REJECT_EXT_IND use
REJECT_IND for collision rejection

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-27 10:09:03 +02:00
Erik Brockhoff 06078ee54e Bluetooth: controller: DO TODO, compile out members of struct re. CPR
Compile out misc. members not used when Connection Parameter Request
is not supported.
Implement missing tests re. unsupported features in CU/CPR procedure

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-27 10:09:03 +02:00
Erik Brockhoff 0d015fd212 Bluetooth: test: adding helper to verify CTE_RSP notification
This to remove TODO and improve the CTE unit test

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-27 10:09:03 +02:00
Mariusz Skamra 5bd1c68dee Bluetooth: tests: Add shell build tests for hearing access service
Add entries for HAS builds to testcase list.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-04-27 10:08:56 +02:00
Alexandru Carbuneanu 59dd898c2b test: bsim: Notification EATT test
Increasing the test coverage of notification on EATT bearers.
- test implementation

Signed-off-by: Alexandru Carbuneanu <alexandru.carbuneanu@nordicsemi.no>
2022-04-27 10:08:42 +02:00
Anas Nashif c882843af2 Revert "ztest: add userspace tests to base tests"
This reverts commit 395bbb5122.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-26 18:55:32 -04:00
Anas Nashif 85cc902a0d Revert "ztest: migrate error_hook tests to new API"
This reverts commit fa13d57f01.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-26 18:55:32 -04:00
Yuval Peress fa13d57f01 ztest: migrate error_hook tests to new API
Update the tests to use the new ztest API.

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-26 14:29:18 -04:00
Yuval Peress 395bbb5122 ztest: add userspace tests to base tests
Add a test that verifies that ZTEST_USER is actually being run in
user context.

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-26 14:29:18 -04:00
Guo Lixin 8b2f5f0965 tests: Increase timeout for some tests
There are tests failing due to timeout for a few seconds in simulators,
slightly increase the timeout for these cases.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-04-26 13:57:43 -04:00
Michał Narajowski 54cd46ac68 tests/bluetooth/tester: Refactor Read UUID callback
ATT_READ_BY_TYPE_RSP returns Attribute Data List so handle it in the
application.

This affects GATT/CL/GAR/BV-03-C.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2022-04-26 17:38:53 +02:00
Tristan Honscheid 2abb2389a1 ztest API Migration: lib/cmsis_dsp
Migrate some of the unit tests at `lib/cmsis_dsp`
to the new ztest API:

  * lib/cmsis_dsp/basicmath
  * lib/cmsis_dsp/bayes
  * lib/cmsis_dsp/complexmath
  * lib/cmsis_dsp/distance
  * lib/cmsis_dsp/fastmath

`lib/cmsis_dsp/common/test_common.h` has been adapted to use the new
ztest API for the test variant macros, when enabled.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-04-26 08:41:11 -04:00
Tristan Honscheid 8283eb3b54 ztest API Migration: lib/c_lib
Migrate the unit tests at `lib/c_lib` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-04-26 08:38:44 -04:00
Erik Brockhoff d8f0c1adf6 Bluetooth: controller: implement connection termination on invalid pdus
When a running procedure receives a REJECT or UNKNOWN_RSP PDU that is
not an expected part of the procedure flow this leads to termination
of the connection

This affects procedures:
CU/CPR, CTE, PHY, PING, DLE, FEX, VEX, CHMU

Unit tests are updated to cover the updated behaviour.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-26 14:06:16 +02:00
Emil Gydesen a796927961 Bluetooth: Audio: Make PACS location optional
Make the PACS location characteristic optional, and
also optionally writable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-26 09:00:48 +02:00
Carlo Caione 82451951cf tests: Misc test fixes for fvp_base_revc_2xaemv8a
Fix several tests for the fvp_base_revc_2xaemv8a board.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-26 09:00:18 +02:00
Krzysztof Chruscinski acbdbb15dd logging: Fix cbprintf package alignement
Fix alignment fo the cbprintf package withing the log message.
Aligning tests to pass.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-25 11:45:39 -07:00
Vinayak Kariappa Chettimada b035a0a2f5 tests: Bluetooth: init: Cover ext. adv without ext. scan filter policy
Update debug project configuration file to cover building of
Bluetooth with Extended Advertising support without Extended
Scan Filter Policy.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-25 11:44:22 -07:00
Maureen Helm 5769dffc01 drivers: mm: Use dt_compat_enabled for Intel ADSP TLB driver default
Enables the Intel TLB driver by default when the MM driver class is
enabled (CONFIG_MM_DRV=y) and a compatible devicetree node
("intel,adsp-tlb") is enabled.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-04-25 11:41:31 -07:00
Tristan Honscheid e4d24fcf3a ztest API Migration: lib/cbprintf_package
Migrate the unit tests at `lib/cbprintf_package` to use the new ztest
API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-04-24 19:47:18 +02:00
Herman Berget 3aef3dae02 Bluetooth: Host: Add test for GATT tx complete callback
Checks that the callback given to bt_gatt_notify_cb is called.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-24 19:46:41 +02:00
Jordan Yates 1d189487b4 tests: spi: spi_loopback: use gpio_dt_spec fields
Use the gpio_dt_spec fields of `struct spi_cs_control`, instead of the
deprecated individual fields.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-04-23 21:11:29 +02:00
Jordan Yates d6c3b0a40a tests: spi: spi_loopback: cleanup code formatting
Cleanup split lines and invalid whitespace.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-04-23 21:11:29 +02:00
Daniel DeGrasse a59b308e73 tests: uart_async_api: skip test cases if LPUART is present without DMA
if DMA support is not present, LPUART driver will not compile when async
API support is required. Skip test cases when dma support is not present
and LPUART driver is enabled.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-22 09:44:19 +02:00
Daniel DeGrasse fee7de48d3 tests: uart_async_api: add nxp,loopback mode to boards with LPUART
add nxp,loopback mode to boards with LPUART. This will enable testing
the UART async api without a physical loopback connection.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-22 09:44:19 +02:00
Erwan Gouriou 531c484958 tests/drivers/clock_control: stm32_common: Test HCLCK instead of SYSCLK
Rework test_*_freq to test HCLK freq instead of SYSCLK one, as it is not
correct to compare CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC with SYSCLK.

Additionally, add a test to verify use of AHB prescaler.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Erwan Gouriou d8f5ef725f tests/drivers/clock_control: stm32u5: Rework to explicitly test HCLK
Instead of testing SysClockFreq setting, we should instead check HCLK
setting which is the real zephyr CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
counterpart (core clock freq) and takes AHB prescaler setting into
account.

Additionally, update one test configuration to explicitly verify AHB
prescaler is correctly taken into account by clock driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Erwan Gouriou da370ea720 tests/drivers/clock_control: stm32l0/l1: MSI range 11 is not allowed
Remove L0 and L1 targets from "sysclksrc_msi_48" test case as this
MSI range 11 is not an allowed value on these series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Erwan Gouriou fa85670f1b tests/drivers/clock_control: stm32f1: HSI clock is 8MHz
On STM32F series, HSI clock is 8MHz, fix test using 16MHz
and a test name.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Carlo Caione 1dcea253d2 shared_multi_heap: Rework framework
Entirely rework the shared_multi_heap framework. Refer to the
documentation for more information.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-21 13:15:26 +02:00
Jordan Yates 37aa5fa90a tests: console: extend semihost_console testing
With SEMIHOST_CONSOLE now being supported on all ARM, ARM64 and RISC-V
architectures, extend the testing to cover these cases.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-04-21 13:04:52 +02:00
Jordan Yates 685e53231f tests: lib: semihost: test file operations
Add tests for basic file operations under semihosting.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-04-21 13:04:52 +02:00
Jordan Yates 070422db46 arch: common: dedicated SEMIHOST symbol
Control the usage of semihosting with a dedicated symbol, instead of
implying semihosting from the usage of `SEMIHOST_CONSOLE`. This allows
semihosting to be used without the semihost console.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-04-21 13:04:52 +02:00
Henrik Brix Andersen e777aa823b tests: drivers: can: api: verify filters persist through bitrate changes
Verify that added rx filters are preserved through bitrate changes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-21 13:00:46 +02:00
Bartosz Bilas 2d3011c9b4 tests: drivers: spi: don't use deprecated spi_cs_control struct members
gpio_dev is being deprecated in favor of gpio_dt_spec gpio member
so let's use it instead of that one.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-04-21 13:00:35 +02:00
Henrik Brix Andersen 7a5116acb2 tests: drivers: can: timing: print core clock to aid in debugging
Print the CAN core clock frequency along with the device name to aid in
debugging CAN timing test case errors.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-21 13:00:20 +02:00
Peter Mitsis a30cf39975 kernel: update k_thread_state_str() API
When threads are in more than one state at a time, k_thread_state_str()
returns a string that lists each of its states delimited by a '+'.
This in turn necessitates a change to the API that includes both a
pointer to the buffer to use for the string and the size of the buffer.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-04-20 20:20:13 -04:00
Al Semjonovs fef6e46f01 ztest: Add Z_TEST_SKIP_IFDEF macro
Defined Z_TEST_SKIP_IFDEF macro to skip tests when specified
config is enabled.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2022-04-20 15:28:14 -04:00
Herman Berget 23d4788afa Bluetooth: Host: Add more tests for GATT client becoming change-aware
For clients with both a single and multiple ATT channels:
 - Read a characteristic before reading the DB hash and then retrying
 - Read the DB hash and then do the reads
 - Retry the reads without reading the DB hash

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-20 16:10:46 +02:00
Herman Berget 2a5d9d10d1 Bluetooth: Host: Update GATT caching test to encrypt the link
EATT channels shall be encrypted. Without encrypting the link, all
requests will be sent on the fixed ATT channel.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-20 16:10:46 +02:00
Herman Berget e5004d9261 Bluetooth: Tests: Wait for sync from other devices only
The sync mechanism using Babblesim backchannels picked up self-sent
messages. Use the device number as data to disambiguate messages from
other devices.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-20 16:10:46 +02:00
Asbjørn Sæbø b0d5db147b Bluetooth: Audio: Media control - pass structs by reference
Changes the media_proxy API to pass structs by reference instead of by
value.

Also pass structs by reference in internal functions in media player
and in media controller test.

Add pointer checks to the public API implementation where
user/application code provides structs by reference.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-04-20 15:51:01 +02:00
Asbjørn Sæbø fa5b8a1e38 Bluetooth: Audio: MCC - pass structs by reference
Changes the media control client API to pass structs by reference
instead of by value.

Also change internals of test to pass struct by reference.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-04-20 15:51:01 +02:00
Robert Lubos 6da10468ad tests: net: Add socket dispatcher unit tests
Add unit tests for socket dispatcher module. The tests verify that:
* a socket is automatically dispatched to a regular socket on any
  first socket call, if the socket was not bound already before
  (according to the default priority rules)
* a socket is correctly dispatched to an offloaded/native socket
  implementation after a SO_BINDTODEVICE call
* a socket is correctly dispatched to a native TLS socket, with an
  underlying native/offloaded socket, if TLS_NATIVE and SO_BINDOTODEVICE
  socket options are used

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-04-20 11:27:05 +02:00
Anas Nashif 26b28b9527 tests: thread_api: test k_thread_cpu_pin
add a few asserts to test the new API.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-19 13:05:09 -04:00
Francois Ramu 28fa1761c2 tests: drivers: watchdog on stm32 nucleo board
Configure nucleo_f429 boards with overlay
to execute the tests/drivers/watchdog/wdt_basic_api

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-04-19 09:47:03 -05:00
Anas Nashif 2d97bdd85d samples: add module requirement into samples
Do not build those samples if the needed modules are not available in
the workspace.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-19 09:38:55 -04:00
Stephanos Ioannidis b48fc1d0f2 tests: kernel: timer_monotonic: Exclude for qemu_arc_hs
This commit excludes the kernel monotonic timer test for the
`qemu_arc_hs` platform because this test may fail with the ARC QEMU
6.2 on certain host systems.

Refer to the following issues for more details:

* foss-for-synopsys-dwc-arc-processors/qemu#67
* zephyrproject-rtos/zephyr#44862

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-19 09:15:06 -04:00
Stephanos Ioannidis 97064045d2 tests: kernel: syscall: Exclude for qemu_arc_em
This commit excludes the kernel syscall test for the `qemu_arc_em`
platform because this test may fail with the ARC QEMU 6.2 on certain
host systems.

Refer to the following issues for more details:

* foss-for-synopsys-dwc-arc-processors/qemu#66
* zephyrproject-rtos/zephyr#44862

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-19 09:15:06 -04:00
Aleksandr Khromykh 83169f51af tests: Bluetooth: Mesh: test of IV index behavior
Testing of IV update, IV recovery and deferring of
the IV update procedure in case of ongoing segmented
transaction.

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2022-04-19 11:47:57 +02:00
Henrik Brix Andersen 423ae67d5c tests: drivers: can: api: test can_get_max_filters()
Add test for can_get_max_filters() optional API function.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-19 11:47:40 +02:00
Emil Obalski c5dc184b74 tests: ipc: Update exclude platforms
remove qemu_xtensa from exclude platforms as fix for this platform
is provided.

add ast1030_evb to exclude platforms as this soc does not yet have
in tree driver for external cache controller.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-04-18 23:19:32 -04:00
Emil Obalski 3a9b082fef tests: Move icmsg_buf tests to subsys/ipc
Move ipc service backend unit test from tests/lib to
tests/subsys directory.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-04-18 23:19:32 -04:00
Emil Obalski cc57f0acb9 tests: Align buffer in icmsg_buf tests.
This change adds alignment to buffer on which icmsg_buf
is created. Some platforms run into fatal exception
when accessing unaligned addresses. Fix that by ensure
4 byte alignment.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-04-18 23:19:32 -04:00
Flavio Ceolin 8ddb21e230 tests: pm: Add a power domain test
Add simple test to exercise power domain behavior
with device runtime.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-04-18 17:25:01 -07:00
Henrik Brix Andersen 77fa7709e4 tests: drivers: can: api: add test for can_set_bitrate()
Add test for the can_set_bitrate() syscall.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-18 17:23:28 -07:00
Tom Burdick 2f320730a1 dma/cavs_hda: Adds link in/link out compatibles
Adds hda link in and out drivers. The link in and link
out channels of HDA have small differences
with the host channels. Updates the existing
cavs_hda drivers and code to account for these
differences.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-18 19:19:40 -04:00
Benjamin Björnsson e9ab9990d4 boards: arm: arduino_nano_33_ble: Add support for sense version of board
This commit adds support for the Arduino Nano 33 BLE Sense board.

The DTS is separated into a common dtsi and one DTS for each version
of the board. The sensors with existing drivers: hts221, lps22hb and
apds9960 are added to the DTS of the Sense version.

A startup delay is added to the vdd_env node. This is done to give some
time for the sensors VDD/VCC to go high before the sensor drivers are
initialized.

The functionality was verified using the driver sample of each sensor.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-04-18 12:20:32 -05:00
Piotr Pryga 4a18d615a4 slist: Fix sys_slist_append_list with head and tail NULL break a list
If the sys_slist_t instance is not empty, its head and tail points to
some sys_snode_t instances. If sys_slist_append_list is executed with
tail being NULL the list object is corrupted. Tail of the sys_slist_t
instance is set to NULL. If one executes sys_slist_append on that node,
then nodes pointed by head are lost.

The commit fixes the issue and adds unit tests to verify correct
behavior.

Added change verifies if head and tail of appended list are not NULL.
In other case the list object is invalid and should not be appended
to a valid list instance.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-04-15 11:50:29 -07:00
Ryan McClelland f7ddcd2713 arch: arm: aarch32: initialize FPSCR to reset value for ARMv8.1
With GCC 11 now supporting low overhead branching in ARMv8.1, ASM "LE"
(loop-end) instructions would trigger an INVSTATE hard-fault after
FPSCR was set to 0. This was due to the FPSCR getting a new field in
ARMv8.1. LTPSIZE is now set to it's reset value of Tail predication not
applied.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-04-15 10:33:48 -07:00
Szymon Czapracki 827890c075 Bluetooth: audio: Add initial Hearing Access Service shell
This adds initial shell support for HAS.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2022-04-15 10:32:54 -07:00
Jaska Uimonen 03e335ca6a tests: drivers: ssp: add ssp dai tests
Add tests for Intel dai ssp driver. These tests configure
the ssp driver and transfer data over loopback with dma.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-04-14 11:42:08 -04:00
Jaska Uimonen 8d38b64fdc drivers: dai: add dai driver subdir and ssp driver
Add Intel ssp driver using dai interface.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-04-14 11:42:08 -04:00
Krzysztof Chruscinski f538136941 tests: logging: log_stack: Align stack usage limits
Align stack usage limits for riscv platforms.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-14 08:32:31 -04:00
Tristan Honscheid aa8f740abf ztest API Migration: bluetooth/l2cap
Migrate the unit tests at `bluetooth/l2cap` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-04-14 09:07:23 +02:00
Tristan Honscheid 7e7855d669 ztest API Migration: bluetooth/at
Migrate the unit tests at `bluetooth/at` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-04-14 09:06:57 +02:00
Henrik Brix Andersen d39063a20d tests: drivers: can: api: verify filters persist through mode change
Verify that added rx filters are preserved through mode changes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-14 09:06:11 +02:00
Henrik Brix Andersen 3b1527a8f9 tests: drivers: can: timing: tighten the sample point test criteria
Tighten the sample point test acceptance criteria from +/- 10.0% to +/-
5.0%. This is in line with the CAN sample point criteria used by the
Linux kernel.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-13 13:28:06 -07:00
Henrik Brix Andersen 5961ad2af8 tests: drivers: can: timing: test more bitrates
Extend the test with more CAN in Automation (CiA) 301 standard bitrates.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-13 13:28:06 -07:00
Henrik Brix Andersen ee63bc4a09 tests: drivers: can: timing: do not overwrite sample point error value
Do not overwrite the sample point error value as it is printed at the
very end of the test.

Fixes: 578454b78d

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-13 13:28:06 -07:00
Hu Zhenyu cdcfc2926f tests: drivers: adc_api: Add configuration for mec172xevb_assy6906
Enable the tests/drivers/adc/adc_api/ test for mec172xevb_assy6906
on both west and twister

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-04-12 08:55:59 -07:00
Christopher Friedt ddf3c57a39 tests: posix: test support for pthread_attr_setstacksize
Tests for `pthread_attr_setstacksize(3)` and
`pthread_attr_getstacksize(3)`.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-04-12 22:02:04 +09:00
Erik Brockhoff f056eb516d Bluetooth: controller: Implementing LL param checks for refactored CPR
Now refactored Connection Parameter Request procedure supports
parameter checking, and implements reject_ext_ind on invalid parameters

Updates to TODO description for remaining work

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-12 09:57:43 +02:00
Henrik Brix Andersen 4fada77953 tests: cpp: cxx: include top-level driver headers
Include (almost) all top-level driver header files to ensure error-free
C++ compilation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-12 09:55:27 +02:00
Dominik Ermel da6a5590e8 tests/mgmt/mcumgr/smp_reassembly: Remove dependency on TINYCBOR
Removed dependency from prj.conf.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-04-11 12:09:28 +02:00
Lingao Meng 37e561f42e Bluetooth: Host: Add choice select whether BT RX
Change CONFIG_BT_RECV_IS_RX_THREAD into a
choice:CONFIG_BT_RECV_CONTEXT with the following options
(names can be discussed further of course):

    CONFIG_BT_RECV_BLOCKING
    CONFIG_BT_RECV_WORKQ_BT
    CONFIG_BT_RECV_WORKQ_SYS

This way users would be able to choose what to run most of
the BLE stack on, they wouldn't be forced to a single model.

We would default to CONFIG_BT_RECV_BLOCKING so that we wouldn't
need to change the system workqueue stack size by default, instead
asking users to do so if they select the CONFIG_BT_RECV_WORKQ_SYS option

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-04-11 10:58:09 +02:00
Mohan Kumar Kumar 2558d277e2 tests: net: tcp: Add new tests for get/set SO_SNDBUF
Test SO_SNDBUF option using getsockopt and setsockopt.

Signed-off-by: Mohan Kumar Kumar <mohankm@fb.com>
2022-04-11 10:23:31 +02:00
Mariusz Skamra e9b40ebc69 Bluetooth: has: Satisfy profile security requirement
This enables Secure Connections pairing (actually disables legacy)
to satisfy security requirements of the Hearing Access Profile.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-04-11 10:23:13 +02:00
Henrik Brix Andersen 3e290c636e tests: drivers: can: api: check frames in test_send_receive_msgq()
Test that the received frames in test_send_receive_msgq() matches the
frames sent.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-11 10:16:49 +02:00
Mikkel Jakobsen 58c07a53cc tests: drivers: build_all: sensor: add icm42670
to ensure driver is built both with and without trigger enabled during
CI

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2022-04-08 15:49:08 -07:00