Several tests were using K_FOREVER when allocating the
buffer for TX in the system workqueue, which is illegal behavior.
The solution chosen was to create a TX thread to handle TX,
similar to the solution used in the audio shell and some
sample applications.
This way we can continue to use K_FOREVER when allocting buffers
and it will always be done in a round-robin fashion while
TXing as much as possible, by always enqueuing all the buffers
with mock data.
Since this works for all streams (both broadcast and unicast),
it was obvious to use the same implementation for all tests,
and thus cleaning up the tests a bit and more them more similar.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some bluetooth host tests can be run on nrf5340bsim/nrf5340/cpunet.
This commit enables building and running these tests.
Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Currently different test cases within the same folder are using largely the
same config files with only subtle variations. It is better instead to have
a base config file with general configuration, aided by overlay files for
specific cases.
Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Bluetooth host bsim tests are compiled with shell scripts, but it is
possible to use twister, which supports compilation (but not running
at the moment). Compiling with twister requires fewer shell scripts,
provides cleaner interface and more flexible configuration.
Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
These callbacks are trigger for changes that affect the entire
broadcast sink, such as the BIG synced and terminated events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This reverts commit 18119e8f6e.
Audio tests are enabled back, but change to random number
seed is retained for the multiple identity test.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove a duplicated advertising set in the CAP acceptor babblesim
test. The advertising set is configured in test_start_adv.
The BSIM test for the CAP acceptor used legacy instead
of extended advertising.
This also adds the required advertising data and validation
on the CAP initiator and CAP commander.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
So when building with twister we get the same executable name
as with compile.sh
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This test was starting to rot: BOARD should have been replaced
with BOARD_TS. Let's also remove a few duplicate checks
and definitions.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Default the Minimum encryption key size to 16.
Key with reduced size is easier to brut force.
Disable LE legacy pairing by default since it's not secure.
These defaults should suite majority of newly developed applications.
It's better to use sensible more secure defaults,
so applications that really need less secure option consciously change it,
not the other way around.
This may help to prevent downgrade attacks.
Signed-off-by: Sergey Korotkov <sergey.korotkov@nordicsemi.no>
Deprecate BT_CTLR, and add a new HAS_BT_CTLR as a virtual option which
specific users (like BT_LL_SW_SPLIT) select. This also means that we can
remove all places that were forcefully enabling the BT_CTLR option, and
instead we now depend on devicetree to get some local LL HCI driver
enabled which in turn also enables the HAS_BT_CTLR option.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Removed implying of NVS by the NET_L2_OPENTHREAD, and from now a
platform can choose between ZMS and NVS as a settings backend.
NET_L2_OPENTHREAD still requires NVS or ZMS backend so the config
depends on one of those.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
This adds a test that checks that the Subnet Bridge behaves correctly
when one or more of the involved subnets are undergoing the Key Refresh
Procedure.
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
This introduces a global variable controlling the number of remote nodes
used in a given test case. This allows removal of the `TEST_TYPE_...`
enums and further tests in the future that can use different remote node
counts.
This also cleans up the test source by extracting common tester
initialization to separate functions, avoiding repetition.
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
This commit comments out some test AC cases that are failing in bsim.
These will be investigated in PR #82199.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit fixes
tests/bsim/bluetooth/ll/multiple_id/tests_scripts/multiple.sh.
The reason is that this test seems to depend on random number
sequence in order to have the proper scheduling.
It also fixes some AC tests by commenting out failing test
cases. The reason of the failure is still unknown and needs
to be investigated in future work.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Increase the number of key slots in the PSA Crypto core
for some tests using more keys than the default (16).
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Since the TinyCrypt library is being deprecated in Zephyr, this
commit set TinyCrypt usage in BT mesh as deprecated and it sets
Mbed TLS PSA Crypto API as the default option (when TF-M is not
available).
Tests are also updated in this commit.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit sets PSA Crypto API as the default library to perform
ECC-DH in HCI, replacing TinyCrypt (which is being deprecated).
Therefore the symbol BT_TINYCRYPT_ECC is renamed as BT_SEND_ECC_EMULATION.
References in samples/tests are also fixed.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
CONFIG_BT_USE_PSA_API was used in BT crypto/host modules to select
PSA crypto API over TinyCrypt (which was the default until now).
Since TinyCrypt is being deprecated and PSA crypto API is the new
standard library for crypto operations, CONFIG_BT_USE_PSA_API is
no more needed.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Because the number of ACL RX buffers must be at least the number of
maximum connections plus one, increasing `CONFIG_BT_MAX_CONN` could
inadvertently lead to a build failure if the number of ACL RX buffers is
not also increased. This dependency may not be obvious to users.
To address this issue, this commit deprecates the
`CONFIG_BT_BUF_RX_COUNT` Kconfig symbol and computes the value in
`buf.h` using the new `BT_BUF_RX_COUNT` define. Note that the default
value and the minimum range value have been changed to 0 to "disable"
the option.
Additionally, to allow users to increase the number of ACL RX buffers,
this commit introduces the new `CONFIG_BT_BUF_RX_COUNT_EXTRA` Kconfig
symbol. The value of this symbol will be added to the computed value of
`BT_BUF_RX_COUNT`.
The configurations of tests and samples have been updated to reflect
these changes.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Enable some high reliability CAP tests by increasing ISO Tx
buffer counts in the Controller to sufficiently generate
number of complete when multiple SDUs are transmitted in
single ISO interval with use of pre-transmissions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Adding new CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT to select the number
of key slots in PSA Crypto core. The default value is 16. Be aware
that key slots consume RAM memory even if unused, so the proper value
should be a compromise between the number of slots required by
the application and the available RAM in the system.
This commit also:
- updates tests/crypto/secp256r1/mbedtls.conf to showcase how to
use this new symbol to reduce RAM footprint.
- tests/bsim/bluetooth/mesh/overlay_psa.conf to support all the
keys used in the test.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Reducing the heap requirement for the hci_ipc sample from
8KiB to 4KiB. It has been tested in various configurations to
work with 2300, but 4KiB was used to provide some leeway for
future updates.
The heap requirement is not documented, and it is unclear why
values lower than 2300 (not exact number) won't boot, and should
be investigated further.
Memory has become a very scarce resource for especially the ISO
builds for the nRF5340, which is why this is getting reduced.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix some test simulation length be greater than wait time.
These tests completed within 12 seconds, 15 second wait
time is a good value with included margin and a 20 second
simulation time.
These tests failed on this PR CI.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
To increase coverage.
Note that we call twister separatedly for this target, due to the 54l15
overlays using UARTE20 which is indexed in simulation as "2", but as
the nrf52833 does not have 3 instances. So "-uart2_loopback" is not
a valid option for a 52833 executable.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit changes the BSIM tests to use the same recv callback
for all tests. The purpose of this is to reduce code duplication
and make it easier to maintain the tests.
This also changes the recv_cb so that in case of any error we log
the most recently received SDU, which should provide more
information about why a test failed in case of RX error.
PBP had to be updated a bit to support the audio_stream
struct.
Also modifies a check and log in bap_stream that was less than
helpful to determine if it was the stream or the endpoint that
was NULL.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds two new tests for the Subnet Bridge feature, testing group and
virtual addresses as destinations. The tests are based on the existing
`brg_simple.sh` test, with the addition of a new node and a new subnet
to make sure that messages are bridged to multiple subnets, but only
subnets that have a corresponding entry in the bridging table.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Renames `bt_mesh_test_send_ra` to `bt_mesh_test_send_data` and changes
the corresponding callback funciton as it is used outside of the replay
attack tests, and can be used to send custom data. The function is
extended to accept a UUID parameter to allow sending data to virtual
addresses.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Change the select of BT_PER_ADV_SYNC and BT_EXT_ADV to
depends on. This is an effort to reduce the use of
select for Kconfig options.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BAP Kconfigs option now depends on
BT_ISO_BROADCASTER instead of selecting it.
This is an effort to reduce the use of select in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BAP_BROADCAST_SOURCE Kconfig option now depends on
BT_ISO_BROADCASTER instead of selecting it.
This is an effort to reduce the use of select in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the Kconfig options to depend on the GATT
features rather than selecting them.
This is part of an effort to reduce the amount of
selects we use in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The main problem of MBEDTLS_PSA_CRYPTO_LEGACY_RNG is that it
brings in some legacy modules (entropy + ctr_drbg/hmac_drbg)
which means extra ROM/RAM footprint.
MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG instead simply calls to the
CSPRNG which makes it definitely smaller.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
The tests were using the default of 1 which is very low,
especially when we might have multiple RX streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The alloc_buf callback is not used when `seg_recv` is set, so it is
never called in this test. Remove it.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Increase the EXECUTION_TIMEOUT (real time timeout at which the test
will be killed), so we have more margin for CI.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Increase the EXECUTION_TIMEOUT (real time timeout at which the test
will be killed), so we have more margin for CI.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Increase the EXECUTION_TIMEOUT (real time timeout at which the test
will be killed), so we have more margin for CI.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>