Commit graph

7561 commits

Author SHA1 Message Date
Krzysztof Chruscinski
476033e81f tests: logging: log_api: Minor cleanups in the test
Fixing minor issues in the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-06 10:59:57 +02:00
Marcin Szkudlinski
5a38823179 UnitTest: lib: change unit tests to handle asserts
Change negative tests to handle exceptions
instead of exit codes

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-04-05 14:29:33 -04:00
Marcin Szkudlinski
7147f1a704 UnitTests: lib mem_blocks: block_alloc_free_contiguous/free
Unit tests for mem_blocks library block_alloc_free_contiguous/free

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-04-05 14:29:33 -04:00
Marcin Szkudlinski
ea1a0ff190 UnitTest: lib: test_mem_block_get test added
Unit tests for new memory_block library sys_mem_blocks_get functionality

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-04-05 14:29:33 -04:00
Marcin Szkudlinski
2cdce0ccb2 UnitTest: lib: test_mem_block_get increase num of blocks
As preparation for continous testing there 's a need to increase
number of blocks in tests

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-04-05 14:29:33 -04:00
Marcin Szkudlinski
9756914090 UnitTest: lib: mem_block: bugfix - table size
listener* tables are in fact some kind of log of all alloc/free
operations. Therefore size of the tables == NUM_BLOCKS makes
no sense and leads to table oveflows.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-04-05 14:29:33 -04:00
Jaxson Han
0e1ff84fe7 posix: Fix pthread_once has incorrect behavior
As described in
https://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_once.html.
The behavior of pthread_once() is undefined if once_control has
automatic storage duration or is not initialized by PTHREAD_ONCE_INIT

However, in Zephyr, the implementation is incorrect. If the init value
is PTHREAD_ONCE_INIT, the program will never run the init_func.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2022-04-05 10:38:30 -07:00
Henrik Brix Andersen
5a4a15edcf tests: drivers: can: timing: test min/max timing can be set
Test that the minimum and maximum timing parameter values are accepted
by the driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-05 10:33:08 -07:00
Henrik Brix Andersen
578454b78d tests: drivers: can: timing: test that calculated timings can be set
Test that each calculated set of timing values can be set.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-05 10:33:08 -07:00
Henrik Brix Andersen
35a78fd034 tests: drivers: can: timing: adjust sample point locations
Adjust the sample point locations for the higher bitrates to match those
used in the Linux kernel. These sample points are much more likely to be
met for a wider set of CAN controllers and their timing parameter
boundaries.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-05 10:33:08 -07:00
Gerard Marull-Paretas
c925b5991a include: remove unnecessary autoconf.h includes
The autoconf.h header is not required because the definitions present in
the file are exposed using the compiler `-imacros` flag.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-05 11:18:20 +02:00
Carlo Caione
444d214211 test: mpu: Add arm_mpu_regions test
A a test for the new DT-configured memory regions.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-05 11:16:31 +02:00
Maureen Helm
e7a010de4e tests: drivers: spi: Add test for the SPI_DT_SPEC initializer macro
Adds a new test for the SPI_DT_SPEC initializer macro to reproduce the
XCC build failure reported in #43745 on the intel_adsp_cavs15 board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-04-04 14:40:19 -07:00
Carlo Caione
cd51657ed1 devicetree_regions: Fix fallback on token
Fix the wrong fallback on token and add a new test to catch this kind of
errors early.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-04 14:02:25 -07:00
Yuval Peress
5416abfe5f util: convert wait_for macro to uppercase
This macro conflicts with C++'s std::condition_variable::wait_for
and makes it very difficult to use Zephyr with C++. Replace it with
an all uppercase name which fits the naming standard better.

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-04 09:50:28 -05:00
Henrik Brix Andersen
36ae046443 tests: drivers: can: api: run can_set_mode() in userspace
Run the test case for can_set_mode() in userspace to validate the
syscall handler.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-04 09:41:35 -05:00
Thomas Ebert Hansen
fefa83d5ed Bluetooth: controller: Rework procedure pause logic
llcp_lr_pause()/llcp_rr_pause() only pauses currently pending procedures
in their respective request machines, any future initiations are not
paused, thus they are allowed to run, when the opposite was expected.

Change the procedure pause logic into a global pause on the request
machines them self, this is essence what the per-procedure pause
flag was trying to achieve.

Add new query function llcp_?r_ispaused() to not expose the logic behind
the pause functionality.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-04 15:34:09 +02:00
Thomas Ebert Hansen
79092c3cf4 Bluetooth: controller: Rework TX data pause
Change LLCP TX data pause into using mask to allow for pausing from
multiple different sources - but only once per source
(the underlying TX queue still just has an integer counter).

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-04 15:34:09 +02:00
Andries Kruithof
b909647d0a Bluetooth: controller: llcp: serialize phy update notifications
The PHY update procedure may trigger a DLE update in certain
situations
When a limited number of rx buffers is available there may not be
enough for doing the phy update and dle update notifications
at once.

Fixes #41788

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-04-04 15:33:59 +02:00
Herman Berget
db3a6e17fa Bluetooth: Host: Add test for autoconnection of EATT channels
Checks that CONFIG_BT_EATT_MAX EATT channels are created automatically
after connection.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Herman Berget
bc6501b611 Bluetooth: Host: Move common bsim test code
Much of the test code will be the same for multiple tests, so move it to
a common file.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Herman Berget
e4b6407596 Bluetooth: Host: Update connection test to use bt_eatt_count
The test now uses the public bt_eatt_count function to wait until the
expected number of EATT channels are connected.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Herman Berget
101a9a7525 Bluetooth: Host: Automatically create EATT channels on connection
If the Kconfig BT_EATT_AUTO_CONNECT is enabled (on by default), the
host will try to connect BT_EATT_MAX EATT channels when a connection
to a peer is established.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Henrik Brix Andersen
28d9278358 tests: drivers: can: test can_get_core_clock() and can_get_max_bitrate()
Add tests for can_get_core_clock() and can_get_max_bitrate() API
functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-04 11:15:10 +02:00
Vinayak Kariappa Chettimada
7b9ef30b53 tests: Bluetooth: bsim: Increase to 250 simultaneous connections.
Increase to 250 simultaneous connections in the BabbleSim
test. Update connection interval to accommodate 250
non-overlapping connections and a scan window. And make the
use of is_disconnecting flag consistent between central and
peripheral sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-04 10:24:34 +02:00
Erik Brockhoff
046ef86e7a bluetooth: controller: optimizing random get in encryption procedure
Utilizing packed location of SKDm/s and IVm/s to only call
csrand_get() once

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Erik Brockhoff
e42d453e3e bluetooth: controller: use global ull_conn_event_counter() in procedures
Replace the use of local event_counter() functions with one defined
in ull_conn.c

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Erik Brockhoff
0a9b4a41c7 bluetooth: controller: test: removing TODO and un-skip ctrl-hci unittest
No longer skip this test case
Remove TODO re. chmap test
Def'ing out CENTRAL API tests as ull_central is mocked
Fix rssi test case
Fix feature_exchange_wrong_handle test case

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Erik Brockhoff
045735787d bluetooth: controller: removing 'no-brainer' TODOs from refactored LLCP
Getting rid of TODOs that are fairly straight forward to resolve
* introduce role checks in ENC API
* Remove ASSERT on re-rx of LL_VERSION_IND, ignore instead
* in tests/.../ctrl_chmu: rename variable and initialize initial ch map
* in tests/.../mock_ctrl/util.c: Changing TODO into FYI
* in tests/.../helper_features.h update mask and remove TODO comment
* in ull_llcp_remote.c: re-order cases in proc_with_instant switch
* in ull_conn_upd.c: PARAM REQ only uses REJECT_EXT_IND
* in ull_llcp_common.c: in CENTRAL on rx of LL_MIN_USED_CHANNELS_IND
     chose to do nothing re. channel map. Update unit test accordingly

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Andrzej Głąbek
bc26629ba8 dts: nrf: Rename "nordic,nrf-watchdog" compatible to "nordic,nrf-wdt"
For consistency with the scheme used for other nRF peripherals,
use the peripheral name that nRF Product Specifications use.
In this case, it is WDT, not WATCHDOG.

Also remove the requirement for the label property in the binding.
It is no longer needed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-02 15:14:38 +02:00
Henrik Brix Andersen
af2e765dd2 tests: drivers: can: api: add test for can_get_state() API call
Add test case for the can_get_state() API call.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-01 12:47:04 -05:00
Henrik Brix Andersen
9759431626 tests: drivers: can: api: test send/receive in userspace
Run CAN send/receive API tests without callbacks in userspace.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-01 12:45:39 -05:00
Vinayak Kariappa Chettimada
cf21a0cdb3 tests: Bluetooth: init: Periodic Advertising ADI support
Add build only tests to cover Periodic Advertising ADI
support in advertising state and in Periodic
Synchronization state.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-01 12:39:37 -05:00
Sjors Hettinga
3b03344a8d tests: net: socket: tcp: Add test for big block data transfer
A reproducible case to see what happens when the TCP stack runs out
of buffers. It transfers a block, bigger then the number of buffers
available.
Also test by introducing packet loss in the loopback driver.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-04-01 12:36:14 -05:00
Tom Burdick
602ef3fb0e soc/intel_adsp: Require definitions for cavs_hda.h
Rather than defining them in the header, require a set of defines
be provided to cavs_hda.h as part of the expected input to the API.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Tom Burdick
e018a3dff7 dma/cavs_hda: DMA driver for HDA on cAVS
Adds an initial driver for HDA streams on cAVS. A common code base is
provided for all HDA streams while the drivers are identified
differently as they have small behavior differences.

Uses dma_status to describe the positions for read/write. Uses dma_reload
to inform when to move the read/write positions. This closely follows
how HDA is being used in SoF

Simple test case is provided for both drivers.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Tom Burdick
cc6e9c094a soc/intel_adsp: Low level HDA driver and tests
Adds a header only low level driver for HDA streams along with smoke
tests to ensure basic host in and out stream functionality.

The tests require host side interaction. In cavstool a new HDAStream
class encapsulates somewhat a single stream and its registers. This
is manipulated in the tests using IPC with the Host ensuring that a
specific order of operations is done.

This low level driver allows testing certain hardware configurations
and flows with easy to use register dump debugging. It is not
intended to be the end API an application might use. That would be
a DMA driver using this.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Tom Burdick
345a536794 soc/intel_adsp: common testing code in cavstool.h
The IPC enum definition and WAIT_FOR macro are useful outside of
the board smoke tests for intel_adsp. They can be commonly used
by other board tests for a variety of peripherals that require
DSP and Host interaction (using cavstool).

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Mohan Kumar Kumar
4e7a74c547 tests: net: tcp: Add new tests for get/set SO_RCVBUF
Test SO_RCVBUF option using getsockopt and setsockopt.

Signed-off-by: Mohan Kumar Kumar <mohankm@fb.com>
2022-04-01 13:30:09 +02:00
Erwan Gouriou
ca842acdd7 tests/drivers/clock_control: stm32h7: Change clock_control champion
Change default board to fit board used on ST bench.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
058aa0d669 tests/drivers/clock_control: stm32: Remove prescalers from overlays
Test doesn't do any check on prescalers. Remove references and
existing user: wx_clear_clocks overlay.
Proceed to new factorization when possible.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
aeb4d29777 tests/drivers/clock_control: stm32: G4/G0 grouping
Factorize some G4/G0 cases.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
086fac7134 tests/drivers/clock_control: stm32: Revise TC order
Group TC by series, then clck srce

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
51494fb9bd tests/drivers/clock_control: stm32: Factorize wl/wb clear clocks overlay
Since they don't have impact on sysclock src configuration,
remove LSI/E clocks from clear clocks overlays.
This enables the possibility to factorize wl and wb clear clocks overlays
and brings some use cases factorizations as well.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
f9e0bc642e tests/drivers/clock_control: stm32: Revise TC naming
Revise test cases naming:
- Replace _<series>_ by a .<series>. field in test cases naming
- Rename clear_clocks_msi.overlay to clear_msi.overlay

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
101024e67c tests/drivers/clock_control: stm32: Fix board selection
Fix selection of boards used:
- Remove superfluous/redundant configs
- Adapt to boards available on ST test bench
- fix typos

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
8d6e8b6428 tests/drivers/clock_control: stm32: Fix fixture
To be functional, harness_config require a `harness: ztest` property,
add it.
Additionally, provide a comment to explain motivation behind this fixture.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
c3cffecd22 tests/drivers/clock_control: stm32u5: Rename to _core
Rename stm32u5 test to stm32u5_core before addition
of stm32u5_devices.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
47d553d089 tests/drivers/clock_control: stm32h7: Move tests under stm32h7_core
Before introducing a new test for peripheral clocks,
rename existing stm32h7 test section by stm32h7_core.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Johann Fischer
6be45c2a18 usb: move USB device stack code to own directory
Until now the whole USB device stack code is located
in the top subsys/usb directory. Move it to own directory
in preparation for upcoming extension and rework of USB support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-03-31 18:30:14 +02:00