Commit Graph

6830 Commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada 2af787f28e tests: Bluetooth: Update to use Periodic Advertising enable ADI flags
Update Babblesim test to use Periodic Advertising enable and
ADI flags.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-26 10:26:17 -05:00
Gerard Marull-Paretas 51751909f5 tests: drivers: pinctrl: add test for checking nRF DT parsing
Add a unit test that allows to validate if pin control configuration
stored in Devicetree is parsed correctly.

nRF boards used to run this test should add the pinctrl:nrf tag.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 14:20:51 +01:00
Erwan Gouriou 1d14517ede boards: arm: stm32: add pinctrl state name for PWM peripheral
Add the pinctrl state name (default) for the PWM peripherals.
Changes performed based on the script proposed in
"boards: arm: stm32: add pinctrl state name for UART peripheral"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Gerard Marull-Paretas 4b9c3d7134 boards: arm: stm32: add pinctrl state name for UART peripheral
Add the pinctrl state name (default) for the UART/USART/LPUART
peripherals. Changes performed using the following Python script run
from the repository root:

```
from pathlib import Path
import re

for fpath in Path(".").glob("boards/arm/**/*.dts"):
    lines = open(fpath).readlines()

    is_stm32 = False
    for line in lines:
        if "stm32" in line:
            is_stm32 = True
            break

    if not is_stm32:
        continue

    with open(fpath, "w") as f:
        for line in lines:
            f.write(line)

            m = re.match(r"(\s+)pinctrl-0.*us?art.*", line)
            if m:
                f.write(m.group(1) + "pinctrl-names = \"default\";\n")
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 11:36:42 +01:00
Neil Armstrong e636f149aa dts: arm64: qemu-virt: switch to 64bit addressing in DT
The qemu arm64 virt machine PCIe controller config space needs a
64bit adressing, so switch the entire qemu-virt-a53 and
qemu_cortex_a53 board dts to address-cells & size-cells to 2
to accommodate for 64bit addresses.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-11-25 18:37:15 +01:00
Robert Lubos 6dbd5c7876 net: icmpv6: Remove in6_addr from packed structs
Replace unpacked in6_addr structures with raw buffers in packed icmpv6
structs, to prevent compiler warnings about unaligned access.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Robert Lubos 666e9f80d6 net: ipv6: Remove in6_addr from packed net_ipv6_hdr struct
Replace unpacked in6_addr structures with raw buffers in net_ipv6_hdr
struct, to prevent compiler warnings about unaligned access.

Remove __packed parameter from `struct net_6lo_context` since the
structure isn't really serialized.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Robert Lubos 064200b420 net: ipv4: Remove in_addr from packed net_ipv4_hdr struct
Replace unpacked in_addr structures with raw buffers in net_ipv4_hdr
struct, to prevent compiler warnings about unaligned access.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Robert Lubos bbdeef4ac4 net: arp: Remove in_addr/in6_addr from packed net_arp_hdr struct
Replace unpacked in_addr/in6_addr structures with raw buffers in
net_arp_hdr struct, to prevent compiler warnings about unaligned
access.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Andries Kruithof 984ebd519a Bluetooth: controller: remove obsolete defines
The define for PDU_AC_LL_SIZE_EXTRA was removed in main, but not in
the topic-branch. The merge of topic/branch erroneously reintroduced
this define, so it needs to be removed

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-25 10:46:08 -05:00
Andries Kruithof a60f0ac7a4 tests: edtt: re-enable HCI tests
HCI tests HCI/DSU/BV-05-C and HCI/GEV/BV-01-C fail when
compiling with debug optimisations turned on.
Therefor revert to not compiling with debug optimisations.

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-25 10:44:34 -05:00
Vinayak Kariappa Chettimada 2fe6127425 tests: Bluetooth: bsim: Add missing BT_ISO_RX_MTU value
Add missing BT_ISO_RX_MTU config as needed by the test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-25 10:43:51 -05:00
Vinayak Kariappa Chettimada 9b90b3d6be tests: Bluetooth: bsim: Improve incoming data information message
Add flags, sequence number and timestamp to incoming data
message print in the test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-25 10:43:51 -05:00
Yong Cong Sin 113c6f249e storage/flash_map: Add option to use MBEDTLS for img integrity check.
Add option to use MBEDTLS library to perform the flash area
integrity check.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-11-24 21:52:08 -05:00
Ryan McClelland a000acca5f tests: fix double promotion warning
With -Wdouble-promotion added to the warning base, fix warnings given
by the compiler.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2021-11-24 17:14:25 -05:00
Flavio Ceolin 6451626ce7 pm: Use pm_device_action_run instead of state_set
Since drivers implement a callback based on action and not the state,
we should be using the API based on the action instead of the one based
on the state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-24 14:21:50 -05:00
Daniel Leung 81882fe7b8 tests: latency_measure: remove qemu_x86_64 exclusion
The latency measure test can run on qemu_x86_64 so remove it
from the platform_exclude list.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-24 14:16:13 -05:00
Jordan Yates 8e99db5801 Kconfig: net: deprecate `NET_BUF_USER_DATA_LEN`
As user data sizes are now set on a per pool basis, this Kconfig option
has no purpose.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates 70649077a0 tests: net: buf: test per-pool data lengths
Validate that per-pool user data lengths are being set correctly.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates df327eeb58 net: buf: `POOL_FIXED_DEFINE` explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates d17e0439c2 net: buf: `POOL_HEAP_DEFINE` explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates 8236b600f7 net: buf: `POOL_VAR_DEFINE` explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates 0b5e6f1f8f tests: net: buf: validate user_data_size fields
Validate the `user_data_size` field is populated correctly.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Johann Fischer cf8d7764da usb: fix bulk endpoint configuration for high-speed capable device
In the current USB device support, the sizes of bulk endpoint
are mostly configure through Kconfig and do not care if a device
is high-speed capable. The information if a USB device controller
supports high-speed comes from devicetree. Add a Kconfig option to
map this information and configure bulk endpoint sizes
accordingly.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-24 12:28:02 +01:00
Andy Ross 201c3ce47c tests/kernel: Add test for CONFIG_SMP_BOOT_DELAY
This feature is in tree and used by the SOF app, but we don't have a
local test for it.  Add one, including a case to track regressions in
a known failure mode (where the second CPU wouldn't get its IDC
interrupts set up correctly if spawned at runtime).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-11-23 13:23:54 -05:00
Jordan Yates eec7c5389b tests: devicetree: test supported devices API
Add tests for the supported devices API.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-23 12:17:14 +01:00
Johan Lundin 403fbfcc12 Bluetooth: Adds preprocessor to L2CAP tester app
Adds preprocessor ifdefs to reconfigure() in L2CAP tester application
depending on the KConfig option CONFIG_BT_L2CAP_ECRED
Fixes issue #40456

Signed-off-by: Johan Lundin <johan.lundin@nordicsemi.no>
2021-11-22 23:10:47 -05:00
Tilmann Unte a9ba637ac9 tests: drivers: pwm: stm32 board for loopback test
Add overlay file for disco_l475_iot1 board to pwm_loopback test.

The file is based on the existing overlays for twr_ke18f and frdm_k64f.

The new configuration uses both a 16-Bit timer with active prescaler
as well as a 32-Bit timer with deactivated prescaler for coverage.

It is assumed that other STM32 boards will behave like the
disco_l475_iot1. Only this board was available for testing.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2021-11-22 22:24:45 -05:00
Gerard Marull-Paretas 1123b80aee tests: drivers: pinctrl: gd32: add DT AFIO parse test
Add a test to check that DT information for the AFIO model is extracted
correctly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas f5ed5e6d0f tests: drivers: pinctrl: gd32: add DT AF parse test
Add a test to check that DT information for AF model is extracted
correctly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Daniel Leung bb595a85f1 kernel: mem_domain: add/remove partition funcs to return errors
This changes both k_mem_domain_add_partition() and
k_mem_domain_remove_partition() to return errors instead of
asserting when errors are encountered. This gives the application
chance to recover.

The arch_mem_domain_parition_add()/_remove() will be modified
later together with all the other arch_mem_domain_*() changes
since the architecture code for partition addition and removal
functions usually cannot be separately changed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Daniel Leung fb91ce2e21 kernel: mem_domain: init function to return error values
This changes k_mem_domain_init() to return error values
instead of asserting when errors are encountered.
This gives applications a chance to recover if needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Daniel Leung 2ffd49310a tests: mem_protect/mem_protect: more tables for QEMU Cortex A53
For qemu_cortex_a53 on the mem_protect test, the test
test_mem_domain_init_fail() fails due to not having enough
translation tables. However, since ARM64 MMU asserts on such
condition, and k_mem_domain_init() also asserts when fails,
there is no way to distinguish these two assertions at runtime,
thus the test was considered passing. Fix this by allocating
a few more tables so the test will actually fail on
k_mem_domain_init().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Andries Kruithof 9a9ccfec15 tests: edtt run gap and gatt tests with new LLCP
For consistency we run the gatt and gap tests also with the new
LLCP. The test lists for legacy and new LLCP are identical
and therefor no separate test lists have been introduced

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-20 11:59:04 -05:00
Krzysztof Chruscinski cc94cfd113 tests: logging: log_benchmark: Prevent flushing logs by ztest
Test is using logging in a different way and flushing logs
after each test case would not work.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-20 11:58:40 -05:00
Andrei Emeltchenko 89becd0b87 ibecc: tests: Increase test coverage
Increase test coverage with simulation of reading  IBECC_ECC_ERROR_LOG
and IBECC_PARITY_ERROR_LOG.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andrei Emeltchenko d11fae6d06 edac: ibecc: Return -ENODATA on zero log
Return -ENODATA when we read zero log.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andrei Emeltchenko 0feb432b8e ibecc: tests: Update test logging
Make logging more clear.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andrei Emeltchenko 6c6645bf47 edac: tests: Add more coverage tests
Add more test for better coverage of some static functions.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-11-20 11:54:32 -05:00
Andries Kruithof 9191dd77da tests: controller: give mock-file same name as in BT controller
Rename the mockup file from ull_periph.c into ull_peripheral.c
so that it has the same name as its equivalent in the BT
controller

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-20 08:01:14 -05:00
Wealian Liao eb5f711b7b test: driver: buildall: Add NCT38XX gpio
Add support NCT38XX I2C-based GPIO in build all test.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-11-20 08:00:38 -05:00
Szymon Janc d268c99266 test/bluetooth/tester: Re-pair on lost bond
If IUT is acting as a central device and peer lost bond we need
to re-pair to restore bond. PTS is not sending any WID for this
so bonding needs to be initiated implicitly by IUT.

This was affecting GAP/SEC/AUT/BV-25-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-19 20:11:34 +01:00
Tomasz Bursztyka f6be2835bd drivers: Apply SPI API change to relevant places
Mostly drivers, but also one sample and one test.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-19 11:50:38 +01:00
Gerard Marull-Paretas a6a296d050 tests: posix: common: increase main stack for TLS tests
Increase main stack size (in 128 bytes) to make these tests run
successfully on qemu_x86 platform.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Gerard Marull-Paretas 39f21dc116 tests: pm: use new PM macros
Use PM_DEVICE_STATE_DEFINE to define PM state.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Gerard Marull-Paretas 1832d68e01 tests: lib: devicetree: add tests for DT_INST_ENUM_IDX(_OR)
Add tests for the instance based enum macros DT_INST_ENUM_IDX and
DT_INST_ENUM_IDX_OR.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-18 19:12:07 -05:00
Andries Kruithof 9ee28afe9f tests: controller: remove outdated comment
The comment 'kconfig cheats' is outdated and misleading
and thus it must be removed

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-18 19:03:43 -05:00
Vinayak Kariappa Chettimada 640e20204c tests: Bluetooth: bsim: Use host BIG Sync APIs
Use the host BIG Sync APIs to test the BIG Sync establish
and Sync Terminate implementation in the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada 000833e427 tests: Bluetooth: bsim: Updates related to BIG Create Sync
Updates related to BIG Create Sync testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada d5489837cf tests: bluetooth: bsim: Receive the BIG Info callback
Added implementation to receive the BIG Info callback.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00