Adding a test that confirms ability to perform 20 (re)connections
between simple peripheral and central
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Using the macro for declaring the callback struct does not make
sense in this construct, where test_connect1/2 are compiled into one
image and specific test functionality is selected via test ID
This reverts change made by #8e1682d which is incorrect for the cases
where the compile happens to include more than one declaration of the
callback struct.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Update the ACL group based scheduling with ACL first being
connected to use 4 connections and 4 streams to be
consistent with the test that does ACL the CIS one after
the other.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use defines for scan, create connection, connection and ISO
parameters in the tests.
Also, use same advertising interval for legacy and extended
advertising test.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add check to see if RPA is already generated for adv sets
with same id. If generated use the same address for all adv sets
with same id else create new RPA.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
Add tests for cases where the rank characteristic, the size
characteristic and the lock characteristics are not set on the
set members.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Split the CSIP tests to multiple scripts to make them
more specific and able to run in parallel.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The set info returned by the Set Coordinator did not contain
information about the lockable state. Furthermore the
set info was not properly initiated, as it was missing the
rank, which was set somewhere else.
This commit adds the lockable state to the set info.
This commit removes the rank from internal structure,
and uses a reference to the set info instead, and only
store the rank there.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This script tried to be too nice with users, and if they forgot
to set the scripts as executable, set it for them.
But this leads to too many testcases commited to main without
executable permissions.
Which then leads to other developers needing to set those
locally and end with dirty workspaces.
Instead let's not have run_parallel set the executable bit,
and have these tests fail in CI, so developers realize and fix it.
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>
To ease diagnosing why a test fails in CI when the
CI safety timeout triggers, have the timeout command
print to stderr a message in which it indicates it has
just killed the underlaying process.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Always print/log the 24-bits (as hex) of the broadcast ID to better
use it with e.g. the shell.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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>