Due to recent changes, as simple k_yield() is not enough on some
platforms (nRF platforms for example), as the entropy subsystem is now
used because of PE, which may block, causing context switch before
entire RA message is processed.
Fix this by adding small delay before checking if RA was processed
properly.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Exclude some more platforms from the tests.
They provoke devicetree-related build errors which weren't introduced
by the changes in this PR (#71947).
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
As part of ongoing work to move away from TinyCrypt and towards PSA
(#43712), make fs_mgmt use either PSA (when available) or MbedTLS
(as a fallback) for SHA-256.
The use of PSA is guarded by CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT
which requires a locally-built PSA core for devices without TF-M.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Make `bt_hci_cmd_send_sync` return `-EACCES` when receiving
`BT_HCI_ERR_CMD_DISALLOWED`.
Update some tests that were expecting `-EIO` when
getting `BT_HCI_ERR_CMD_DISALLOWED`.
Add a warning in `set_random_address` when getting that new error. This
is done in case someone try to set a new random address while legacy
advertising, scanning or initiating is enabled. This is illegal behavior
according to the Core Spec (see Vol 4, Part E 7.8.4).
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Derive BT_CTLR_ISO_TX_BUFFER_SIZE from BT_ISO_TX_MTU to have
optimal Controller memory allocations.
BT_CTLR_ISO_TX_BUFFER_SIZE can be set lower than
BT_ISO_TX_MTU in which case upper layer can send fragmented
SDU to the Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
`rtio_sqe_prep_write()` and `rtio_sqe_prep_read()` memset the sqe
struct to zeroes, clearing any configuration previously set. This
commit changes this sequence in the test, such that the sqe's are
prepared, then additional flags/configs applied.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Add overlay and conf for emulated boards allowing the test suite
along with the emulated GNSS driver to be built and tested by CI.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Add GNSS API test suite validating the behavior of a GNSS
device adheres to the GNSS API.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Add overaly files for Application and Radio cores.
Configure test according to watchdog features
available on nRF54H20.
Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
Add a case, testing building an llext from multiple files, calling
functions and accessing data across files.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
CONFIG_MINIMAL_LIBC was required for:
- CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS
- CONFIG_MINIMAL_LIBC_RAND
while CONFIG_ENTROPY_GENERATOR and CONFIG_MBEDTLS_ZEPHYR_ENTROPY
are required for CRYPTO_C.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Remove dependency on netif for net.tls_credentials.trusted_tfm
in order to have the test fully built and executed in at least
1 platform (i.e. mps2/an521/cpu0/ns)
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
When building ISO applications on a device that has the host
and controller on the same core, the application developer
shouldn't have to set controller specific configurations.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
With the previous changes, usb_set_config() is no longer called by
default at boot time, causing the test to fail.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
In 972a4d9f6f
the test was relaxed to allow a possible parallel thread
waking the CPU during the idle timeout checks.
How this was done though, a system timer driver
which wakes the kernel spuriously a bit before the
correct deadline would not be detected, even
though it should.
Let's fix this, ensuring the timer has been
called when we check the wake time in inside the
expected range.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The b_u585i_iot02a platform already has an 'eeprom0' node in the default
devicetree. Delete the default node so that the overlay can define the
nodes needed for the test.
Signed-off-by: Bram Vlerick <bram.vlerick@openpixelsystems.org>
Adds test for timeout script chat command, which is a script
chat command where only the timeout parameter is set. The
script will simply wait for the timeout duration, then move
on to the next script chat.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
This sets the number of arguments for SMF_CREATE_STATE() to always
be the same, independent of the selected Kconfig options.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The `BT_DEBUG_*` Kconfig symbols have been deprecated for more than 2
versions, remove them.
Update code that was still using them.
Remove the Bluetooth specific `Kconfig.template.log_config_bt` and use
`Kconfig.template.log_config_inherit` from the logging subsystem
instead, now that the legacy symbols can be removed.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Add the CAP commander reception start procedure which starts reception
on one or more CAP acceptors
With the implementation of broadcast reception start procedure we also need
some mockups for unit testing
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
There needs to be at least one network interface in order
to avoid this error.
E: There is no network interface to work with!
So enable loopback support which creates a loopback interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure the IPv6 source address selection works as expected
when using the IPV6_ADDR_PREFERENCES socket option.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit introduces a new test case for veryfing that addition and
deletion of multicast routing entries emit MLDv2 reports when needed
and if multicast routing entries are appended to MLDv2 records properly.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
Add support for VPR CLIC to `nested_irq` kernel test.
Verified on nRF54L15 FLPR for now.
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
`CONFIG_RISCV_RESERVED_IRQ_ISR_TABLES_OFFSET` offsets IRQ in
vector table, align test to this functionality.
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
One should not call a function directly from within zassert()
as it can cause the value of errno to be lost as seen by this
failed test output
Assertion failed at tests/net/socket/reuseaddr_reuseport/src/main.c:151:
test_bind_success: (zsock_bind(sock, addr, addrlen) not equal to 0)
bind() failed with error 0
FAIL - test_ipv4_udp_bad_both_not_set in 0.000 seconds
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When calling bap_broadcast_assistant add_pa_sync, it should only
set the BIS index field as optional parameters and not to whatever
is in the BASE.
If setting BIS index which the BASE does not support, then the
command should be rejected.
This PR fixes https://github.com/zephyrproject-rtos/zephyr/issues/70835
Signed-off-by: Ping Wang <pinw@demant.com>
The commit adds support for LESC in the host if the controller
does not support the public key generation for ECDH.
Signed-off-by: Ping Wang <pinw@demant.com>
Spell checking tools do not recognize "iff", replace with "if and only if".
See https://en.wikipedia.org/wiki/If_and_only_if
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Refactor som CAP commander test functions to perform operations
in parallel, rather than sequential.
The CAP initiator functions are kept sequential so that we are
testing both versions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix the failures introduced in #72078 by manually enabling all the
hash algorithms as they used to be.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
update test case with sys_clock_hw_cycles_per_sec() api to retrieve
system clock frequency (HW cycle per sec) at runtime or statically
Signed-off-by: Najumon B.A <najumon.ba@intel.com>
Adds test coverage for the case where the host starts the
scanner automatically upon sync creation.
This test covers there bug where we previously did not start
scanning on Coded PHY.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
We didn't have test coverage for the scenario where the host
starts scanning automatically.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
The test uses DT_CHILD_NUM and DT_INST_CHILD_NUM to get the number of
child nodes of a given node from generated macro.
The test uses DT_CHILD_NUM_STATUS_OKAY and DT_INST_CHILD_NUM_STATUS_OKAY
to get the number of child nodes of a given node which children's status
are "okay" from generated macro.
Signed-off-by: Swift Tian <swift.tian@ambiq.com>
Checks the behavior of configuration of channels mask for LoRaWAN.
Are passed wrong masks sizes as argument, NULL pointer instead channels
mask buffer and the right case to validate the expected returns.
Signed-off-by: Jeferson Fernando <jeferson.santos@edge.ufal.br>
Adds a test to verify that a series of k_thread_abort() issued from
ISRs do not cause a deadlock.
Filtered on x86 as the x86_64 irq_offload() implementation isn't
SMP-safe. See #72172
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
There's a easily-tripped-upon free memory write condition in the arch
layers where they will write to a cached _current pointer after that
thread has been aborted. Detect this by clobbering the thread data
after the return from k_thread_abort() and validating that it's still
clear after the ISR returns.
Note that the clobbering of the thread struct requires the removal of
a k_thread_join() that (obviously) requires that it see a DEAD flag
set. Joining aborted threads isn't actually legal, but does still
work as long as app code doesn't reuse the memory. Basically we can't
test both cases here, and we have join coverage elsewhere already.
Signed-off-by: Andy Ross <andyross@google.com>
A scheduler fix for free memory usage on aborted threads is now using
a per-CPU dummy thread instead of a single stack-based one at startup.
These static thread objects need spots in the kobj bitmasks, and a few
tests are sitting right at the default limit (16 threads).
Signed-off-by: Andy Ross <andyross@google.com>
The unit test allows to test the frag decoder algorithms using random
binary data.
The coded fragments are created on the fly using the encoder algorithm
described by Semtech in the LoRaWAN TS004-1.0.0 document.
Signed-off-by: Martin Jäger <martin@libre.solar>
This implemnets OTS service and provides OTS instance with two objects
for behavior valid and invalid test cases. Service implementation is
inspired by peripheral_ots sample.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Fix sim_length value for central_hr_peripheral_hr so that
the simulation does not end while the test is still in
progress.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Notes that `NUM_VA_ARGS_LESS_1` support up to 64 arguments,
and added test for it in `tests/lib/sys_util`.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This macro count the number of arguments in the variable
arguments list.
Added test for it in `tests/lib/sys_util`.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit updates models metadata API to simplify the usage and
removes the metadata pointer in health server model context.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Reduce the iterations in multiple id multiple simultaneous
connections test, and tune the buffer counts to catch any
buffer leak related regressions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add tests for the "device list" output with the various configuration of
device power management.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add device driver for TI TMP114 I2C temperature sensor.
The driver only support basic functionality, i.e. fetch temperature
using default values.
Datasheet:
https://www.ti.com/lit/ds/symlink/tmp114.pdf
Signed-off-by: Fredrik Gihl <fgihl@hotmail.com>
When in the BAP unicast server role, at least PAC sink
or PAC source shall be set.
In order to fulfill this new requirement, a few other Kconfig
options had to be changed to a `depends on` from `select` to
avoid recursive Kconfig requirements. This change may require
some applications to update their configurations according
to the migration guide.
The change from `select` to `depends on` is ideal anyhow
as that is the recommended way to add dependencies.
This can checked via the combined BT_PACS Kconfig value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Delete tests that did not end up bringing any value.
What ended up happening is busy-work to "make the test pass" without
understanding what's their original purpose.
Worse, the CI change-based testing is broken and doesn't pick them up,
even by PRs modifying the tests themeselves.
See #68008
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Disable the quadspi mpu region of the nucleo_f756zg (like done on
nucleo_f746zg) when testing the samples/userspace/shared_mem
or tests/kernel/mem_protect/userspace
The stm32f7 cortex M7 has 8 MPU regions and the one for quadspi prevents
the testcase to PASS.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Tests for HTTP server support.
Signed-off-by: Emna Rekik <emna.rekik007@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When building ISO applications on a device that has the host
and controller on the same core, the application developer
shouldn't have to set controller specific configurations.
Without this change the samples iso_receive and iso_broadcast
will fail to run on NRF52 series devices as the samples
try to set up two streams but the controller is configured
to support only one.
Controller unit tests that were previously only enabling the
controller specific ISO configurations now also enable the
top-level ISO configurations to ensure that the default
stream count is properly configured.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This testsuite requires an external I2C RAM connected to the I2C bus.
Adding details to provide guidance to users interested in running the
suite.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
The function writes random data to the provided buffer. Maximum
permitted buffer size is 256 bytes. On success the function returns 0,
otherwise it returns -1 and sets errno to appropriate value.
Signed-off-by: Patryk Duda <patrykd@google.com>
Add USB out support for the BAP shell, so that decoded LC3
data can be sent to the host (e.g. a PC).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add tests to ensure that the aio.h header exists, the
structures are declared, and that the functions are present.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Test that the Host give back the correct error when we try to set too
big advertising data. And ensure that long advertising data are
correctly transmitted.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
In most cases these were defined as 1. Saving one byte for the rest
doesn't really justify the added complexity that comes with these
options. Removing them also simplifies the interface between HCI
transports/drivers and the host stack, which in turn helps pave the way
for having HCI as a proper Zephyr driver API.
Fixes#71907
Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
Commit adds using host\controller based random number
generator instead of zephyr driver.
No mesh dependency anymore on zephyr system
random driver.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
We can (and do) open multiple channels with a single L2CAP command. If the
remote doesn't support dynamic channels at all, then it sends back a
REJECT_RSP.
We only destroyed the first channel that matched the command PDU
identifier. Fix that and remove all channels that match.
Also add a test that verifies the patch.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Implement `DT_INST_NODE_HAS_COMPAT` to check if a node has a
compatible. This is helpful when a node has more than one
compatible, which can be used to enable additional features
in the driver.
Updated the devicetree test to play with the new API.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>