Commit graph

2414 commits

Author SHA1 Message Date
Emil Gydesen
a8c6cdd536 tests: Bluetooth: Audio: Add missing write checks for VCP vol ctlr
There were several cases of write requests where we should
wait for the g_write_complete value to ensure that the write
request has completed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-07 09:34:02 +01:00
Krzysztof Kopyściński
392f95705c tests: bluetooth: mesh: add Proxy Solicitation to shell
This adds commands to advertise Solicitation PDUs, configure
On-Demand Private Proxy and manage Solicitation PDU RPL.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-03-06 13:52:15 +01:00
Stine Akredalen
56298dff73 tests: Bluetooth: Mesh: add LCD metadata test. Refactor existing tests.
* Test that the Large Composition Data server can send a max access
payload metadata status message.
* Test that the Large Composition Data client can request large chunks
of metadata from the server, and correctly merge samples.
* Refactoring of existing LCD tests.

Signed-off-by: Stine Akredalen <stine.akredalen@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Stine Akredalen
87a3e31412 Bluetooth: mesh: added OPcode aggregator Bsim test
The test checks the Opcode aggregator (SIG) model basic behaviour.

Signed-off-by: Stine Akredalen <stine.akredalen@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Michał Narajowski
0bd0071e4a Bluetooth: Mesh: Add Opcodes Aggregator models to shell
- Add entry for client and server in composition data.
- Add Client commands to aggregate and send messages.

MESH/SR/AGG/BV-02-C requires more key slots.

Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
d46480c36b Bluetooth: Mesh: Add shell commands for Private Beacon Client
Add shell commands for Private Beacon Client.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Krzysztof Kopyściński
e2086c22bc tests: Bluetooth: Mesh: Test SAR with slowest possible timings
Add test that sends longest possible PDU with slowest possible timings
and default retransmission values.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-03-06 13:52:15 +01:00
Stine Akredalen
37386552d5 tests: Bluetooth: Mesh: added SAR stress test
Test that a maximum length SDU can be processed with SAR
with "stressed" transmitter and receiver configurations.

Signed-off-by: Stine Akredalen <stine.akredalen@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Michał Narajowski
b5d6733d53 Bluetooth: Mesh: Add Transport SAR Configuration models to shell
Add Transport SAR Configuration models to shell.

Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Michał Narajowski
dd59a45c65 Bluetooth: Mesh: Transport SAR Configuration
Add support for:
- SAR Configuration Client and Server models
- Transport SAR configuration states
- Using SAR Transmitter/Receiver states in segmentation
and reassembly process.

Bsim tests fixes:
- Fix failing replay attack test. The replay attack test doesn't
consider retransmission attempts at the transport layer. When
retransmission happens, SeqNums get increased and the test logic
doesn't work anymore. The simplest fix would be to disable
retransmissions at the transport layer.
- Add device synchronization API to synchronize transport va test.
Device configuration may take different time on transmitter and
receiver. Add synchronisation barrier between devices.
- Fix msg_frnd test. Timing in transport sar behavior has been
changed, which affected test_friend_msg test. Now acknowledgments
are sent much faster and this needs to be considered in the test.
- Fix unicast_low_lat test. Increase number of retransmission
attempts when long segmented message is sent.
- Reduce timeout in kr_old_key test.
- Relax SAR RX state configuration in DFU and BLOB tests.

Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Co-authored-by: Anders Storrø <anders.storro@nordicsemi.no>
Co-authored-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Stine Akredalen
2c1abb61b3 tests: Bluetooth: mesh: added LCD bsim test
Testing the basic behaviour of the Large Composition Data model.

Signed-off-by: Stine Akredalen <stine.akredalen@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Michał Narajowski
8a60dfcd51 shell: Add Large Composition Data Server
- Adds Large Comp Data Server and Client
- Defines some dummy metadata for Health Server

Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
316d7fcd57 tests: Bluetooth: Mesh: Test Node Composition refresh with settings
Test Node Composition Refresh procedure with persistence settings.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
89c01e8686 tests: bluetooth: mesh: Implement robustness test for NPPI procedures
Test Dev Key Refresh, Node Composition Refresh and Node Address Refresh
procedures for robutness.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
bfc618dc0b tests: Bluetooth: Mesh: Test reprovisioning through RPR models
Test that Remote Provisioning models can re-provision a remote node
multiple times.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Trond Einar Snekvik
f7f3241628 Bluetooth: Mesh: Shell support for remote provisioning
Adds commands in the mesh shell for remote provisioning client
operation, including scanning, provisioning and reprovisioning.

Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Trond Einar Snekvik
3c185e1764 Bluetooth: Mesh: Remote provisioning
Adds remote provisioning models rpr_srv and rpr_cli, and exposes them as
a bearer for the provisioning process.

The remote provisioning models provide the following features:
- Remote provisioning of new devices, using a remote provisioning server
  as a proxy.
- Reprovisioning of existing devices, generating a new device key and
  changing addresses and composition data.

Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Co-authored-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
341cbfb3eb tests: Bluetooth: Mesh: Add tests for BLOB Transfer in Pull mode
This commit adds several BabbleSim tests for BLOB transfer:
- A sanity test checking that BLOB Transfer completes successfully in
both, Push and Pull modes that runs transfer for 4 targets
- blob_cli_trans_resume test for Pull mode
- Test checking that BLOB client continues BLOB transfer if one of
targets times out while sending chunks.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
435ad72147 tests: Bluetooth: Mesh: Add distributor self update tests
Add a test where distributor is a single target and performs self
update. Add a test where distributor performs self update with multiple
targets.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
38c5042e82 tests: bluetooth: mesh: Check DFU Client persistency
Check that DFU client continues DFU procedure as long as there is at
least one active target.

Co-authored-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Anders Storrø
fa7edc576a Tests: Bluetooth: Mesh: BLOB cli no response
- Tests that BLOB Client suspends if no target responds to Block get.
- Tests that BLOB Client transfer ends if no target responds to Xfer
  get.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Anders Storrø
40ff3743ea Tests: Bluetooth: Mesh: BLOB cli transfer persist
Tests that BLOB Client continues the Push BLOB Transfer procedure
as long as there is at least one active target.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Pavel Vasilyev
4c2c1fe9d1 tests: bluetooth: mesh: Test confirm step in DFU with different effects
This commit implements the following tests:
- Test that DFU finishes successfully with all different effects;
- Test that DFU fails at confirm step with all different effects;

Co-authored-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Anders Storrø
cb2bc394df Tests: Bluetooth: Mesh: BLOB cli push & pull trans resume
Add bsim test for resuming push & pull mode transfer on the BLOB client
after BLOB server has been suspended during initial attempt.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Anders Storrø
7e135e57db Tests: Bluetooth: Mesh: BLOB cli broadcast unicast
Add bsim test using unicast addr for broadcast API of the BLOB client
model.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Anders Storrø
47446a22f1 Tests: Bluetooth: Mesh: BLOB cli ret caps suspend
Add bsim test for suspending retrieve capabilities procedure of the BLOB
client model.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Anders Storrø
21184c13f0 Tests: Bluetooth: Mesh: BLOB cli mod broadcast API
Add bsim test for broadcast API of the BLOB client model.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Anders Storrø
c4a8b55752 Tests: Bluetooth: Mesh: BLOB cli mod ret caps test
Add bsim test for retrieve capabilities of the BLOB client model.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Omkar Kulkarni
644589849a Bluetooth: Mesh: Update mesh shell's config
This updates some of the defaults in the mesh shell's config to allow
various Mesh 1.1 models to be used in the shell.

EPA provisioning and DFU requires much larger multisegment messages,
therefore support for maximum sized message is enabled by default and
stack sizes are increased working values.

Additionally, log buffer is increased and thread sleep time is reduced
to avoid dropping of useful logs.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Trond Einar Snekvik
417d328796 Bluetooth: Mesh: DFU and BLOB models in shell
Adds conditional support for the BLOB and DFU models in the mesh shell.
Additionally creates a dummy BLOB stream for testing.

Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Co-authored-by: Anders Storrø <anders.storro@nordicsemi.no>
Co-authored-by: Ludvig Samuelsen Jordet <ludvig.jordet@nordicsemi.no>
Co-authored-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Co-authored-by: Mia Koen <mia.koen@nordicsemi.no>
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Aleksandr Khromykh
ffddd9ffc0 Bluetooth: Mesh: enhanced provisioning authentication
Implementation of the enhanced provisioning authentication (EPA)
that is based on SHA256 and HMAC security algorithms.
OOB authentication mandates EPA usage.

Co-authored-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Aleksandr Khromykh
a9df7e19a1 tests: Bluetooth: Mesh: run bsim mesh on both v1.0.1 and v1.1
Add ability to run bsim mesh for both ble mesh versions
v1.0.1 and v1.1

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-03-06 13:52:15 +01:00
Szymon Janc
e8e66c85ef bluetooth: tester: Enable unicast server by default
Default config should have all bells and whistles enabled to minimize
number of overlays needed in autopts.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-03-06 13:51:55 +01:00
Erik Brockhoff
6dbc446342 Bluetooth: controller: use RX node piggy-back for NTF when possible
When possible re-use the already allocated RX node for notifications.
Store (retain) RX node and Link element on RX if NTF could occur.
Pass link element to LLCP (ull_cp_rx()) together with RX node.
New RX node type RETAIN introduced to signal retention

When no RX node is available allocate one and hold off TX on procedures
until such time that a node is available for NTF.

In case waiting for NTF buffer avail is needed, allocate and store TX
node to use for TX once NTF becomes available.

CIS Established (incl. timeout handling) is now handled entirely as a
specific event driven by ull_conn_iso - ie removal of procedure check
of cis->established and cis->expire, as this is doubling mechanism
in the conn_iso context.

Unit test and helpers updated to handle new node type.
Function ull_cp_release_ntf() was used only in unit test, so moved to
helper context.
Updating release_ntf to handle the fact that with piggy-backing in test
context the node used for NTF can be from two different memory pools

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-03-06 09:35:10 +01:00
Aleksandr Khromykh
ee3d089e37 tests: Bluetooth: Mesh: remove nrf51dk* and microbit for mesh tests
nrf51 has been discontinued. There is no reason to support
ble mesh tests for nrf51 DK platform. As alternative support
of nrf52840 has been added if there wasn't before.

Also, microbit lacks significant amount of RAM (about 800 bytes)
to build mesh test.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-03-03 14:08:24 +01:00
Emil Gydesen
6ecc6c3cec tests: Bluetooth: Audio: Add start stream to unicast tests
Add support for starting streams as the unicast client, which
will connect the CISes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-03 11:00:48 +01:00
Jamie McCrae
0bad35de45 samples and tests: Use non-environmental zephyr base variable
This drops using the environmental part when referencing ZEPHYR_BASE
as the environment value does not have to be set and, in most cases,
is no longer set at all.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-03 10:49:10 +01:00
Emil Gydesen
b1415c57e1 tests: Bluetooth: Add missing encryption value for CAP broadcaster
The field was uninitialized, causing the test to fail.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-02 13:49:07 +01:00
Emil Gydesen
a73d2fc1ff tests: Bluetooth: Add VCP Vol ctlr invalid BSIM tests
Call all VCP Vol ctlr APIs with invalid values and ensure that
they return an error.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-02 10:56:27 +01:00
Emil Gydesen
63e055b165 tests: Bluetooth: VCP: Move vol ctlr tests into smaller functions
Move the volume controller test steps into smaller functions for more
reusability and easier to expand with invalid test steps.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-02 10:56:27 +01:00
Emil Gydesen
9e23eb6a4b tests: Bluetooth: Add VCP Vol rend invalid BSIM tests
Call all VCP Vol rend APIs with invalid values and ensure that
they return an error.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-02 10:56:27 +01:00
Emil Gydesen
92530778e2 tests: Bluetooth: VCP: Move vol rend tests into smaller functions
Move the volume renderer test steps into smaller functions for more
reusability and easier to expand with invalid test steps.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-02 10:56:27 +01:00
Andries Kruithof
a395093acb Tests: bluetooth: controller: add correct number of max connections
The number of connections for the tx_buffer_alloc needs to be at least 3
For one of the tests it was set to default 1, which leads to unspecified
behaviour.

This is fixed by setting the maximum nr. of connections to 4

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-03-02 10:01:51 +01:00
Jamie McCrae
af78cbdc99 samples and tests: Add REQUIRED to Zephyr find_package call
Adds REQUIRED to samples and tests for finding the zephyr package
to align all samples and tests with the same call and parameters.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-02 09:58:27 +01:00
Emil Gydesen
d192c1b1e4 Tests: Bluetooth: Fix missing CAP broadcast packing field
Set uninitialized packing field in the broadcast create
parameter.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-28 10:29:52 +01:00
Emil Gydesen
6760b9e68b Tests: Bluetooth: Add delay between IAS client write operations
Since there is no way for the client to read or get notified about
the state, we insert a delay between each operation to allow the
server to handle the alerts before getting a new alert request.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-27 13:20:33 +01:00
Emil Gydesen
29eec51dc3 Tests: Bluetooth: Fix bad err check in ias_test.c
The error check was == 0 where it should have been != 0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-27 13:20:33 +01:00
Jonathan Rico
02edcd6494 Bluetooth: host: calculate GATT DB hash on settings load
Prevent race condtions between the stack and the low-priority thread by
calculating the hash (and acting on it, e.g. for marking peers
change-aware, sending SC indications, etc) in the settings_load() context.

Fixes #54773

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-02-27 10:48:15 +01:00
Jonathan Rico
b3671666e1 Bluetooth: host: clear ATT pending flag on failure to send
`ATT_PENDING_SENT` wasn't cleared when L2CAP reported an error when sending
the packet. This resulted in the channel being unusable for ever, since we
only clear that bit on a response (that will never be sent).

Found when setting `CONFIG_SYS_CLOCK_TICKS_PER_SEC=32768` in the
`notify_multiple` test. The kicker was the bug didn't manifest when EATT
wasn't enabled:
- we were queuing two unsubscribes back to back in the test
- on UATT we have to wait for a req-rsp pair before enqueuing a new one
- on UATT we only have one channel anyways

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-02-27 10:32:13 +01:00
Andries Kruithof
226c99b455 tests: bluetooth: add prefix to exposed API
In ull_llcp* some functions used in unittesting did not have
the llcp_ prefix
Although this is not a big issue since they are only used when
testing the module this commit adds the prefix so that we
have a more consistent naming

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-02-24 11:46:39 +01:00