These tests take relatively long to run.
The runtime timeout (CI safety timeout) is too short.
Increase it so it does not fail at random in CI.
The only penalty of increasing this timeout, is that
if one of these tests actually hangs, we will not detect it
until the timeout expires, wasting a bit of CI time.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Now that the nrf52 HW models support it,
let's use their flash model instead of falling back
to the openthread RAM settings backend.
Note that the flash model defaults to just keeping the
flash content in the Linux process heap.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Modify the BT_UUID_XX_ENCODE and BT_LE_SUPP_FEAT_XX_ENCODE
macros to use the SYS_ENCODE_LEXX macros, instead of re-inventing
the encoding.
Also apply the macros for several other places.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Test script clean up related to common code moved in
commit add1397e4a ("tests/bsim/bluetooth: Tests scripts
refactor").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add BabbleSim test to verify creation of peripheral multiple
CIS in a CIG, connect ACL to one peripherals and create nine
CIS to that peripheral device.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add BabbleSim test to verify creation of Central multiple
CIS in a CIG, connect ACL to three peripherals in a group
in the timeline and create CIS to each peripheral.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add BabbleSim test to verify creation of Central multiple
CIS in a CIG, connect ACL to nine peripherals and create
CIS to each peripheral.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use BT_CONN_TX_USER_DATA_SIZE when defining pools of buffers that will go
through `bt_conn_send_cb()`.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
BLE Mesh stack has been designed to work in non-preemtible
environment. The PR fixes running bsim mesh test from main thread
that is preemptible. Running mesh tests causes reentering in the
same mesh functionality twice and rewriting ongoing data.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Some samples, tests got missed in the switch from void main() to
int main(). Cleanup those samples/tests to use int main().
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
These variables are now provided by the FindBabbleSim
cmake module, which finds them in the environment or thru
west.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Let the board check for it instead, as it now does it
smarter and can try to find it using west if it was
fetched with the Zephyr manifest.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
For the second test (test_2):
Build the DUT image without BT_CENTRAL.
The Softdevice Controller uses different memory pools for the central &
peripheral roles. In the configuration where BT_CENTRAL=y, BT_PERIPHERAL=y
and BT_MAX_CONN=2, the SDC will only have room for one central and one
peripheral role.
The test then won't pass as it expects the controller to have room for two
peripheral connections, and the SDC ends up with only one.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
When running with the Softdevice Controller, the controller's scheduling
results in missing all of the advertising packets.
This only happens with this particular configuration (scan & adv params,
multirole device).
Use a smaller scan window & interval to work around that (test IUT is not
controller implementation, rather the host).
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Since the test didn't get deleted after #55976 as expected, use
backchannels to sync both sides instead of finicky sleeps.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The API doesn't allow the stack to make any guarantees about the number of
available buffers that the app has.
Only send 1 credit at a time, as that is the only guarantee the stack can
give to the peer.
We can send MTU/MPS's worth of credits once we have acquired an SDU buffer
from the application (that is, on the first PDU of the SDU). Though we
still have to cap that to the buffer size we have just acquired.
------
The testcase added here shows a scenario where the relationship
between the number of credits and the number of available buffers does not
hold true any more:
In this test, the app only has one buffer in its pool.
The central will queue SDUs that are bigger than the stack's
buffers (so the user allocator is necessary) but lower than the
channel's MTU.
The device receiving the SDU keeps a reference to the buffer before
returning from the `recv` callback. It releases that reference after a
small delay.
The central will still have credits, so it will queue another SDU, but the
peripheral will not be able to receive the next SDU (as the allocator will
fail) and will close the channel.
To see the test fail, just revert the `l2cap.{c,h}` changes.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Running with a higher SDU length makes the devices get stuck at the start
of the transfer. To be fixed by next commits.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
- move all the context for a channel in its own custom struct
- allow -EAGAIN when sending, try sending again later
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This test verifies the l2cap MPS workaround: when the other
side (non-zephyr host) sends PDUs that are < MPS.
The DUT is a host, while the Tester is a thin layer over the controller,
allowing fine control over l2cap packet contents.
Note that this test fails as-is. It is fixed by the next commits in the PR.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Tests if BLOB Client running on Friend Node can execute BLOB Transfer
with multiple LPNs running BLOB Server.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
This allows to establish friendship in othem tests outside of friendship
ones using same callbacks. This allows to avoid code duplication for
other tests that require friendship.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
This test ensures the data from a charachteristic read callback is not
truncated anywhere. This test illuminates an existing failure, so it's
failing in this commit. The fix is in the same PR.
The test comes with an experimental "library" with easy-to-use
wrappers/utilities for Bluetooth API. The library starts its life in the
directory of the test, but it will be moved outwards when more tests
start using it. It is designed to not interfere with other users of the
Bluetooth API. The library does work just as well on real hardware,
outside of BabbleSim, so it can be used for target tests and
proof-of-concept applications.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
msg_mesh bsim test is run in almost all configurations.
The test uses manual polling with hardcoded delays. This PR removes
manual polling to fully relay to mesh friendship implementation
in the aspect of time management. Also, it adds different xmit settings
for the third (not in the friendship) device to avoid collisions.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
For users convenience, as it is a typical usecase to
want to see the actual coverage of a set of tests.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
And add an again an extra file for the top level.
(It was removed when the CI workflows for network and BT
were split, but the common script is still usefull).
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
There was a check that checked if a stream was NULL, but the
value compared to NULL was an address of (&) which can never be
NULL. Check is removed.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This tests if SAR RX/TX configuaration is saved in and loaded from
persistent storage correctly.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Commit adds experimental support mbedtls psa as crypto
backend for ble mesh. It were run only on bsim tests.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Commit gets rid of host dependency to generate DH key.
Mesh uses its own function for it that has synchronous
behavior and correct endianism. It simplifies the provisioning
state machine since it doesn't require waiting for the host HCI
handler.
Also, it removes hidden cross-dependency between BLE Mesh and
SMP in the aspect of competition for the same DH key
(https://github.com/zephyrproject-rtos/zephyr/issues/23292)
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Two minor fixes:
* The wait time mention in the description was wrong.
* The possible argument passed to the scripts is meant to target the
phy itself, but it was sent to the channel library.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Test scripts need to have executable permissions.
Otherwise, run_parallel will change the mode in CI,
and users need to set them locally which results
in a not clean git workspace.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Fixes two problems:
1. bad argument type, leading to wrong test vector values
2. The central side was not verifying the type of the scan report. When
running with a different controller, it was then too quick to stop the
scanner, before the peripheral had received a scan request.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The EDTT bridge use was removed in e20862f0e8
Now the EDTT bsim transport connects directly to the simulated
devices.
So let's change the code and comments accordingly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
These tests stop BLOB Transfer after BLOB Server reaches every phase
by rebooting devices. After restart, Server recovers transfer and client
continues to the next one. On second pass, Server stops after first
block completes and suspends itself, and after reboot continues to
completion.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Add a new BabbleSim test that run the encrypted advertising sample and
check that the exchanged key material and data are correct.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
These changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Signed-off-by: Keith Packard <keithp@keithp.com>
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>
Test that if all targets are lost because of failing each DFU Transfer
step `target_lost` callback is called on every one, and `end` callback
is called as procedure aborts.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
-- Unit test to check that the correct payload number is selected based
on the SDU packet number and the time stamp when fragmenting SDUs
into PDUs.
-- Ran clang-format on isoal_test_tx and isoal_test_rx
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>