Commit graph

7561 commits

Author SHA1 Message Date
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