Commit graph

2414 commits

Author SHA1 Message Date
Pavel Vasilyev
8a3f3dc49b tests: Bluetooth: Mesh: Don't fail inside bt_mesh_test_recv
Don't fail inside bt_mesh_test_recv, but return error code instead.
Caller shall check error code and fail.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-11 11:00:30 +01:00
Pavel Vasilyev
672f116c6a tests: Bluetooth: Mesh: Don't start provisioning until provisioner ready
Don't start provisioning devices until provisioner is ready.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-11 11:00:30 +01:00
Pavel Vasilyev
8ef6b7681f tests: bluetooth: mesh_shell: Increase main thread stack size
Increase main thread stack size so that the sample can be run on
nrf52832 and nrf52840 DKs.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-10 14:31:03 -05:00
Emil Gydesen
0d719ba893 Bluetooth: Audio: Add endpoint type to capabilities config cb
The capabilities callback did not provide information about
the type of the endpoint being configured, making it
impossible for the application to determine if it is a
sink or source endpoint.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen
b880637231 Bluetooth: Audio: Remove bidirectional audio streams
Audio streams as defined by the BAP spec does not
support bidirectional audio streams. This commit
updates the API and implementation to match that.

The use a bidirectional CIS with 2 audio stream will
be added in a future commit.

This removes the _IN_ and _OUT_ and _INOUT_ QOS
values, as well as the direction of the codec QOS
struct.

To keep direction for internal use, the direction
has been added to the endpoint struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen
a1395c17a3 Bluetooth: Audio: Add BASS BSIM tests
Add the BASS babbleism tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:06:44 -05:00
Emil Gydesen
956518a33b Bluetooth: Audio: Add BASS client shell
Add the BASS client shell module.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:06:44 -05:00
Emil Gydesen
dcbd1a555f Bluetooth: Audio: Add BASS shell
Add support for the BASS server shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:06:44 -05:00
Emil Gydesen
e485305b7c Bluetooth: Audio: Fix ordering of array size after array parameter
Make it consistent for audio.h and capabilities.h that the
array size parameter appear after the array parameter.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Emil Gydesen
a01cc054c9 Bluetooth: Audio: Use size_t for audio.h array len arguments
Use size_t instead of uint8_t to describe array lengths.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Emil Gydesen
d64328ebe5 Bluetooth: Audio: Add support for add/rem streams for unicast group
Add a function to add more and remove streams
to and from a unicast group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Andries Kruithof
0927b89540 Bluetooth: tests: Fixup conf to make sure new LLCP is selected
Selecting the new LLCP is a 'choice' in Kconfig, so setting
CONFIG_BT_Ll_SW_LLCP_LEGACY to 'n' does not select the new LLCP
Instead CONFIG_BT_LL_SW_LLCP needs to be set explicitly to 'y'

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-03-10 13:17:50 -05:00
Aleksandr Khromykh
660fa1b5ce tests: Bluetooth: Mesh: add heartbeat publication to bsim test
Extend the existing bsim Heartbeat test
to check the publication callback functionality.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-03-10 13:16:40 -05:00
Herman Berget
0e5d438ee2 Bluetooth: Host: Add test for issue #42306
Checks that only CONFIG_BT_EATT_MAX EATT bearers get connected.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-03-10 13:26:46 +01:00
Emil Gydesen
8924d5c6be tests: Bluetooth: GATT server test add missing bt_conn_ref
Add missing bt_conn_ref for the gatt server test.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-09 15:04:57 +02:00
Emil Gydesen
47f991b29c tests: Bluetooth: Audio: BSIM uniform use of default_conn
Update the Bluetooth Audio babblesim tests to all use
default_conn, and use it correctly.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-09 15:04:57 +02:00
Krzysztof Chruscinski
47ae656cc1 all: Deprecate UTIL_LISTIFY and replace with LISTIFY
UTIL_LISTIFY is deprecated. Replacing it with LISTIFY.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Thomas Ebert Hansen
4b18770145 tests: Bluetooth: Test unsupported LLCP opcodes
Test the rejection (LL_UNKNOWN_RSP) of unsupported remotely initiated
procedures in both the central and peripheral role.

Unsupported opcodes are handled by Kconfig manipulation and removal of
source files.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Thomas Ebert Hansen
250075d3dd tests: Bluetooth: Test invalid LLCP opcodes
Test the rejection (LL_UNKNOWN_RSP) of invalid remotely initiated
procedures in both the central and peripheral role.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Asbjørn Sæbø
eecd94409c Bluetooth: OTS - Client APIs to have instance as first parameter
Move the instance as the first parameter of the client function calls
and callbacks, for consistency with the server implementation.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
70eefae1d2 Bluetooth: OTS - Merge server and client header files
- Move content of client header file to common header file.
- Rename content from "otc" to "ots_client".
- Remove empty client header file.
- Update users.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
da89dcfbcd Bluetooth: OTC - Move metadata bitfields to common files
Move the metadata request bitfields to the common header files.
This is part of merging the ots_client and ots header files.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
76cf124060 Bluetooth: OTS - rename client files
Rename OTS client files from "otc" to "ots_client".

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
352dd3763e Bluetooth: OTS - join Kconfig for OTS server and client
Merge Kconfig file for OTS server and client.
Rename the client config from _OTC to _OTS_CLIENT

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
69b731d824 Bluetooth: OTC: Rename two functions
Rename functions to follow common pattern (module, action, noun).

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
0d6e18a052 Bluetooth: OTC: Move OTC files to OTS folder
Move the OTC files to the OTS folders for further refactoring.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Carlo Caione
e3d2306334 tests: bluetooth: controller: s/STACKSIZE/STACK_SIZE/
Otherwise CI complains.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-02 13:20:52 +01:00
Nirosharn Amarasinghe
0f8d9b430b tests: bluetooth: controller: Add ISO AL unit test
Ztest based unit test of ISO adaptation layer.
Testing of unframed case, single SDU, recombined from
one and two PDUs.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-03-02 11:22:33 +01:00
Vinayak Kariappa Chettimada
da61751342 tests: Bluetooth: bsim: Test ISO data send
Added implementation to test ISO data send in Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-01 14:54:35 +01:00
Alexandru Carbuneanu
e4df2434c3 tests: bsim: first L2CAP ecred bsim test
First L2CAP ecred bsim test.

Signed-off-by: Alexandru Carbuneanu <alexandru.carbuneanu@nordicsemi.no>
Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
2022-02-28 11:09:42 +01:00
Emil Gydesen
628b54a959 Bluetooth: Audio: Remove ISO disconnected and connected cbs
The callbacks were implemented to notify the application
about the state of the ISO. However, since then, callbacks
such as `started` and `stopped` have been implemented,
and as such the `connected` and `disconnected` callbacks
no longer server any purpose.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-02-28 11:04:37 +01:00
Szymon Janc
0b01cf14e1 tests/bluetooth/tester: Add support for rejecting connection parameters
This is required for GAP/CONN/CPUP/BV-05-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:09:09 -08:00
Szymon Janc
3cbec153b2 tests/bluetooth/tester: Add support for multiple GATT subscriptions
This is required by GATT/CL/GAI/BI-01-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:08:45 -08:00
Szymon Janc
382e53c255 tests/bluetooth/tester: Fix possible buffer overflow
Make sure we have enough space for notification data.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:08:45 -08:00
Mariusz Skamra
57ad6af3a0 tests: bsim: unicast_server_test: Fix codec specific capabilities
This fixes format of codec specific capabilities in PAC record.

Fixes: #43058
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-02-25 10:05:33 -08:00
Herman Berget
47a7fb8d03 Bluetooth: Host: Add test for EATT connection with encryption
Check that the connection request is retried and succeeds when
CONFIG_BT_EATT_SEC_LEVEL=2.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-25 10:04:10 -08:00
Lingao Meng
3efe1e8c05 test: bluetooth: Update Bluetooth Mesh build test
Update project configuration.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-02-24 13:51:09 -08:00
Trond Einar Snekvik
134c0c3562 Bluetooth: Mesh: Re-enable pb_adv_reprovision test
Re-enables the failing test, undoing the change in #43070.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-23 11:35:38 -08:00
Trond Einar Snekvik
b9eda3d939 Bluetooth: Mesh: Reduce number of reprovision runs in test
The pb_adv_reprovision test takes a long time to execute, as it's
running 10 provisioning sessions in a row. Any side effects from the
provisioning process should come into play already on the first
reprovisioning, so we can safely reduce this to only 3 provisioning runs
without losing any test coverage.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-23 11:35:38 -08:00
Trond Einar Snekvik
5aafc8cd0c Bluetooth: Mesh: Increase BSIM test timeout to 5 minutes
The wallclock time timeout of the test execution is limited to let CI
abandon hanging test cases. Increase this timeout to account for
additional tests running in parallel in CI, which has caused enough
resource contention to make CI break the time limit.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-23 11:35:38 -08:00
Vinayak Kariappa Chettimada
6c8ae61bb1 tests: Bluetooth: bsim: ISO Broadcast Channel Map Update Procedure
Updated tests to perform ISO Broadcast Channel Map Update
Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-02-23 13:16:07 +01:00
Aleksandr Khromykh
5653358825 test: Bluetooth: Mesh: additional model extension checks
This PR add more checks for model extension functionality for BLE Mesh.
It adds checking of:
* Models across multiple elements (should not share subscription lists)
* Sibling models (if models that extend the same model share
  a subscription list)
* Subscription list entry allocation (models within extension list
  use subscription list capacity of each other).

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2022-02-22 10:11:20 -08:00
Andries Kruithof
fefe959c06 Bluetooth: controller: llcp: update CMake version for unittesting
The minimum CMake version required is 3.20.0, but the unittests
for the LLCP controller still referred to 3.13.1 as the minimum

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-02-22 10:09:57 -08:00
Trond Einar Snekvik
c1d5e1fda0 Bluetooth: Mesh: Disable pb_adv_reprovision
pb_adv_reprovision is failing in CI, but the error cannot be reproduced
locally. Disable the test as a hotfix for main, so we can determine the
issue and re-enable the test in a separate PR.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-22 09:53:41 -05:00
Carles Cufi
4b8f1c04ab kconfig: Rename the ZTEST stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Szymon Janc
c631469539 tests/bluetooth/tester: Allocate L2CAP channel only when needed
This fix leaking channels when autorization or key size are tested.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-22 10:23:33 +01:00
Szymon Janc
4b40915004 test/bluetooth/tester: Don't clear auth requirements on L2CAP server
We have single server but it can accept multiple connections so
keep same requirements for all connection attempts.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-22 10:23:33 +01:00
Pavel Vasilyev
6bbc1c8e62 tests: Bluetooth: Mesh: Test secure network beacons processing
Add tests checking that:
- invalid beacons are dropped and do not affect beacon interval;
- valid beacons with old Net Keys are either processed or dropped
depending on the Key Refresh phase;

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-02-21 22:10:24 -05:00
Asbjørn Sæbø
34de2af394 Bluetooth: audio - remove BT_AUDIO_DEBUG
Remove the BT_AUDIO_DEBUG Kconfig option.

Given that all the audio modules are guarded by the BT_AUDIO config,
it seems excessive to also have a separate guard for audio module
debug. It is sufficient that this is turned on/off module by module.

Note that the BT_AUDIO_DEBUG was also located in the wrong file - the
babs Kconfig file, not the main Kconfig file.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-02-21 22:03:04 -05:00
Andries Kruithof
dcddfb567f bluetooth: controller: llcp: expand cen and per
The abbreviations cen and per may be confusing, so they are
expanded into central and peripheral

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-02-21 19:43:10 -05:00