Commit graph

476 commits

Author SHA1 Message Date
Emil Gydesen
0521ffd5a3 Bluetooth: ISO: Rename BT_ISO_ADVANCED to BT_ISO_TEST_PARAMS
Rename the Kconfig option from BT_ISO_ADVANCED to
BT_ISO_TEST_PARAMS to more explicitly denote that it
enables support for using the ISO test parameters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-20 14:50:48 +02:00
Håvard Reierstad
393c5ce065 bsim: Bluetooth: mesh: fix model extension
In 'test_access.c', model 3 on element 1 extending model 3 on element 0
is now registered correctly. When calling 'bt_mesh_model_extend' on
models on different elements, this needs to called from the
model with the highest element index to be registered correctly.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-10-17 19:11:42 +03:00
Håvard Reierstad
5969ad7811 bsim: Bluetooth: mesh: Implement CDP1 test
Adds bsim test to verify that composition data page 1 (CDP1) is
encoded and decoded correctly.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-10-09 15:06:06 +03:00
Anders Storrø
2e3ae017e3 tests: Bluetooth: Mesh: LCD test all comp pages
Adds test for verifying split get operation for all
composition data pages.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-06 16:21:02 +03:00
Ingar Kulbrandstad
a5d15ec017 Bluetooth: Mesh: Fixed issue with RPR server and client.
Fixed issue when reprovisioning is done on a device with
both RPR client and server on the same device.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2023-10-06 16:06:12 +03:00
Andries Kruithof
e04c963d9c Test: Bluetooth: controller: add CI testing for advertising chaining
Update babblesim tests for testing chaining for advertising to ensure that
we spill over to the next PDU

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-06 16:04:11 +03:00
Andries Kruithof
d00d44c925 Bluetooth: controller: fix failing EBQ advertising tests
Updates the chaining for advertising.
Instead of unconditionally adding a new PDU when new data
is added we now instead fill the last PDU in the chain with
the incoming data, only adding a new PDU when there is
not enough room.

This reduces the nr. of PDUs used for advertising, and also
fixes some qualification failures

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-06 16:04:11 +03:00
Mateusz Kapala
3c0c634340 bluetooth: tests: Improve bondable_per_connection bsim test
Added fail on pairing_failed callback for both central and peripheral.
Added pairing status checks in peripheral.

It has been done to test the case when multi-role BT device tried to
pair without bonding (peripheral role) while already previously bonded
with the same device on another Bluetooth identity as it seems that
there was an issue with it previously.

Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
2023-10-04 14:53:26 +01:00
Emil Gydesen
e67d6c2fa4 tests: bsim: Bluetooth: Remove broadcast_source_stop_inval
Removed the tests for invalid bt_bap_broadcast_source_stop
parameters and state, as those tests now implemented as unit tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-03 14:28:19 +01:00
Alberto Escolar Piedras
55940f701c tests bsim: Limit parallel build
The compile script had been modified
to fully parallelize all images builds
in 1de363d9d5

And has been kept building everything in parallel since then.
Over time we have seen an increase in the number of hangs
for this job in CI.
This is understood as being the result of the number of images
having increased, leading to a too high load
on the worker machines which cause them to timeout their
connection to the github CI scheduler.

In b83a828825
these jobs priority was lowered to aleviate this issue,
but again we see an increased number of CI runner
disconnects.

Let's parallelize this compile jobs a bit less.
With this change, we do not build anymore the sets of
host ll and mesh test images in parallel but sequencially.
On a local test this reduces peak load from
~1700 to ~700, and eliminates issues with system
unresponsiveness; while there is no statistically measurable
increase in overall build time.
Note that the single audio image is still built in parallel
to the other 3 sets, as this was seen to improve total
build time by 2 seconds out of 1m51s.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-02 15:54:10 +03:00
Vinayak Kariappa Chettimada
a178aa9855 Bluetooth: Controller: Review rework flush timeout support
Review rework changed related to flush timeout support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada
27c92fe238 tests: bsim: Bluetooth: Test RTN=2, FT=2, Cen skip 4 SE in Controller
Test RTN=2, FT=2 in Controller with 4 subevents dropped by
central.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada
291cd03818 tests: bsim: Bluetooth: Test RTN=2, FT=2, Cen skip 2 SE in Controller
Test RTN=2, FT=2 in Controller with 2 subevents dropped by
central.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada
a7d2fdd02b tests: bsim: Bluetooth: Test RTN=2, FT=2, Per skip 4 SE in Controller
Test RTN=2, FT=2 in Controller with 4 subevents dropped by
peripheral.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada
2935d3b731 tests: bsim: Bluetooth: Test RTN=2, FT=2, Per skip 2 SE in Controller
Test RTN=2, FT=2 in Controller with 2 subevents dropped by
peripheral.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Emil Gydesen
1442a6cf5b tests: bsim: Bluetooth: Remove bsim testing of broadcast create inval
Removing the babblesim testing of the invalid parameters for
bt_bap_broadcast_source_create as they are now done in a unit
test instead.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 12:59:54 +02:00
Emil Gydesen
62787bd208 tests: bsim: Bluetooth: Remove broadcast_source_delete_inval
Removed the tests for invalid bt_bap_broadcast_source_delete
parameters and state, as those tests now implemented as unit tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 12:59:41 +02:00
Alberto Escolar Piedras
25897f8baa tests bluetooth mesh: Fix ASSERT_TRUE/FALSE with messages
The previous ASSERT_TRUE/FALSE macros looked like
they could take extra printf like parameters but did not
(those extra arguments were just dropped).

Define 2 new macros that can take those extra parameters
and fix all uses that intended to print those extra messages.

Also add an extra "\n" as the underlaying print functions
do not add end of lines on their own.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-28 13:43:51 +02:00
Alberto Escolar Piedras
146d025aa0 tests bluetooth mesh: Fix a incorrect assert
This ASSERT_TRUE should have been an assert equal
(ASSERT_TRUE checks that the first paramters != 0)
and the condition was not correct.
Fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-28 13:43:51 +02:00
Jonathan Rico
c1baa8282d tests: Bluetooth: Add ATT sequential procedures test
The purpose of this test is to prove that the zephyr host can handle the
behavior described in the Bluetooth Core Specification Vol.3 Part.F
3.3.2 "Sequential protocol".

The host should be able to handle all of those in parallel: one
indication, one write request, multiple commands and multiple
notifications.

The "tester" part had to be written with a "tiny host" implementation
instead of the Zephyr host, as the ZH conflates GATT client and server
and doesn't allow a device to enqueue an ATT request + an ATT indication
on the same bearer.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-09-28 14:21:27 +03:00
Emil Gydesen
b470e82a95 tests: bsim: Bluetooth: Remove broadcast_source_reconfigure_inval
Removed the tests for invalid bt_bap_broadcast_source_reconfigure
parameters and state, as those tests now implemented as unit tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-28 13:14:49 +02:00
Emil Gydesen
0f9f528214 tests: bsim: Bluetooth: ISO: Add host CIS tests
Add a simple central and peripheral CIS test that
exercises the ISO host API for unicast ISO (CIS).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-28 13:12:19 +02:00
Théo Battrel
2e13802a38 Bluetooth: Test: Update security/ccc_update
Previous commit reverted the `link_encrypted` filed of CCC config.
Update the test to match the new expected behavior.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-09-28 09:21:57 +02:00
Théo Battrel
888a8c644c Bluetooth: Test: SC Indication
Test that SC Indication is correctly sent when the client reconnect and
the server updated the GATT database since last connection. Test that
the indication is sent even if the bond is not restored.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-09-28 09:21:57 +02:00
Fredrik Danebjer
078b00b155 Bluetooth: Audio: Add resend mechanic to CSIP notifications
Added retry mechanic to CSIP notifications by adding them into system
workqueue. Bookkeeping is done for notifications for all clients, and
potentially disconncted clients will also receive notifications on
reconnect. This also adds mechanic to restore the local clients list
upon registration of the service, as well as BSIMs to test notify on
reconnect.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-09-27 15:47:33 +02:00
Anders Storrø
c2677fe2e4 tests: Bluetooth: Mesh: Add PRB proxy bsim test
Adds Bsim test for checking behavior of private Net ID
and private Node ID.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-27 15:47:06 +02:00
Anders Storrø
8d253086c3 tests: Bluetooth: Mesh: Fix bug in priv beacon
Fix several pointer related bugs in the private beacon test
framework.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-27 15:47:06 +02:00
Alberto Escolar Piedras
03b601f0a9 tests BT privacy: Simplify a bit scripts
Reduce the unnecessary hidding and indirection,
as it makes the scripts more difficult to follow
for no benefit.
If somebody wants to debug these tests, they'll want
to see the sim_id, and won't benefit from going around
opening files needlessly.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-26 08:38:36 +02:00
Alberto Escolar Piedras
0ff2ba8c8e tests: BT privacy: Fix printf format
Fix the print format string so the "%" is printed
instead of a bogus value.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-25 19:48:15 +02:00
Fabio Baltieri
09f02edfa4 Bluetooth: CAP: drop non existing qos
qos got dropped from bt_cap_unicast_audio_start_stream_param in
71b1591337.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-21 12:44:08 +02:00
Emil Gydesen
f0cc8d4cb1 Bluetooth: CAP: Add support for long read/write
Add support for reading and writing long values (> MTU)
when using the CAP API.

This change does make it slightly slower to execute the
CAP procedures as it is now done on a one-by-one basis,
which affect multi-ACL setups, but that also means
that the buffer requirements for CAP will generally be lower.

There is still room for improvement as we can perform the BAP
operations in parallel on each ACl, which should return this to
its former performance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:24:27 +01:00
Emil Gydesen
68751b8990 tests: Bluetooth: Audio: Add testing of source stream
Expand the CAP tests to also discover and setup a source
stream, so that the CAP procedures are run on multiple
streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:24:27 +01:00
Emil Gydesen
01f7d108f3 tests: bsim: Bluetooth: Add BAP unicast disconnect test
The purpose of this test is to verify that the stack has
the correct behavior if the ACL disconnects while one or
more streams are in the streaming state.

The main point it validates is that unicast server device
can restart advertising using a simple k_work in the
disconnected callback.

The number of connections supported by the test suite has
also been reduced to 3, to avoid some seen issues with
scheduling when CONFIG_BT_MAX_CONN=5.

A part of implementing the test for this purpose, the
unicast client and unicast server have been extended
to also advertise and scan for proper ASCS advertising
data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:20:27 +01:00
Emil Gydesen
9064170cf8 tests: Bluetooth: Audio: Modify bsim tests to use bt_le_scan_cb_register
Update the tests to use bt_le_scan_cb_register and the "new"
scan callback, as that is better suited to handle extended
advertising.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:20:27 +01:00
Emil Gydesen
f93caa3903 Bluetooth: Audio: BT_AUDIO_CODEC_LC3_ID -> BT_HCI_CODING_FORMAT_LC3
Replace the BT_AUDIO_CODEC_LC3_ID macro with the
BT_HCI_CODING_FORMAT_LC3 as there is no reason to
define and use the LC3 ID different than the other
allowed codec IDs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:19:50 +01:00
Emil Gydesen
b92422afb8 tests: bsim: Bluetooth: Remove broadcast_source_start_inval
Removed the tests for invalid bt_bap_broadcast_source_start
parameters and state, as those tests now implemented as unit tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:17:34 +01:00
Emil Gydesen
6dd90c1ab0 tests: Bluetooth: BAP: Update test for bt_bap_broadcast_source_reconfig
Added additional testing for bt_bap_broadcast_source_reconfig after
the API changed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:16:52 +01:00
Théo Battrel
4e467a9bee Bluetooth: Test: Remove dead code
Remove unused code in `host/gatt/settings` test. The conditional block
could never be reached because the type of the discovery parameter is
`BT_GATT_DISCOVER_CHARACTERISTIC`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-09-20 08:56:57 +02:00
Vinayak Kariappa Chettimada
3a690f62dd tests: bsim: Bluetooth: mesh: Adjust test sleep durations
Adjust test sleep durations to compensate towards timing
changes in Zephyr Controller radio scheduling.

With the change in the radio scheduling, there is overlap
of advertising PDU from multiple nodes that relay the PDU,
hence increase test timeout so that next advertising
interval that uses random delay will get received by nodes
without collisions on air.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-18 14:25:02 +02:00
Ludvig Samuelsen Jordet
b990a74f8b Bluetooth: Mesh: Add support for Upload OOB Start
This adds support for the Upload OOB Start message to the DFD server, by
providing callbacks that the application can use to hook any OOB scheme
into the model behavior.

There are also extensive changes to the dfu_slot module, to accomodate
the new needs that appeared with the support for OOB transfer (mainly,
fwid, size and metadata are no longer available when the slot is
allocated, they appear later in the handling).

Signed-off-by: Ludvig Samuelsen Jordet <ludvig.jordet@nordicsemi.no>
2023-09-18 10:55:20 +01:00
Gerard Marull-Paretas
aaeb0a672e toolchain: only include <zephyr/toolchain.h>
It is wrong to use toolchain-specific header files.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-15 09:27:30 +02:00
Donatien Garnier
185a6117c0 Bluetooth: Host: Amend existing L2CAP accept callbacks
This patch amends the existing L2CAP accept callbacks to use the new
accept signature that includes a pointer to the L2CAP server structure.

Signed-off-by: Donatien Garnier <donatien.garnier@blecon.net>
2023-09-14 14:36:34 +02:00
Gerard Marull-Paretas
691facc20f include: always use <> for Zephyr includes
Double quotes "" should only be used for local headers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-14 13:49:58 +02:00
Jonathan Rico
0f8b357d0a tests: Bluetooth: split id_addr_update test
Split FW into two images, one for central one for peripheral.

The SoftDevice controller's connection contexts are not role-agnostic:
some are reserved for the peripheral roles some for the central roles.

Splitting the test into two images is anyway "The right thing (TM)",
it's just that we sometimes take the shortcut of using a single image to
go faster.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-09-11 19:58:16 +02:00
Anders Storrø
cf8301d01e tests: Bluetooth: Mesh: OD priv proxy pst test
Adds test for persistent storage in On-Demand Private Proxy
implementation.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-11 19:58:05 +02:00
Anders Storrø
893a239f85 tests: Bluetooth: Mesh: Priv beacon pst test
Adds test for persistent storage in private beacon
implementation.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-11 19:58:05 +02:00
Anders Storrø
0e966cceb2 tests: Bluetooth: Mesh: Add comp p2 test to bsim
Adds testing of composition data page 2 and 130 in the
mesh_prov_pst_pb_remote_ncrp bsim test.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-09-08 14:44:25 +02:00
Théo Battrel
95ac71893c Bluetooth: Test: Add tests to reproduce SMP issues
This test reproduce two issues, #59788 and #61465.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-09-06 09:35:01 +02:00
Kamil Piszczek
2f90ef488a bluetooth: tests: add bsim test for identity address update
Added a BabbleSim test to check the update of the destination address
of all active connections during the identity resolution operation.
All connection objects associated with the same private peer address
should convert it to the identity address.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2023-09-04 18:41:48 +02:00
Vinayak Kariappa Chettimada
0c5b07838f tests: bsim: Bluetooth: Add verification of Broadcast ISO recv data
Add test implementation to verify correct broadcast ISO
receive data.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-04 18:22:41 +02:00