Commit graph

12862 commits

Author SHA1 Message Date
Aleksander Wasaznik 060dc9ef6d Bluetooth: tests: Switch to default BT_RECV_CONTEXT
The tests `hci_prop_evt` and `host_long_adv_recv` used `bt_recv_prio`,
and so relied on an extra config option `CONFIG_BT_RECV_BLOCKING`. This
patch replaces the use of `bt_recv_prio` with `bt_recv` and restores the
use of the default option for `BT_RECV_CONTEXT`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-02-26 11:37:14 +00:00
Aleksander Wasaznik 6f077be959 Bluetooth: tests: init: CONFIG_BT_RECV_WORKQ_BT=y
Add a test case to the init test to cover `CONFIG_BT_RECV_WORKQ_BT=y`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-02-26 11:36:48 +00:00
Gaetan Perrot a4ea4e294f posix: Implement test for fdetach and fattach
Add tests for `fdetach()` and `fattach()`

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-02-26 11:36:04 +00:00
Chen Xingyu eaa492ab3e tests: drivers: build_all: input: Add adc-keys
* so that it'll be built by the CI

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-02-26 11:35:19 +00:00
Piotr Narajowski 69381b1ba7 bluetooth: tester: Add TBS server tests
Adding support for TBS server tests.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2024-02-26 11:34:00 +00:00
Jonathan Rico 1c73528a10 tests: Bluetooth: add host flow-control test
Verifies that there is no host RX buffer leak due to disconnections.

That is, not actual host buffer objects but rather the number of buffers
that the controller thinks the host has.

If there is a desynchronization between those two, the result would be that
the controller stops forwarding ACL data to the host, leading to an
eventual application timeout.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-02-26 11:32:36 +00:00
Alberto Escolar Piedras 65d49cd434 tests/bsim/bt/host: Split build script in 6
There are quite many BT host test images being built.
Today these are all built in parallel, causing a quite
high load.

Let's split them in their separate sub-scripts,
so we don't parallelize too many builds,
and users have more granularity if they only
want to build a subset.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-02-26 11:40:47 +01:00
Alberto Escolar Piedras 940d53e839 tests bsim/bt/ll: Split build script in 2
The CIS tests are building quite many
apps on their own.
Let's split them in their separate sub-script,
so we don't parallelize too many builds,
and users have more granularity if they only
want to build a subset.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-02-26 11:40:47 +01:00
Christopher Friedt f60ef4dea9 tests: posix: mqueue: increase sleep ms to reduce failures
The test_mqueue_notify_thread testcase had a relatively high
failure rate because sleeping only 10ms was in some cases not
sufficiently long enough for the spawned thread to update
notification_executed.

Sleep 100 ms instead of 10 ms to reduce the failure rate.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-26 02:09:42 -05:00
Emil Gydesen 41a589c5fa Bluetooth: CSIP: Add support for dynamic SIRKs
Add support for dynamically change the SIRK in a CSIS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:28:26 -05:00
Gustavo Silva 3850f4ca64 drivers: sensor: add ScioSense ENS160 driver
Add driver for ScioSense ENS160 multi-gas sensor. The driver includes
support for I2C and SPI, attributes for setting temperature and
humidity compensation and data ready trigger.
Also add ScioSense to the list of vendor prefixes.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
2024-02-25 22:27:22 -05:00
Emil Gydesen f4d82cedb9 Bluetooth: Audio: Remove the BT_AUDIO_CODEC_LC3_QOS macros
The LC3 framed macros were unused.
The LC3 unframe macros only added the 7500/10000
parameter, but since the the 7500/10000 requirement is also
defined by BAP, it makes equally much sense to simply use the BAP
presets.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:26:57 -05:00
Emil Gydesen d78604e690 Bluetooth: Audio: Remove the BT_AUDIO_CODEC_LC3_CONFIG_X_Y
LC3 does not define any such configurations, and they are in
fact defined by the BAP. The LC3 header file should thus not
pretend that there are these specific configurations for LC3.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:26:57 -05:00
Emil Gydesen ede68ad5c0 tests: Bluetooth: CAP Commander Change Volume mute unittests
Adds unittests for the CAP COmmander Change Volume mute
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:25:26 -05:00
Emil Gydesen 341906a0fd tests: bsim: Bluetooth: CAP Commander Change Volume mute
Adds bsim test of the CAP Commander Change Volume mute
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:25:26 -05:00
Riadh Ghaddab 0fb8506ae4 tests: subsys/fs/nvs: fix nvs-cache-gc test
nvs-cache-gc test is running into infinite loop because of the wrong
stop condition when filling a sector.
Fix this by keeping an empty ATE in the sector for delete operation as
defined in the NVS filesystem write operations.

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2024-02-25 20:47:06 -05:00
Anas Nashif ce4022f828 tests: dma: remove wrong license from overlay
Wrongly licensed file, change to APL-2.0.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-25 20:44:48 -05:00
Emil Gydesen 686a8c9e54 tests: bsim: Bluetooth: Add GATT encrypt tests
Add tests for the GATT permissions to read and write for
characteristics that require encryption and LESC encryption.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-19 20:46:28 +01:00
Emil Gydesen fa4a6f3c68 tests: bsim: Bluetooth: Fix GATT long read test
The test where it was supposed to read the long characteristic,
only read the "small" characteristic, due to setting the wrong handle.

With the right handle, the test failed and the test had to be
updated to store the data across multiple reads, and then do
the proper comparison.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-19 20:46:28 +01:00
Grzegorz Chwierut d02c1bb7ad tests: Fix pytest scenarios for boot with mcumgr.
Clear buffer before restarting DUT. This is to avoid using
lines from previous initial boot, when verifying if upgrade was
done as expected in test.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-02-16 08:09:46 +01:00
Najumon B.A 89745fe472 lib: acpi: update shell and test app with the modifed resource struct
update shell and test app with the modifed resource struct such as
acpi_irq_resource and acpi_mmio_resource

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-02-15 12:28:55 +01:00
Henrik Brix Andersen d93693082a tests: lib: deviceteee: api: remove deprecated, unused labels
Remove deprecated, unused devicetree label properties.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-14 23:49:35 +01:00
Emil Gydesen 2fbc5b1ae2 samples: Bluetooth: Minor improvements for broadcast audio sink
Increases some of the timeouts so that when using this sample
against other interactive devices (such as a phone or the
Zephyr audio shell), then it's easier to do it in time.

Also updates a few of the printks and ensures that we are not
doing name filtering when we have been requested to sync to
a specific broadcast source by a broadcast assistant.

The test for the sample has also been modified to have a longer
timeout to accomodate for the new semaphore timeout values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-14 22:27:26 +01:00
Daniel Leung 611ebb6df4 tests: workq/user_work: change how resource pool is exhausted
The assumption of going through 100 iterations of allocating for
work queue is that the HEAP size is 1024 bytes. However, there
are platforms where the HEAP size is inflated due to subsystems
and/or drivers being included. So change the for loop into
a loop where it only stops until there is no memory to be
allocated.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-02-14 19:08:02 +01:00
Daniel Leung 78fe66834f tests: c_lib/thrd: more stack for up_squared board
Similar to qemu_x86_64, the up_squared needs more stack space
to run the tests.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-02-14 19:08:02 +01:00
Christopher Friedt 2155a9e5f7 logging: rename log2_generic to log_generic
The log2 prefix was deprecated and changed to log some time ago,
but log2_generic() seems to have been inadvertantly left with
the old prefix.

Rename log2_generic() to log_generic() to follow suit.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-14 19:07:30 +01:00
Ping Wang 5ccd75b49b Bluetooth: Audio: define bt_bap_bass_subgroup struct.
The Broadcast Assistant API should be fully independent of the scan
delegator. Therefore the new struct bt_bap_bass_subgroup has been
defined to avoid a dependency.

Fixes: #68338

Signed-off-by: Ping Wang <pinw@demant.com>
2024-02-14 19:04:01 +01:00
Christopher Friedt 218f787e26 thrift: null-terminate certificates in samples and tests
The thrift methods loadCertificateFromBuffer(),
loadPrivateKeyFromBuffer(), and
loadTrustedCertificatesFromBuffer() expect a null-terminated
string.

Append '\0' to each array used to hold a certificate in
thrift samples and tests.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-13 19:36:58 +01:00
Daniel Leung 575eb123e9 tests: mem_protect/obj_validation: fix check for heap size
Commit 3fbf12487c introduced a way
to add to CONFIG_HEAP_MEM_POOL_SIZE if, for example, subsystems
need more heap space. However, the size check in obj_validation
was still using the old kconfig, and was failing when extra
space was specified. So update the size check to use the updated
size.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-02-12 13:36:48 +01:00
Emil Gydesen 3e634268d6 Bluetooth: ISO: Introduce bt_iso_chan_send_ts
The bt_iso_chan_send function could take an optional
timestamp by using 0 as an indicator. The issue with
this approach was that a timestamp value of 0 is valid,
and could cause potential issue with syncing streams
in a group.

To fully support transmitting with and without timestamp,
bt_iso_chan_send_ts has been introduced, which is the only
function of the two (bt_iso_chan_send being the other) that
supports timestamps.

A new function, rather than adding a boolean to the existing,
was chosen as it simplifies the individual functions as well
as making it more explicit what the function does.

Since the bt_iso_chan_send function is used by LE audio, both
the BAP and CAP send functions have similarly been updated.
Likewise, all tests and samples have been updated to use the
updated function(s), and BT_ISO_TIMESTAMP_NONE has been
removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-12 13:13:10 +01:00
Guillaume Gautier 24b9b60025 tests: drivers: adc_dma: add nucleo_f401re to the adc_dma test
Add Nucleo F401RE to the adc_dma test

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-02-12 12:19:56 +01:00
Anas Nashif 592a7cd6a7 tests: devmux: fix test identifiers
Fix test identifier, use correct component/sub-component.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-11 10:58:23 -05:00
Anas Nashif 9541677c86 tests: cmsis-dsp: rename tag to match west module name
Rename all tags to match module name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-11 10:58:23 -05:00
Flavio Ceolin 36a497b5e4 tests: dynamic_thread_stack: Fix problems in multicore
When running it in a multicore and with incoherent cache environment it
is possible that the thread allocating dynamic stacks is switched to a
different cpu. In this situation further access to that memory (like
when releasing resources) will be invalid.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-02-09 14:23:14 -05:00
Andrei Emeltchenko eef605d6cc tests: lib: acpi: Add test verifying assert on devscope overflow
Add test verifying we catch assert() when subsctrucure is too big.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2024-02-09 13:16:33 -06:00
Andrei Emeltchenko a7afc87527 tests: lib: acpi: General header cleanup
Cleanup headers and definitions to make code more readable.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2024-02-09 13:16:33 -06:00
Andrei Emeltchenko d89a274e7a tests: lib: acpi: Verify assert() on invalid size
Catch assert() when invalid unit size is bigger then actual
table or subtable size.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2024-02-09 13:16:33 -06:00
Andrei Emeltchenko bffcd1de2a tests: lib: acpi: Add testing acpi_dmar_ioapic_get()
Add testing for acpi_dmar_ioapic_get() function.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2024-02-09 13:16:33 -06:00
Andrei Emeltchenko 9c7b952db5 tests: lib: acpi: Add testing for dmar_foreach_devscope()
Add unit testing for dmar_foreach_devscope() function.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2024-02-09 13:16:33 -06:00
Andrei Emeltchenko 9cf06173f7 tests: lib: acpi: Refactor DMAR structure and tests
Refactor DMAR structure to allow more tests. Use fake void function
for invalid size tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2024-02-09 13:16:33 -06:00
Thomas Ebert Hansen b15452bd08 Bluetooth: controller: Fix Data Length Update
Before a LL_FEATURE_REQ is sent, verify that the Data Length Update
procedure is still supported as it could have been unmasked as the result
of a previously completed Feature Exchange procedure.

Add unit test to verify the case of enqueuing both a
Feature Exchange procedure and Data Length Update procedure, where the
Feature Exchange procedure would result in the unmasking of the Data
Length Update procedure.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2024-02-09 13:46:41 +01:00
Thomas Ebert Hansen 8c412971a9 Bluetooth: controller: Fix PHY Update TX Q
Resume the TX Data Q when a LL_UNKNOWN_RSP is recieved instead of a
LL_PHY_RSP.

Update PHY Update unit test with more coverage of the TX Data Q pause
state.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2024-02-09 13:46:41 +01:00
Pavel Vasilyev 30ccd55f4c tests: bsim: bluetooth: mesh: Add advertiser suspend test
Add a test that checks that both advertisers, the legacy and the
extended behaves identically when the stack is suspended, in particular:
- `bt_mesh_send_cb.end` callback is called with error code `0` for the
  advertisement that the advertiser already pushed to the ble host
  (called `bt_mesh_send_cb.start`),
- `bt_mesh_send_cb.start` callback with error `-ENODEV` is called for
  every advertisement that was pushed to the mesh advertiser using
  `bt_mesh_adv_send` function before the stack was suspended,
- `bt_mesh_adv_create` returns NULL when attempting to create a new
  advertisement while the stack is suspended.

The `bt_mesh_adv_disable` is called from the work because calling it
from the `bt_mesh_send_cb.start` callback will cause a deadlock.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-08 10:11:19 +00:00
Pavel Vasilyev b352301d80 tests: bsim: bluetooth: mesh: Change error code on timeout
This commit changes error code returned by `k_sem_take` when it times
out from `-EAGAIN` to `-ETIMEDOUT` because `bt_le_scan_start` also
returns `-EAGAIN` if bt device is not ready, which may lead to invalid
test behavior.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-08 10:11:19 +00:00
Piotr Kosycarz c8716f2793 tests: drivers: spi: wait more when polling
Extend timeout to perform coverage analysis when testing on HW.
Coverage mode makes execution slower.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-02-08 09:02:59 +01:00
Piotr Kosycarz 4f6fe99cdf tests: drivers: spi: allow to configure thread stack size
Used to perform coverage analysis when testing on HW.
Gathering coverage data require more stack,
so its needs to configurable.
There is used CONFIG_TEST_EXTRA_STACK_SIZE for that.
(with value depending on used HW).

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-02-08 09:02:59 +01:00
Anas Nashif df87e78dab tests: dma: rename DT node label for tested device
Use tst_dma0 to avoid conflict with how twister and ztest deal with
testcase names.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-07 18:51:38 -05:00
Patryk Kuniecki 52fd66bdfa tests: kernel/interrupt skip on ITE
After discussion in #63114 we should skip this test on ITE board.

Signed-off-by: Patryk Kuniecki <patryk.kuniecki@intel.com>
2024-02-07 22:08:22 +00:00
Luis Ubieda f59eb2f1e9 Tests: Bluetooth: Host: Add ext-adv test to iterate reconnections
Where advertisement, connection and disconnection is iterated over 5
times, to verify the reestablishment of extended advertisements when
iterating over multiple times. Additionally, the connection
unreferencing has been decoupled from the disconnect event on both
sides, to demonstrate the dependency of the recycle event.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-02-07 22:50:16 +01:00
Luis Ubieda 1f0346c45a Tests: Bluetooth: Host: Split ext-advertisements in separate builds.
Split into two separate builds: advertiser and scanner to emphasize
clarity and robustness during reestablishment of advertisements and
scanning.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-02-07 22:50:16 +01:00
Kamil Piszczek 129b73ce26 bluetooth: gatt: remove operation infix from authorization callback API
Removed the "operation" infix from the bt_gatt_authorization_cb
callback structure in the Bluetooth GATT header.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-02-07 15:36:25 +00:00
Anas Nashif de2fbf3fa8 tests: move tests/lib/thrift to tests/modules/thrift
Put tests related to optional modules under tests/modules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-07 07:37:32 -05:00
Konrad Derda 28f37e07b6 tests: net: buf: additional verification of fixed buffer pool
This commit introduces two changes:
- veryfing fixed buffer's size and length after allocation to existing
  test case
- new test veryfing appending bytes to a network buffer from a fixed
  size pool

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-02-06 12:56:37 +01:00
Konrad Derda 57cd012476 test: net: net_pkt: use var buffer pool for testing
From change 47eb592c28b9e7dfbdd25fedbf07a528ad240084 net_buf structures
allocated from pools defined with NET_BUF_POOL_FIXED_DEFINE() will keep
their `size` member set to the actual fixed size and not requested
size like before.

For this set of tests NET_BUF_POOL_FIXED_DEFINE() for several test
cases. These tests check the several values based on a fact that the
network buffer's size was set to the requested size.

This commit changes definition of the buffer pool to
NET_BUF_POOL_FIXED_DEFINE() in order to satisfy these expectations.
This change does not impact the tests themselves.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-02-06 12:56:37 +01:00
Juliane Schulze 1683f1913b drivers: Add support for TI TMAG5273 3D Hall sensor
Product Homepage:
https://www.ti.com/product/TMAG5273

Datasheet:
https://www.ti.com/lit/ds/symlink/tmag5273.pdf

Tested on a custom hardware with nRF52840.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-02-05 13:23:24 -06:00
Emil Gydesen 7643526086 Bluetooth: BAP: Do not send PA term request on local remove
If the receive state is locally removed, then we should not
request permission from the application, as that is implicit
when removing the source locally.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 17:45:45 +01:00
Fabio Baltieri 069cdffbc3 tests: display: fix the test so it actually builds
The test is configured to replace the config rather than extending,
resulting in a build with CONFIG_DISPLAY=n and the driver not being
actually built.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-02-05 17:45:25 +01:00
Emil Gydesen cbc81b2a0f Bluetooth: Audio: Remove LC3 from the assigned numbers defines
The defines from the Bluetooth Audio assigned numbers are not
specific for LC3. This commit removes the LC3 infix and
the reference to LC3 in the documentation for them.

It also cleans up some of the documentation and
names of the enums.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 09:14:44 -06:00
Dominik Ermel 5f31c15b1d tests/settings/file: increase main stack size
Increase ZTEST and MAIN stack to 4k.

Fixes #57324

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-02-05 14:50:52 +01:00
Emil Gydesen 065253c173 Bluetooth: CAP: Make unicast stop more similar to unicast start
Modify the parameters for bt_cap_initiator_unicast_audio_stop
so that they are more similar to
bt_cap_initiator_unicast_audio_start.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-04 19:54:18 -06:00
Emil Gydesen ec549cebd5 Bluetooth: CAP: Make unicast update more similar to unicast start
Modify the parameters for bt_cap_initiator_unicast_audio_update
so that they are more similar to
bt_cap_initiator_unicast_audio_start.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-04 19:54:18 -06:00
Emil Gydesen f35e9871d5 Bluetooth: CAP: Remove unicast group param from unicast_audio_start
Since we can always lookup the group from the streams, the
group parameter had no purpose.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-04 19:54:18 -06:00
Anas Nashif d7678f1694 xtensa: move to use system cache API support for coherency
Remove custom implementation and use system cache interface instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-03 13:42:33 -05:00
Grant Ramsay c81eaff1d9 tests: kernel: mem_protect: Handle thumb instructions for Cortex-R
Check for COMPILER_ISA_THUMB2 rather than CPU_CORTEX_M when determining
if special handling is required for thumb instructions.

This prevents false negative results on Cortex-R devices that may
generate a fault (test pass) even if the MMU/MPU is not configured
correctly.

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2024-02-02 17:05:01 -06:00
Robert Lubos c6f2f2cf53 tests: net: ip-addr: Fix compiler warning
Building with Zephyr SDK 0.16.5 revealed a minor bug with the buffer
size provided to snprintk():
  specified bound 38 exceeds destination size 20 [-Wstringop-overflow=]

As we provide the buffer to snprintk() with an offset, the actual
buffer size should be reduced by that offset value.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-02-02 19:54:52 +01:00
Keith Packard c4d05b5f9e tests/c_lib: Remove define of _POSIX_C_SOURCE for newlib
This test does not use any APIs beyond those provided in the Zephyr
standard set, so it should not define _POSIX_C_SOURCE.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-02-02 19:54:33 +01:00
Radoslaw Koppel 53becb05bf tests: kernel: common: Enable tests with LTO
This commit enables some kernel tests with
Link Time Optimization enabled.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2024-02-02 19:49:36 +01:00
Radoslaw Koppel 3799b93689 tests: kernel: gen_isr_table: Add tests for local ISR tables declaration
This commit adds configurations to test local ISR tables declaration.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2024-02-02 19:49:36 +01:00
Radoslaw Koppel b0c83f328c arch: sw_isr_table: Update shared interrupts structures
This commit updates the definition of z_shared_isr_table_entry
to use _isr_table_entry instead of specially created z_shared_isr_client.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2024-02-02 19:49:36 +01:00
Tom Burdick 84e883b611 llext: Support memory protection
Sets up memory partitions and allows for the partitions to be added to a
memory domain after loading an extension. This allows for applying
memory protection attributes to all of the needed memory regions an
extension requires to execute code correctly.

Currently only works when usermode is enabled as otherwise memory
protection APIs are unavailable.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-02-02 13:06:28 -05:00
Jukka Rissanen aa546baf44 tests: net: sockets: udp: Add recvmsg test for checking msg_controllen
Make sure that msg_controllen is cleared if there is no
control data received.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-02 11:51:53 -06:00
Juliane Schulze 34cb22e919 sensors: Add driver for Vischay VCNL36825T Proximity Sensor
Driver for the Vishay VCNL36825T including power management support.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-02-02 10:51:10 -06:00
Andrzej Głąbek 00566d64fa tests: lib: cpp: Exclude cpp98 test on nRF54H20
Similar to nRF54L15, the MDK files in HAL for this SoC are not
compatible with C++98, so currently the test cannot be performed
on this SoC.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Andrzej Głąbek c50c4130a0 tests: arm_irq_vector_table: Add special handling for nRF54H20
Different set of IRQ lines need to be used for this SoC and the CLOCK
IRQ is not to be installed in the vector table.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Emil Gydesen 954f2a09fb tests: bsim: Bluetooth: Audio: Add additional testing of discovery
Expand the babblesim tests for LE audio to verify that all the
discovery functions can be called multiple times without error.

HAS is an exception as that has an existing separate check
that disallows discovery multiple times.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-02 09:34:52 -06:00
Emil Gydesen ec41dd9ba6 Bluetooth: Audio: Use BT_GATT_SUBSCRIBE_FLAG_VOLATILE
The LE Audio implementations do not really support bonding yet,
and removing subs on disconnect is the most effective (and correct)
way of ensuring that we do not subscribe more than once when we
re-discover after reconnection.

The broadcast assistant and the media control client does not
support multiple connections as of this commit, so they needed
special treatment. In the case that we do discovery on multiple
ACL connections, it is important that the existing subscriptions
are removed correctly by calling bt_gatt_unsubscribe.

In order to implement this change properly on some of the clients,
thet had no proper connection references or support
for clearing the data on disconnects, they had to be updated
as well.

The csip_notify.sh test has been disabled, as that expected a
notification in the client, but since this commit removes that
(until bonding is properly supported in the clients), then the
test will fail.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-02 09:34:52 -06:00
Emil Gydesen 922ac3c7c1 Bluetooth: Audio: Add missing error checks for calls to bt_gatt_subscribe
Several places the LE Audio clients called bt_gatt_subscribe without
checking the return value, which could cause some issues in the worst
case, and in the best case, cause some unexpected behavior.

Some implementations had a bit more updating to handle the new
behavior.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-02 09:34:52 -06:00
Tomas Galbicka 73d6c336ca samples: tests: mbox: Add lpcpresso55s69 support
This commit adds support for NXP board LPCXpresso55S69 for mbox.
 - samples/drivers/mbox/ - mbox signaling mode
 - samples/drivers/mbox_data/ - mbox data transfer mode
 - tests/drivers/mbox/mbox_data/ - mbox test to verify functionality.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-02-02 09:31:33 -06:00
Ping Wang 2f138fad5f Bluetooth: Audio: MCC optional procedures actually optional
This change makes the optional procedures in the Media Control Client
optional and configurable through Kconfig.

Signed-off-by: Ping Wang <pinw@demant.com>
2024-02-02 12:42:55 +01:00
Gaetan Perrot 6fe676f4e8 posix: sched: Implement tests for sched_rr_get_interval
Implement tests for `sched_rr_get_interval()` .
Function is actually placeholders and just return `ENOSYS`
since Zephyr does not yet support processes or process scheduling.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-02-02 12:42:50 +01:00
Robert Lubos 6d6d5b438d tests: net: dhcpv4_server: Add test case for ICMP probing
Add test case which verifies that ICMP probing work as expected for the
DHCPv4 server. Make sure we build tests with both, probing enabled
(default) and disabled (enforced in testcase.yml) to make sure the
server is functional regardless of the probing feature.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-02-02 12:42:44 +01:00
Jordan Yates 84ce10658c tests: cmsis-dsp: request required features
Request the CMSIS DSP features required for each test.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-02-01 14:49:03 -06:00
Anas Nashif 2a260a84c8 tests: CAN: change duplicate test name: get_capabilities
In twister, we do not include the ZTEST testsuite as part of the
identifier, something we should start doing especially for tests with
multiple suites. The issue happens with same testcase name in different
suites, where results get messed up.
Work around this for now by making the testcase names unqiue until we
have a better solution twister.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-02-01 14:31:05 -06:00
Derek Snell de5586d7ec boards: arm: lpcxpresso55s69_cpu0: enable DMA
The DMA is already enabled for this board, but updating the board doc
page to make that clear, and enabling the DMA loop_transfer test.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-02-01 10:23:11 -06:00
Emil Gydesen 81a1826e13 tests: bsim: Bluetooth: CSIP: Increase EXECUTE_TIMEOUT to 30
Some of the CSIP tests take a while to run given the number of
devices, and some of them started to fail in CI because of a
timeout, so we increase the EXECUTE_TIMEOUT a bit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-01 17:00:47 +01:00
huajiang zheng 3d9f76b8e5 Bluetooth: Host: add unregister connection callback function
[Description]
tests: shell: Restart bt will register the same connection callback twice.
Callback next node point to itself, when link established callback function
loop infinitely.
[Fix]
Unregister the previous callback to avoid register repeatedly.
[Test]
After bt init/disable times, create connection successfully.

Signed-off-by: huajiang zheng <huajiang.zheng@nxp.com>
2024-02-01 16:05:38 +01:00
Luis Ubieda 7e5b2a79fc Tests: Bluetooth: Host: Added Test for extended Advertisements
Where extended advertising is restablished through the use of
recycled() callback, registers over bt_conn_cb_register().

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-02-01 14:31:27 +00:00
Gaetan Perrot 042b522506 tests: posix: add tests for pthread_testcancel()
Add tests for pthread_testcancel()

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-02-01 15:14:28 +01:00
Krzysztof Chruściński ee13631362 pm: device_runtime: Extend existing API with ISR_SAFE mode
Extend macros from creating a PM device with an optional argument
which indicate whether type of device is ISR_SAFE or not.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-02-01 15:03:42 +01:00
Krzysztof Chruściński 5ce4348311 tests: pm: device_runtime_api: Extend with synchronous device
Extended test to support case when PM device is defined as
synchronous.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-02-01 15:03:42 +01:00
Andries Kruithof b7078286d2 Bluetooth: audio: test: add test for long write
Added a test for long write, long read, and notifications

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-02-01 14:37:40 +01:00
Henrik Brix Andersen 1e60833836 tests: drivers: can: shell: verify can_get_core_clock() call count
Verify the call count of can_get_core_clock() after executing "can show"
shell subcommand.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-01 13:19:46 +00:00
Stine Åkredalen fcb8fa7b02 tests: bluetooth: mesh: blob test bugfix
Added missing end marker to test instance

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
2024-02-01 10:28:53 +00:00
Emil Gydesen e92e4c249d Bluetooth: Audio: Update return value of {cfg,cap}_get_val
The get_val functions will now return -ENODATA in case that
a value isn't found, instead of 0.

This makes them more similar to the meta_get_val functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-01 10:55:31 +01:00
Flavio Ceolin 417c18c974 tests: posis/fs: close only valid descriptor
Only call close() if open() has not returned a negative
value.

Fixes CID 211585

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-02-01 02:54:19 -05:00
Emil Gydesen e0f3524e3d tests: Bluetooth: CAP Commander Change Volume Offset unittests
Adds unittests for the CAP COmmander Change Volume Offset
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:35:17 -05:00
Emil Gydesen 8459560448 tests: bsim: Bluetooth: CAP Commander Change Volume Offset
Adds bsim test of the CAP Commander Change Volume Offset
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:35:17 -05:00
Emil Gydesen 029afad6c1 Bluetooth: CSIP: Add bt_csip_set_member_unregister
Add support for unregistering a CSIS as the CSIP set member.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:34:27 -05:00
Emil Gydesen 01d0f1a566 Bluetooth: PBP: Fix parsing and return issue with bt_pbp_parse_announcement
bt_pbp_parse_announcement was defined as uint8_t return value function,
but returned errno values, so it was modified to return an int instead.
The return values are also now more granular and documented.

The function also triggered a coverity issue with the way that it
parsed the data->data, as it would be marked as tainted. This should
be fixed by using the net_buf_simple API, which also improves on
some other parts of the code.

Finally the meta argument for the function was changed from an
unknown sized buffer, where the caller somehow had to know the
size of the metadata before calling the parsing function, to
an output pointer. This also omits the requirement for the
caller to always copy the metadata, where now it just
gets a pointer to the metadata in the bt_data struct. The application
can now always decide whether to continue to parse the metadata or
to copy it, using the pointer and the return value of the function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:33:56 -05:00
Anas Nashif 2dbd9e5ecf tests: dma: fix DT node label, avoid conflicts
Simple rename of node label from test_dma to tst_dma to avoid conflicts
and confusion about the test_ prefix when parsing test results in
twister.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-31 18:22:10 +01:00
Aleksander Wasaznik b6a10516b0 Bluetooth: Host: Remove bt_buf_get_cmd_complete
After the previous commit, this function no longer has any users.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-01-31 17:50:35 +01:00
Aleksander Wasaznik df5548dddb Bluetooth: Host: Remove overspecifying test for bt_buf_get_evt
The next commit will change the behavior of `bt_buf_get_evt` to no
longer use `bt_buf_get_cmd_complete`. We have to remove the test that
would prevent this.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-01-31 17:50:35 +01:00
Stine Åkredalen d5b68bad12 tests: Bluetooth: Mesh: add proxy solicitation bsim test
* Test that beacon is received after solicitation
* Test for replay attack

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
2024-01-31 10:34:06 -06:00
Daniel DeGrasse 3dbbb73319 drivers: display: ili9xxx: convert to MIPI DBI API
Convert ili9xxx display drivers to use MIPI DBI API. Due to the fact
this change requires a new devicetree structure for the display driver
to build, required devicetree changes are also included in this commit
for all boards and shields defining an instance of an ili9xxx display.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-31 16:01:45 +00:00
Armando Visconti 4828340b92 drivers/sensor: add support to LIS2DE12 accelerometer
The LIS2DE12 is an ultra-low-power high- performance three-axis
linear accelerometer belonging to the “femto” family with digital
I2C/SPI serial interface standard output.

This driver is based on stmemsc HAL i/f v2.3

https://www.st.com/en/datasheet/lis2de12.pdf

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-01-31 15:39:45 +01:00
Najumon B.A 62b2af70ba tests: lib: acpi: add fake x86 acpi function
add fake x86 acpi function and config macros for acpi unit test

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Najumon B.A 359e5839fe tests: lib: acpi: update test cases for dev and resource enum
update acpi test cases with device enumeration, mmio and irq
resources enumeration.

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Najumon B.A f3d3be5297 tests: remove pci bus compatible id dependency from overlay files
remove pci bus compatible id dependency from qemu platforms overlay
files for disk and ivshmem test apps. This already provided as part of
respecitve board dts files and hence no need to duplicate here.

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Łukasz Duda 5273af6ba8 net: ipv6: nbr: Add IPv6 reachability confirmation API
This commit introduces a new IPv6 API for positive reachability
confirmation, as specified in RFC 4861, Section 7.3.1. This feature aims
to enhance the effectiveness of the Neighbor Discovery mechanism, by
enabling upper-layer protocols to signal that the connection makes a
"forward progress".

The implementation within TCP serves as a reference. Compliance with
RFC 4861, especially Appendix E.1, was ensured by focusing on reliable
handshake and acknowledgment of new data transmissions.

Though initially integrated with TCP, the API is designed for broader
applicability. For example, it might be used by some UDP-based protocols
that can indicate two-way communication progress.

Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
2024-01-31 14:50:53 +01:00
Vinayak Kariappa Chettimada daf7c80c15 tests: bsim: Bluetooth: CAP broadcast AC testing updates
Update testing of the Audio Configurations from the BAP
spec using the CAP API.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-31 13:45:23 +01:00
Robert Lubos 5a08fea48e tests: net: dhcpv4_server: Add test to verify initialization
Add test that verifies that initialization fails if wrong arguments are
provided.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-31 12:06:23 +00:00
Gaetan Perrot c6c99245f6 posix: sched: Implement tests for set APIs for scheduling parameters
Implement tests for `sched_setparam()` and `sched_setscheduler()` .
Both functions are actually placeholders and just return `ENOSYS`
since Zephyr does not yet support processes or process scheduling.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-01-31 11:16:26 +01:00
Abhinav Srivastava 52485876f0 posix: Add tests for stropts
Add tests, Fix config issues, Re-add Timer

Signed-off-by: Abhinav Srivastava <atg271@gmail.com>
2024-01-31 09:05:50 +01:00
Jordan Yates 651ffb1d06 tests: build_all: modem: test compilation with connectivity
Ensure WiFi modems still build with the `CONNECTIVITY_WIFI_MGMT`
connectivity backend enabled.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-30 18:51:46 -05:00
Magdalena Pastula d7d254140d tests: lib: cpp: exclude nRF54L15
Exclude nRF54L15 from possible targets as its HAL
is incompatible with C++98.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Magdalena Pastula d8203d2e1f tests: drivers: add overlay files for nRF54L15
Add nRF54L15 overlay files for driver tests that need them.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Witold Lukasik cac2990c04 tests: arch: arm: arm: align tests to nRF54L15
Changed _ISR_OFFSET to be 28 as specified in OPS.
Removed console ISR.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Tom Burdick 34f39800cf llext: Extend test coverage
The platform key using arch + simulation better provides coverage of
unique architectures. Adds a testcase for writable module builds and
loading which was uncovered previously and would've led to a failure on
xtensa as xtensa currently requires writable storage.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-01-30 15:08:22 -05:00
Andriy Gelman c7dab3df08 drivers: can: Add xmc4xxx CAN support
Adds CAN drivers for XMC4xxx SoCs.

XMC4xxx has multiple CAN nodes. The nodes share a common clock and
a message object pool.

The CAN nodes do not have a loopback mode. Instead there is an
internal bus which can be used to exchange messages between
nodes on the SoC. For this reason tests/samples which rely on the
loopback feature have been disabled.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-01-30 19:06:06 +01:00
Adam Wojasinski 31af5f8fe1 tests: posix: Add test case for sysconf()
Adds test cases for sysconf() basic implementation.
Test case does not cover scenario where invalid value is passed
to the name argument of the function.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-30 18:01:18 +01:00
Wilfried Chauveau dfd758ea47 test: kernel: mem_protect: switch to an547 as the integration platform
AN521 does not have enough MPU region (8) to handle these tests.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-01-30 13:42:02 +01:00
Szymon Janc 8873c07847 tests: Bluetooth: Update Host Launch Studio Project and ICS
This updates host Launch Studio Project and ICS to TCRL 2023-1.

BLS file is deliberately left with Windows CRLF line terminators
since otherwise Launch Studio silently fails to import such
project.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-01-30 08:52:59 +01:00
Francois Ramu 70809cc429 tests: drivers: flash: common stm32 flash testing on nucleo_f767zi
Add the nucleo_f767zi target to the list of stm32 boards to
execute the tests/drivers/flash/common

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-01-29 14:12:47 -06:00
Alberto Escolar Piedras 084f3cfc51 tests/bsim build: User kconfig option to set warnings as errors
Use the kconfig option COMPILER_WARNINGS_AS_ERRORS instead
of passing the compiler option directly to the build.
That allows us to do whatever needs to be done in cmake to ensure
warnings are treated as errors.

Also handle better options and paths with spaces on them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-29 14:27:27 +01:00
Robert Lubos cefc391db3 net: dhcpv6: Move DHCPv6 files to lib directory
For consistency with DHCPv4.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-29 13:47:05 +01:00
Robert Lubos 19722aa8e8 net: dhcpv4: Move DHCPv4 files to lib directory
As discussed during DHCPv4 server integration, group DHCPv4 client files
with DHCPv4 server in a single lib directory.

Renamed internal "dhcpv4.h" header to "dhcpv4_internal.h" so that it's
not confused with the public "dhcpv4.h" header.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-29 13:47:05 +01:00
Krzysztof Chruściński fdafbdb1c9 tests: unit: util: Extend FOR_EACH test
Extend test to check also no arguments.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-29 11:32:54 +01:00
Fabio Baltieri 682f38fa36 tests: lib: devicetree devices: only run on native_sim
The test instantiate few vnd,i2c devices so it fails with boards with
devices that select I2C, as that causes i2c_test.c to be included with
the build that tries to redefine the same devices as well.

This is a library test anyway, so restricting to native_sim should be
good enough for it anyway.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-29 10:29:38 +01:00
Ryan McClelland 97efd21ce9 tests: drivers: regulator: add api test for active discharge
Add tests for active discharge apis not being implemented.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-29 09:43:39 +01:00
Robert Lubos 154e415c36 tests: net: dhcpv4_server: Add test suite for DHCPv4 server library
Add test suite covering DHCPv4 server library functionality.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-26 15:55:36 +00:00
Robert Lubos 9f1e1b4c60 tests: net: dhcpv4: Move DHCPv4 client tests to subdirectory
Move DHCPv4 client tests to subdirectory, to make room for DHCPv4 server
tests.

Rename test project to dhcpv4_client to better reflect its purpose.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-26 15:55:36 +00:00
Peter Mitsis 7d762050ba tests: smp_suspend: Add configurable delay
Adds a configurable delay to the test threads. It exists to keep
thread0 from hogging the scheduler's spin lock and giving threads
on another core a better chance to obtain that lock and not starve.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-26 15:55:27 +00:00
Henrik Brix Andersen 6237e0482b tests: drivers: can: api: add test for can_get_transceiver()
Add test for the can_get_transceiver() system call.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-26 14:27:57 +01:00
Henrik Brix Andersen 156c294c6f tests: drivers: can: api: verify operation mode changes
Verify changes in operation mode throughout the API tests using
can_get_mode().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-26 14:27:57 +01:00
Alberto Escolar Piedras c9a1c25dcb tests/net coap_client: Define _POSIX_C_SOURCE
This test uses functions and types which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras 4e869ad9f8 tests/bluetooth/uuid: Define required source standard macros
strnlen is not a C standard API, but an extension.
Instead of relaying that the SOURCE macro was set somewhere else
of that the C library provides a prototype anyhow
let's explicitly define it for this library.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras 10060c8891 tests/benchmarks/footprints: Define required source standard macros
strnlen is not a C standard API, but an extension.
Instead of relaying that the SOURCE macro was set somewhere else
of that the C library provides a prototype anyhow
let's explicitly define it for this library.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras 68c3a9ba46 tests modem/backends/tty: Define _XOPEN_SOURCE
This test uses functions which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
(Note this test is exclusive to native targets)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras f53cf8f54c tests/lib/c_lib: Set standard source macro appropriately
strnlen() and strtok_r() are tested in this files
which are extensions to the the
std C library. Let's explicity select one of the extensions
also when building with the host C library,
instead of relaying on somebody having
set it for this file somewhere else.

Also, let's be nice and undefine them first in case they had
been defined somewhere else in the build scripts.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Alberto Escolar Piedras d4967b086a tests rtc_api: Define _POSIX_C_SOURCE
This test uses functions which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Keith Packard 3cc4c5eb7a posix: Use _POSIX_C_SOURCE=200809L instead of 200809
This constant is supposed to be defined as a long instead of an int,
presumably to support systems where int isn't large enough.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-01-26 07:48:55 -05:00
Christopher Friedt e4b3df53dd tests: posix: pthread: identify thread ids of detached threads
Previously, the number 2 seemed to be somewhat magical. This
removes some of the mystery by labeling it.

So threads >= DETACH_THR_ID will be detached (we should not
attempt to join detached threads).

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt dbf7003162 tests: posix + libc: qemu_x86*: use dynamic stack size of 4096
For qemu_x86 and qemu_x86_64, it would seem that
heap-allocated thread stacks, as well as thread stacks
defined via K_THREAD_STACK_ARRAY_DEFINE(), must be at least
4096 bytes in size.

Using those sizes will ensure that these tests do not
fail with stack overflows or MMU faults.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt 77135fcbc6 posix: pthread: embed posix_thread_attr inside of posix_thread
Rather than shadowing most of the fields from pthread_attr_t
(struct posix_thread_attr) inside of struct posix_thread, just
embed the structure itself.

Additionally, use pthread_attr_init() to allocate a thread
stack and pthread_attr_destroy() to destroy a thread stack,
dramatically simplifying pthread_create().

A fair bit of rework was needed already to mitigate bitrot
issues in the testsuite. More should probably be done later.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt 5ca0f28bb2 tests: posix: common: dedicated config for static thread stacks
The testsuite has been shifted to use dynamic thread
stacks (either statically allocated via a pool, or
dynamically allocated via the heap).

However, we definitely still need coverage for manually
specified thread stacks - but lets avoid duplicating
tests unnecessarily.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt 5eb0bbeb54 tests: posix: pthread_attr: skip when large stack allocation fails
Rather than fail when attempting to set an extraordinarily large
pthread stack size (much larger than most Zephyr platforms have)
consider the test non-fatal and skip it.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Emil Gydesen 2b0e39dfa5 Bluetooth: Audio: Add bt_audio_codec unset functions
Add functions to unset, or remove, specific codec
LTV structure from codec_cfgs or codec_caps.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-26 09:43:30 +01:00
Magdalena Kasenberg 0d27dd5dd3 bluetooth: tester: Add support for CAP
Add support for CAP test cases.
Split btp_bap.c for better maintenance into unicast and broadcast.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2024-01-25 19:32:34 -05:00
Adam Wojasinski dfb6e5aa96 tests: posix: Add test cases for mq_notify()
Adds test cases testing following features:
- function error handling
- basic notification type
- thread notification type
- adding notification to non-empty queue

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-25 19:47:37 +01:00
Øyvind Rønningstad 223b4c372f tests: mgmt: Adapt to API changes in zcbor 0.8.0
zcbor_new_state and zcbor_tstr_put_term

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-25 15:09:16 +00:00
Alberto Escolar Piedras 571b647825 subsys/net/lib/lwm2m: Change how we seed the random generator
Instead of seeding the random generator from the test
itself calling into a host API, let's use the
entropy generator option to be seeded from /dev/urandom

This avoids trouble with the srandom() and time() calls
not existing depending on the chosen C library.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-25 12:28:51 +01:00
Keith Packard 4f40dd1f95 tests/strerror: Remove test for non-standard strerror_r function
Zephyr does not include this function under Rule A.4: C Standard Library
Usage Restrictions in Zephyr Kernel, hence a conforming C library need not
provide it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-01-25 12:07:19 +01:00
Bjarki Arge Andreasen 27b0d4e3fe modem: chat: remove receive and transmit timeouts
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.

Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Magdalena Kasenberg 62809d7581 bluetooth: tester: Enable BT_CTLR_ISOAL_PSN_IGNORE
Temporarily ignore the Tx ISO Data Packet Sequence Number use
as the tester app does not have yet a synchronization mechanism for
the sequence number and it constantly fails to send ISO data on time.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2024-01-25 09:04:02 +01:00
Alberto Escolar Piedras cf6a3824a0 tests/bsim host/privacy/peripheral: Minor fixes to allow equality check
Minor fixes in this test script to:
* Start with an empty flash even if there was a left over flash file
  on disk
* Not overwrite the simulation activity from the first part of the test
  in the second part of the test, to allow looking into the
  traffic and to allow rerunning the test in check mode, to ensure
  there is no radio activity changes when another change is done.
* Set the simulation id to something more unique (it was just
  "peripheral" before which is too easy to be repeated in another
  test)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-24 21:19:57 +00:00
Peter Mitsis 4c5a96ec65 tests: latency_measure: Configurable iterations
Updates the latency_measure benchmark to make the number of
iterations for which each test executes to be configurable.
This allows someone to make a tradeoff between accuracy
and execution time (can be useful for simulators).

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-24 21:48:56 +01:00
Hake Huang d744719eb8 test: dma: fix dma code-data_relocation failure on nxp rt platforms
NXP RT series DMA need use buffer in nocached area,
so only use memory region relocated is not enough.

fixing: #67053

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-01-24 17:07:29 +01:00
Talha Can Havadar 4ce0555d90 drivers: bmp581: Add BMP581 driver
This commit adds source and header files required for bmp581 I2C driver.
I have used bmp581_user.h to add more usage related definitions
but bmp581.h to add hardware related definitions.

Signed-off-by: Talha Can Havadar <havadartalha@gmail.com>
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-01-24 09:32:34 -05:00
Jonathan Rico 6fa5d1e6a5 Bluetooth: L2CAP: fix net buf frags handling
Fix the handling of buffers with fragments. What seems to have been
broken is the metadata reference that was not passed to the next frag in
the chain.

Add a test to regression too.

The main user of this is IPSP.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-24 14:56:16 +01:00
Guillaume Gautier 7228642c72 tests: drivers: adc: adc_api: boards: st: use different acquisition time
Use different acquisition time for a board (WB55) that has individual
sampling register, and for another (WBA52) that have two common registers.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-01-24 12:44:59 +00:00
Cong Nguyen Huu 97f8ce83ef tests: drivers: can: api: wrap the code belong to CAN FD mode
To avoid build warnings when building non CAN FD mode

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2024-01-24 12:28:00 +00:00
Cong Nguyen Huu cc9d0d1c12 tests: drivers: can: api: add testcase for testing CANXL non RX FIFO
Add testcase for testing CANXL non RX FIFO

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2024-01-24 12:28:00 +00:00
Luca Burelli 938d3547d0 llext: move current test to a hello_world subdir
In preparation for multiple tests, move the current hello_world test
to its own subdirectory. Also, merge the llext compilation in the
parent CMakeLists.txt.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-24 10:44:48 +01:00
Luca Burelli 92a5e3ace7 llext: rework testcases to share common config
This patch reworks the YAML files for the llext samples and tests to
share a common restriction list. Also, using an arch-specific config
to disable the MPU for the ARM architecture only, there is no need
to duplicate the test cases per architecture.

Use this to enable the "writable" test case for the ARM architecture
and separate the "modules_enabled" case to test building as a module.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-24 10:44:48 +01:00
Luca Burelli 5697d25901 llext: fix test Kconfig module conditions
Make it so LLEXT_TEST_HELLO is enabled by default, and it is actually
compiled only when the config is enabled.

The check for MODULES==y and LLEXT_TEST_HELLO!=m is redundant, as the
Twister machinery already causes an error when Kconfig flags specified
in the YAML file are coerced to different values.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-24 10:44:48 +01:00
Seppo Takalo ec3ec8cd2a net: lwm2m: Add LWM2M_ON_INIT() macro
Add macro that allows registration of initialization functions that
are called when LwM2M engine starts.

On LwM2M engine starts up, it first executes all initialization
functions in following priority order:
1. LWM2M_PRIO_ENGINE
2. LWM2M_PRIO_CORE, this is where all LwM2M core objects are initialized
3. LWM2M_PRIO_OBJ, this is where all other objects are initialized
4. LwM2M_PRIO_APP, application initialization.

Now on the initialization phase, we could rely that certain objects have
already been registered.
For example custom objects can register callbacks to core objects.
On application phase, we can initialize sensor objects and register
their callbacks because objects have already been initialized.

This LWM2M_ON_INIT() should replace all use of SYS_INIT()
with the default CONFIG_KERNEL_INIT_PRIORITY_DEFAULT.

Priority order is actually just alphabetical order of names, so
the order is set on a linkin phase, and we don't need any
runtime checking for it.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-01-24 10:44:28 +01:00
Vinayak Kariappa Chettimada d1e4c17e6d tests: bsim: Bluetooth: Mesh: Adjust timeout for Adv Extensions use
Adjust mesh test timing and timeout value for Advertising
Extensions use/fix in Zephyr Controller. The scanning in
Zephyr Controller is delayed when using extended scanning.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-24 10:44:12 +01:00
Bjarki Arge Andreasen 592647cf0b tests: flash: Add erase_blocks test for flash controllers
Add test suite which tests writing to and erasing all pages,
of any size defined by the page layout.

If the test is built with MCUBOOT, the test will jump into the
application, then run write/erase/boundary tests on the
bootload partition. If MCUBOOT is not selected, the test will
target the slot1 partition instead, performing the same tests.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-23 15:22:26 +00:00
Fabio Baltieri 1dd2307b3f input: gpio_qdec: add optical encoder support
Change the gpio_qdec driver to support optical encoders.

Add a property to use for defining an arbitrary number of GPIOs for the
sensing devices (typically infrared LEDs, but could also be the
biasing for the phototransistor), and one for adding a delay between
turning those on and reading the pin status.

The infrared LEDs typically consume a non negligible amount of power, so
there's also a new idle-poll-time-us property that enables two possible
modes of operation:

- if idle-poll-time-us is zero (default) the LEDs are enabled all the
  time and the driver enters polling mode using the GPIO interrupt as
  with mechanical encoders. This is usable for mains powered devices and
  has the lowest overhead on the CPU.

- if idle-poll-time-us is non zero, then the driver polls the encoder
  all the time, turning on the LEDs just before reading the state and
  shutting them off immediately after, but when the encoder is idle it
  switches the polling rate to idle-poll-time-us to save power, and only
  polls at sample-time-us when some movement is detected.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-23 09:45:57 -05:00
Yong Cong Sin 8cfff4b48f tests: devicetree: api: align DT_IRQN test
Not sure why the `DT_IRQN` tests are tabbed, fix that.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-23 06:48:16 -05:00
Yong Cong Sin 170c659292 tests: devicetree: api: test DT_IRQ_LEVEL and DT_INST_IRQ_LEVEL
Added new test for `DT_IRQ_LEVEL` and `DT_INST_IRQ_LEVEL`.

Introduced a new `vnd.cpu-intc` compatible so that we have a
root level interrupt controller that acts as level 1
aggregator, and modified `test_intc` to be level 2 aggregator,
updated test of `DT_IRQN(TEST_I2C_BUS)` accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-23 06:48:16 -05:00
Peter Mitsis 7c5a57b87b tests: latency_measure: Fix MPU fault
Fixes an MPU fault that was occurring on some ARM platforms when
executing the events portion of the latency_measure benchmark. The
fault was tracked to an attempt by a user thread to read an MMIO
register that it did not have permissions to access.

The solution was to move the printing of the stats averages out of
the test thread and into the main thread as the main thread always
executes at kernel/supervisor level and will always have permissions
to read that MMIO register.

Fixes #67438

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-23 10:02:46 +01:00
Anders Storrø 93a6ee501a Bluetooth: Mesh: Add artificial beacon delay
After removing 20ms in advertiser, all subnetwork beacons are sent as high
dense packet of frames with minimal distance between them. That might
cause collisions if beacon interval on devices will coincide.

This commit adds an artificial delay between each subnet advertsing
beacons.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2024-01-23 10:02:00 +01:00
Dawid Niedzwiecki ea630294d3 logging: add flag to skip source info
Add a flag to skip printing the source info.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-01-22 14:05:11 -05:00
Seppo Takalo f96c766fd8 tests: lwm2m: Rename engine to observation
"engine" directory contained tests for observation
so rename it.
There is separate "lwm2m_engine" directory that contains
tests for the engine itself.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-01-22 18:22:43 +01:00
Yong Cong Sin 8262766a0a tests: lib: devicetree: api: fix reg addr mismatch for test-mtd@ffeeddcc
Fix unit address and first address in 'reg' (0x0) don't match
for /test/test-mtd@ffeeddcc.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-22 15:49:53 +00:00
Henrik Brix Andersen 0875a752c1 tests: drivers: can: api: fix uninitialized variable warning.
Fix a warning about unitialized variable. The test will be skipped in this
code path.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-22 13:09:09 +01:00
Bjarki Arge Andreasen 140a510030 tests: build_all: modem: Remove net tag and clean up
Remove the net tag, allowing the modem driver tests to be built
for PRs, and limit the scope of the test suite to only build
for select emulated 32 and 64 bit boards.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-22 12:59:59 +01:00
Peter Mitsis 5573b20ec6 tests: latency_measure: tweak frdm_k64f config
The FRDM K64F board runs at 120 MHz and has a 24 bit timer.
According to its timer driver, its MAX_TICKS (which comes into
play for a tickless kernel) is calculated as ...
     CYC_PER_TICK = 120 MHz / ticks per second
     MAX_TICKS = (COUNTER_MAX / CYC_PER_TICK) - 1

To achieve a minimum value of MAX_TICKS=1, ticks per second must
be set to at least 15. Experimentation has shown that setting the
number of ticks per second below this threshhold on a tickless
kerenl leads to unreliable timestamps.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-22 12:59:45 +01:00
Peter Mitsis 070b07efc1 tests: latency_measure: Remove prj_user.conf
Moves the enablement of userspace from the project configuration
file to testcase.yaml.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-22 12:59:45 +01:00
Peter Mitsis d3a3d63afb tests: latency_measure: Increase verbosity of summary lines
Feedback from the previous summary line change has been that it
had become more difficult for people to parse and understand what
is being tested/benchmarked when the description consisted of
just using a terse tag. To improve the situation a more human
oriented description has been added to follow that tag so that
not only can tools still parse on the tag, but people can use
both tag and the extra description to understand the test/benchmark.

Summary lines for each test now consist of the following:
    1. A terse tag (for tools to parse)
    2. A more human oriented description.
    3. Number of cycles.
    4. Number of nanoseconds.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-22 12:59:45 +01:00
Emil Gydesen b857ef7f83 Bluetooth: BAP: Add ISO state callbacks
Add callbacks to the stream objects that reflects the
state of the isochronous channel. The connected callback
is called when the isochronous channel is connected, and
similarly the disconnected callback is called when it is
disconnected.

There is a special case for unicast, where if the ACL
disconnects first, then we won't get a ISO disconnect
callback. It should be assumed that the isochronous channel
is no longer valid when the BAP stream enters the idle state,
i.e. when the "released" callback is called.

The purpose of the new callbacks is to provide additional
information to the application. Especially the unicast client
can use this to determine when the stream_start function
can be called again, as there can only ever be 1 outstanding
CIS connection request at a time, but there can be multiple
GATT requests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-22 12:59:11 +01:00
Christopher Friedt 7f57d5d6eb tests: posix: timer: run tests for realtime as well
Ensure that the realtime clock may also be used with
timer_create().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-22 06:48:55 -05:00
Kamil Piszczek c16d9699a3 tests: bsim: bluetooth: host: gatt: general: improve conn ref handling
Improved the connection reference handling in the BabbleSim test
project in the Bluetooth Host category.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-01-22 10:32:41 +00:00
Christopher Friedt 0bed5dd459 tests: posix: semaphore: speed up named semaphore test
Reduce N_LOOPS from 999 to 32 by default and use a Kconfig
to encode it as CONFIG_TEST_SEM_N_LOOPS.

Running TESTSUITE semaphore
===============================================================
START - test_named_semaphore
 PASS - test_named_semaphore in 5.685 seconds
===============================================================
START - test_semaphore
 PASS - test_semaphore in 5.010 seconds
===============================================================
TESTSUITE semaphore succeeded

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-22 09:49:39 +00:00
Tomas Galbicka 554f2ba08e tests: mbox: Add test for mbox with data transfer
This commit adds extended test for mbox driver with
data transfer to verify correct mbox functionality.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-01-22 09:48:09 +00:00
Henrik Brix Andersen 3436c93387 drivers: can: remove run-time RTR filtering, add build-time RTR filter
A growing number of CAN controllers do not have support for individual RX
hardware filters based on the Remote Transmission Request (RTR) bit. This
leads to various work-arounds on the driver level mixing hardware and
software filtering.

As the use of RTR frames is discouraged by CAN in Automation (CiA) - and
not even supported by newer standards, e.g. CAN FD - this often leads to
unnecessary overhead, added complexity, and worst-case to non-portable
behavior between various CAN controller drivers.

Instead, move to a simpler approach where the ability to accept/reject RTR
frames is globally configured via Kconfig. By default, all incoming RTR
frames are rejected at the driver level, a setting which can be supported
in hardware by most in-tree CAN controllers drivers.

Legacy applications or protocol implementations, where RTR reception is
required, can now select CONFIG_CAN_ACCEPT_RTR to accept incoming RTR
frames matching added CAN filters. These applications or protocols will
need to distinguish between RTR and data frames in their respective CAN RX
frame handling routines.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-21 11:00:31 +01:00
Luca Burelli 0747cd3358 llext: define add_llext_target() for llext compilation
This patch defines a generic function that encapsulates all the
architecture-specific machinery needed to compile llexts from source
files. Current tests are updated to use this function.

Output and source files must be specified using the OUTPUT and SOURCES
arguments. Only one source file is currently supported.

Arch-specific flags will be added automatically. The C_FLAGS argument
can be used to pass additional compiler flags to the compilation of
the source file.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-21 10:59:49 +01:00
Jai Arora ba7b7ffff2 posix: Adds test to check getpid() is not NULL
Adds test to check getpid() function is not NULL

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
2024-01-20 12:41:28 +01:00
Jai Arora b103dece67 posix: Adds test for clock_getcpuclockid()
Adds test for clock_getcpuclockid() to
make sure clock_id is equal to CLOCK_PROCESS_CPUTIME_ID
after a successful call

Fixes #59954

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
2024-01-20 12:41:28 +01:00
Martin Kiepfer 5a3f53551f drivers: display: gc9a01a: Add support for SPI display controller gc9a01a
Adding driver for GC9A01A 240x240 based LCD displays.
Should be working with GC9C01 as well (untested).

Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
2024-01-20 12:40:15 +01:00
Christopher Friedt 18c23dec5f tests: posix: common: free resource in after() for timer suite
Create a separate ZTEST_SUITE() to properly manage resources
that are shared between test cases. Add some assertions where
they were missing.

Additionally, we don't need verbose printing in this testsuite,
so change `printk()` to `LOG_DBG()`

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-19 13:14:56 -05:00
Peter Mitsis d8108369bc tests: smp_suspend: Tweak duration and timeouts
Reduces the number of seconds that the test runs to 15 seconds
(down from 30 seconds). This should still be sufficient time
to determine if there is anything amiss with the synchonous
thread suspend/resume. Furthermore, the test itself has been
tagged as being slow and its timeout increased to 10 minutes
(600 seconds) as some simulators are rather slow.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-19 12:13:30 -05:00
Fabio Baltieri 5f989e4378 input: add a keymap driver
Add a "input-keymap" driver to translate keyboard matrix event into key
events.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-19 15:14:25 +00:00
TOKITA Hiroshi 3578a9e646 tests: drivers: display: add read() and write() test
Add test for `display_read()` and `display_write()` api.

Note: The CI environment has no display device, which makes it fail
the tests. So, I make this test case `build_only`. But it can run in
a display device available environment.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-01-19 15:13:25 +00:00
Kamil Piszczek a369eb7b36 tests: bsim: bluetooth: host: gatt: add authorization callback API test
Added a new BabbleSim test that validates the authorization callback API
from the Bluetooth GATT header.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-01-19 16:08:46 +01:00
Balthazar Deliers bea34c599d drivers: sensor: Aosong AGS10 TVOC sensor
Added support for Aosong AGS10 TVOC sensor

Signed-off-by: Balthazar Deliers <bdeliers@bdeliers.com>
2024-01-19 06:06:02 -06:00
Krzysztof Chruściński 3cdce5b1de tests: drivers: uart: Adapt nrfx_uarte test configuration
Adapt configuration after changing the default setting for
CONFIG_UART_NRFX_UARTE_LEGACY_SHIM.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-19 13:04:07 +01:00
Pavel Vasilyev 981c79b7ce Bluetooth: Mesh: Drop explicit support for Bluetooth Mesh 1.0.1
Bluetooth Mesh Protocol 1.1 is backward compatible with Bluetooth Mesh
Profile 1.0.1, therefore the stack can still be qualified for 1.0.1 if
needed. But explicit support for both versions requires additional
maintenance efforts and doubles the CI time. To make the stack
qualifiable for 1.0.1, the one needs to remove Private Beacons reception
and compile out SHA256 algorithm support.

What is changed:
- Removed `CONFIG_BT_MESH_V1d1` option.
- Removed `transport_legacy.c` which was using 1.0.1 implementation. The
  new transport layer has new SaR logic that should still be possible to
  qualify for 1.0.1.
- Removed the legacy transport Kconfig options. They are superseded by
  the new transport Kconfig options.
- Tester app: `overlay-mesh-v1d1.conf` is merged into
  `overlay-mesh.conf`.
- Removed BabbleSim tests for 1.0.1.
- Updated documentation.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Andrej Butok a019cc2c9f test: mcuboot: enable test on lpc55s platforms
Enable mcuboot test for lpcxpresso55s06/16/28/36/69 boards.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-01-19 10:33:44 +01:00