Commit graph

9545 commits

Author SHA1 Message Date
Jamie McCrae ec7044437e treewide: Disable automatic argparse argument shortening
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-26 20:12:36 +09:00
Marin Jurjević 12ce5beacd tests: drivers: adc: add support for nucleo_g070rb
Add support for nucleo_g070rb board to adc_api test.

Signed-off-by: Marin Jurjević <marin.jurjevic@hotmail.com>
2023-01-26 10:08:33 +00:00
Keith Packard 65427f47cf tests: logging: Stack overflow caught with TLS in log_core_additional
When thread local storage is enabled, log_core_additional generates stack
overflows in the main thread on several architectures. Increase the stack
size to 4096 bytes for this thread.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-01-26 10:04:33 +00:00
Keith Packard e490fe0f67 tests: kernel: Provide more stack space for context test
This test overflows when TLS is used, provide plenty of extra space to
avoid that.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-01-26 10:04:33 +00:00
Björn Stenberg 0321ac8dbf json: Increase max number of descriptor elements from 30 to 62
The limiting factor is the output bitmask that says which elements have
been filled in by the parser. This patch changes the bitmask type from int
to int64_t.

Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2023-01-26 09:51:54 +00:00
Hein Wessels 1480b2083e tests: bluetooth: edtt_ble_test_app: NATIVE_TASK has no return value
Remove the return value of edtt_stop because it's ignored by NATIVE_TASK.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-01-26 09:30:36 +01:00
Jan Malek 6fb644c663 renode: Add Renode overlays for selected tests
Tune quantum parameter for selected kernel tests
targetting the HiFive Unleashed platform.

Those tests require higher fidelity of the virtual
time flow which is achievable on multi-core platforms
in Renode by reducing the quantum.

Signed-off-by: Jan Malek <jmalek@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2023-01-25 14:02:29 -08:00
Henrik Brix Andersen 55d0ffa874 drivers: can: remove CAN_HAS_CANFD Kconfig helper
Remove the CAN_HAS_CANFD Kconfig helper symbol in order to allow enabling
CAN-FD support in the API regardless of driver support.

Change default to CAN-FD support being disabled and have samples and tests
that require CAN-FD support turn it on. This aligns the default
configuration across CAN controller drivers regardless of their
capabilities.

The rationale behind this is that we are starting to see MCUs with multiple
CAN controllers, some CAN-FD compatible, some not (e.g. NXP i.MX RT1060 and
FPGAs). Automatically enabling CAN-FD support based on the presence of a
CAN-FD capable CAN controller leads to different application default
settings based on the CAN controller(s) in use.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-01-25 15:00:39 +00:00
Henrik Brix Andersen c6db73e93d tests: drivers: can: timing: use capabilities to skip tests
Use the CAN controller driver capabilities to determine if the CAN-FD
timing tests should be skipped or not. There is no need for special
handling of CONFIG_CAN_FD_MODE.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-01-25 15:00:39 +00:00
Andreas Chmielewski 2571d6c3e3 tests: lwm2m_rd_client: Added fff tests
Added unittests for lwm2m_rd_client.c using FFF framework.

Signed-off-by: Andreas Chmielewski <andreas.chmielewski@grandcentrix.net>
2023-01-25 14:55:02 +00:00
Andrzej Głąbek ea859cce1e tests: drivers: nrf_rtc_timer: Add a next cycle timeouts test case
Add a test case that schedules a set of consecutive timeouts,
each one on the next cycle of the system timer but each time
after a slightly larger delay.
This test case reveals a problem in the current nrf_rtc_timer
implementation that sometimes a compare value can be missed
what leads to timeouts delayed by 512 seconds.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-25 11:25:01 +00:00
Morten Priess 921846731e Bluetooth: controller: Hotfix auto-merge error
Remove introduced duplicate mock function.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-01-24 15:43:36 +01:00
Nicolas Pitre 189fcbb3af tests: float_disable: this is no longer applicable to RISC-V
With lazy FPU context switching, k_float_disable() is merely triggering
a synchronous FPU context save and k_float_enable() is a no-op.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-01-24 15:26:18 +01:00
Vinayak Kariappa Chettimada c104fda34f Bluetooth: Controller: Fix filter accept list and privacy default
Fix filter accept list and privacy feature Kconfig default
based on whether host has them enabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-01-24 15:13:36 +01:00
Vinayak Kariappa Chettimada 00dbf6188c Revert "Bluetooth: Controller: Fix filter accept list and privacy default"
This reverts commit 59eef60665.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-01-24 15:13:36 +01:00
Alberto Escolar Piedras 1e7d2c83aa tests: bsim_bt compile: Provide more info during errors
As we are now compiling in parallel all apps, build errors
are not anymore next to the compile line, so let's tell
developers for app we are printing the build output
to ease debugging.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-01-24 14:20:33 +01:00
Kumar Gala 8f04408725 tests: Add newlib filter for some testcases that dont have it
Not all toolchains support newlib so tests that require newlib need
to have a filter to we don't try and build those tests on those
testcases.  Some newer tests are missing:

	filter: TOOLCHAIN_HAS_NEWLIB == 1

so add that to testcases that needed.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-01-24 11:10:27 +00:00
Morten Priess a982c9f9f6 Bluetooth: controller: Start CIG immediately if instant is next event
To be able to timely start the first CIS/CIG, if the requested instant
is the next connection event, call ull_peripheral_iso_start directly
from rp_cc_state_wait_rx_cis_ind instead of waiting for next time
through the state machine.

To enable ULL/LLL to prevent adding latency when LLCP is waiting for
instant, local- and remote procedures with instant now expose a function
for checking this state.

Fixed event_counter function to prevent one-off in RX path. Unified to
use single function ull_conn_event_counter.

Fixed LLCP unit tests and added new mock function.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-01-24 11:09:51 +00:00
Emil Gydesen 64f3bccdb7 tests: Bluetooth: Add per_adv sync with privacy
Add test where privacy is enabled and where
the two devices are bonded and have exchanged IRK
before doing the periodic advertising sync.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-24 09:43:59 +01:00
Emil Gydesen 11945688fb tests: Bluetooth: Add per_adv connection tests
Expand the periodic advertising tests with connections,
to verify that two devices can simultaneously be connected
and keep a periodic advertising sync.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-24 09:43:59 +01:00
Emil Gydesen 2db5d4d790 tests: Bluetooth: Add per_adv BSIM tests
Adds a test suite exclusively for testing
periodic advertising sync.

The first test added is a simple test that does a periodic
advertising sync, and passes afterwards.

The test suite will be expanded with testing PA syncs
with PAST (both from remote and local transfer) as well
as privacy handling.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-24 09:43:59 +01:00
Aleksandr Khromykh 83207d4a9a tests: Bluetooth: Mesh: use overlays for mesh bsim
Add the overlays usage for bsim mesh configurations instead of
multiple configurations that duplicate each other a lot.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-01-24 09:43:38 +01:00
Jordan Yates 9eaf1f8b44 tests: pm: power domains: test supported device
Validate the powered state and transitions for an arbitrary device
hanging off a power domain.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-01-24 09:42:11 +01:00
Tom Burdick b1e1b5e7b4 dma: Test repeatedly calling start/stop
Ensures that the documented behavior of the API is met by implementations
through testing. By calling stop on a stopped channel the expectation is no
error occurs and is checked.

Calling start after a channel has been started is difficult to test for
as there is transfer timing involved. A once shot transfer may have
completed and the channel transition to an inactive state by itself by
the time the second start call is performed. This isn't supported by at
least gpdma today and isn't documented behaviorally so should not be
tested.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-01-23 11:51:21 -08:00
Quang Bui Trong ad19019b29 samples: watchdog: board s32z270dc2_r52 only build and not running
Currently, the s32z270dc2_r52 board only supports running on RAM,
 so samples or tests watchdogs that perform SoC reset will not produce
 results. Set the build only for these samples and tests until the
 reset SoC function is supported.

Signed-off-by: Quang Bui Trong <quang.buitrong@nxp.com>
2023-01-23 11:46:43 -08:00
Chris Friedt ab6102f70f tests: posix: existence tests for standard POSIX includes
Add a trivial suite that simply ensures headers exist and that
they supply standard symbols and constants.

These tests are intended to be ordered exactly as the respective
feature appears in the respective specification at

https://pubs.opengroup.org/onlinepubs/9699919799

Over time, as POSIX support improves, we can enable additional
checks.

If `CONFIG_POSIX_API=n`, then we simply ensure that the header
can be included, that constants and structures exist, including
the existence of required fields in each structure.

We check that a constant exist, by comparing its value against
an arbitrary number. If the constant does not exist, it would
of course be a compile error.

```
zassert_not_equal(-1, POLLIN);
```

We check that a structure contains required fields by
comparing the field offset with an arbitrary number. If
the field does not exist, of course, there would be a
compile error.

```
zassert_not_equal(-1, offsetof(struct pollfd, fd));
```

For non-scalar constants, we simply attempt to assign
a value to the specific type:

```
struct in6_addr any6 = IN6ADDR_ANY_INIT;
```

If `CONFIG_POSIX_API=y`, then we additionally check that required
functions are non-NULL (limited to what is currently supported in
Zephyr).

```
zassert_not_null(pthread_create);
```

Note: functional verification tests should be done outside of this
test suite.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-01-23 09:57:31 -08:00
Francois Ramu 6ff19d77ce tests: drivers: use stm32 dma driver binding macro to configure channel
Use the macro as defined by the
include/zephyr/dt-bindings/dma/stm32_dma.h to configure the
dma channel.
Use the STM32_DMA_PERIPH_TX or STM32_DMA_PERIPH_RX value.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-01-23 09:15:21 -06:00
Dominik Ermel f05e8e8f27 tests: drivers: flash: Fix filter using non-existent partition
Filtering used image_1_nonsecure as DTS node label, while correct
one is slot1_ns_partition.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-01-23 10:06:50 +00:00
Hein Wessels 0b3338472a tests: drivers: adc: adc_api: add second channel to nucleo_h743zi
Adds a second channel to the nucleo_h743zi test
because it's now supported by the driver

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-01-23 09:59:46 +00:00
Szymon Czapracki 7941a88121 bluetooth: tester: Add VCP & IAS test handling
This commit introduces Volume Control Profile and
Immediate Alert Service into btp.

VCP includes:
Audio Input Control Service
Volume Control Service
Volume Offset Control Service

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2023-01-20 16:12:15 +01:00
Andries Kruithof f0c610ce0d bluetooth: controller: update unittests for improved ZTEST framework
Update the unittests for feature exchange to use the new ZTEST API
Here we only update the feature exchange procedure. The remaining
unittests will be done in a next PR

Mocks, helper routines and the Unit Under Test are splitted out as
a library instead of adding them to the file list

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-01-20 14:35:08 +01:00
Vinayak Kariappa Chettimada d6c3e04eb8 Bluetooth: Controller: Central maximum data PDU size time spacing
Use the maximum data PDU size time reservation space
considering the Data length could be updated from default
27 bytes to maximum support size.

If maximum time reservation is disabled then time space
reservation corresponding to the default data length at the
time of the start/enable of Central role is used.

Note, currently this value is only used to space multiple central
connections and not for actual ticker time reservations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-01-20 12:16:43 +01:00
Vinayak Kariappa Chettimada 680e29dd0e Bluetooth: Controller: legacy: Fix conn param request to be cacheable
Fix connection parameter request  procedure to be cacheable
if a remote control procedure is in progress.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-01-20 12:16:43 +01:00
Keith Packard 35e017a9ee subsys/cpp: Also run C++ tests with picolibc when possible
When the toolchain has picolibc support, run
samples/subsys/cpp/cpp_synchronization and tests/subsys/cpp/libcxx tests
using it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-01-20 09:03:25 +01:00
Felipe Neves cd04926d6b sensors: as5600: added as5600
magnetic angle sensor driver.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2023-01-19 15:18:24 -06:00
Andries Kruithof e7d60e3ed6 Bluetooth: controller: fix post DLE/PHY update event length
Fix the controller implementation to perform connection
event length reservation based on the completed Data Length
Update and/or PHY Update Procedure.

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-01-19 11:18:51 +01:00
Jarno Lämsä abafd7e810 net: lib: lwm2m: Replace deprecated function calls
Replace calls to deprecated functions with new ones.

Signed-off-by: Jarno Lämsä <jarno.lamsa@nordicsemi.no>
2023-01-19 10:16:22 +01:00
Daniel DeGrasse 0c2808e62d tests: drivers: i2c_target_api: enable i2c_target_api test for RT1060
Enable RT1060 target API test for RT1060. The LPI2C does not support
dual controller/target operation, so LPI2C3 is used as the controller
while LPI2C1 implements the target device.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-19 10:16:13 +01:00
Andrei Emeltchenko 5bdb1faffe tests: bluetooth: Fix memset() wrong buffer size
Use correct structure in sizeof().

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-01-19 10:15:40 +01:00
Eivind Jølsgard cfa1ba1261 fs: fcb: add option to disable CRC for fcb entries
Add option to disable CRC for fcb entries. This improves the write
throughput significantly at the cost of not detecting corrupted data
in flash. This is beneficial for aplications that needs the extra
write throughput, where error detection is done elsewhere.

Allow the FCB entries in flash to have a valid CRC when CRC is
disabled in the FCB. This allows existing solutions to disable
CRC checking, while keeping the CRC areas intact. Note that this
is a one-way option.

Fixes #53707

Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
2023-01-18 22:18:37 +00:00
Mariusz Skamra f30eb1b9fb tests: bsim: audio: Create unicast group prior stream configuration
This updates the test to create the unicast group with non-configured
streams.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-01-18 09:56:52 +01:00
Mariusz Skamra 36058480e7 Bluetooth: audio: Improve stream coupling for CIS as the unicast client
Allow  the streams to be paired when creating unicast group. This will
allow to reuse the same ISO for the paired streams.

Fixes: #51796
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-01-18 09:56:52 +01:00
Evgeniy Paltsev 122c7be703 tests: smp: fix fatal on smp test case
After the dbe3874079 - (tests: kernel/smp: wait for threads to exits
between tests) I've started seeing sporadic kernel.multiprocessing.smp
test failures on our platforms.

------------------------------->8---------------------------------
[*snip*]
===================================================================
START - test_fatal_on_smp
E:  r0: 0x3  r1: 0x0  r2: 0x0  r3: 0x0
E:  r4: 0x80000194  r5: 0x0  r6: 0x0  r7: 0x0
E:  r8: 0x800079c4  r9: 0x82802 r10: 0x80008d8c r11: 0x8000dad8
E:  r0: 0x3  r1: 0x2712  r2: 0x114  r3: 0x0
E:  r4: 0xf4240000  r5: 0x0  r6: 0xf424  r7: 0xbe40
E:  r8: 0x2540  r9: 0x0 r10: 0x80008d8c r11: 0x8000db8c
E: r12: 0x8000ddf0 r13: 0x0  pc: 0x80000aec
E:  blink: 0x80000ae6 status32: 0x80082002
E: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
E: Current thread: 0x8000db8c (test_fatal_on_smp)
E: r12: 0x8000ddf0 r13: 0x0  pc: 0x8000019a
 PASS - test_fatal_on_smp in 0.014 seconds
===================================================================
START - test_get_cpu
E:  blink: 0x80001490 status32: 0x80082002
E: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 1
E: Current thread: 0x8000dad8 (unknown)
------------------------------->8---------------------------------

The rootcause if that we doesn't proper cleanup resources after
test_fatal_on_smp test case. So child thread we start test_fatal_on_smp
may continue running for some time after the test_fatal_on_smp
test case is finished.

As in the next test case (test_get_cpu) we use same thead structures
again to create new child thread we may actually rewrite some data of
thread which is still running (or vise versa).

As we trigger the crash in test_fatal_on_smp we can't simply join
child thread in the end of test case (as we never get here). We can't
simply use join child thread before we initiate crash in test_fatal_on_smp
either as we don't want to introduce reschedule point here which may break
the test logic.

So, to fix that, we'll just do k_busy_wait in test_fatal_on_smp
thread after we start child thread to wait for thread trigger
exception and being terminated.

To verify that we also assert that child thread is dead by the
time when we stop busy waiting.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2023-01-17 21:51:26 +00:00
Andrei Emeltchenko 8f4d8c5cce tests: spsc_pbuf: Check return code
Make check_buffer() call useful.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-01-17 21:50:16 +00:00
Daniel DeGrasse bd593bf93e tests: code_relocation: Add additional test cases for library and genex
Add test cases for generator expressions and library relocation to
the code_relocation test, in order to verify functionality for these
new API features.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-17 18:08:37 +01:00
Daniel DeGrasse 47271ce8be treewide: update usage of zephyr_code_relocate
Update usage of zephyr_code_relocate to follow new API. The old method
of relocating a file was the following directive:

zephyr_code_relocate(file location)

The new API for zephyr_code_relocate uses the following directive:

zephyr_code_relocate(FILES file LOCATION location)

update in tree usage to follow this model. Also, update the NXP HAL SHA,
as NXP's HAL uses this macro as well.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-17 18:08:37 +01:00
Ahmed Moheb 5eb19ab352 tests: bluetooth: host: Add UT for bt_le_oob_get_sc_data()
Unit test project for bt_le_oob_get_sc_data().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb 6c7a5aa930 tests: bluetooth: host: Add UT for bt_le_oob_set_sc_data()
Unit test project for bt_le_oob_set_sc_data().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb 7abdb2c9b2 tests: bluetooth: host: Add UT for bt_le_oob_set_legacy_tk()
Unit test project for bt_le_oob_set_legacy_tk().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00
Ahmed Moheb 811bdf8986 tests: bluetooth: host: Add UT for bt_le_ext_adv_oob_get_local()
Unit test project for bt_le_ext_adv_oob_get_local().
This part of subsys/bluetooth/host/id.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2023-01-17 13:13:28 +01:00