Commit graph

2414 commits

Author SHA1 Message Date
Emil Gydesen
c47dae8c6d Bluetooth: ISO: Update connected ISO API
Update the connected ISO API to be more
similar to the broadcast ISO API as well
as the HCI spec.

This updated API allows for more flexibility
and will better support scenarios such as true
wireless setup, as ISO channels and connections
are more independent now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Alberto Escolar Piedras
9249609071 boards: bsim: fix bug with single settings file for few bsim devices
Reapply the part of 4b5cd92312
that added new functionality/fixed the actual issues described
in the original commit message withtout the further cleanup.

There was also some cross-commit content from
2b91ebe16e
as part of the cleanup in test_friendship.c which is also included.
+ added cleanup also to test_provision.c on request from Aleksandr.

Original commit msg:
-----------
Multiple bsim devices cannot store individual settings
with the existing settings backend for bsim.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
-----------

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2021-08-24 12:37:51 +02:00
Alberto Escolar Piedras
26d7d7c8c8 Revert "boards: bsim: fix bug with single settings file for few bsim devices"
This reverts commit 4b5cd92312.

global_device_nbr is used by many bsim tests.
And many of those are now off tree in preparation of the LE-Audio
work. Removing this for cleanliness now is not nice on others.
=> Revert

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2021-08-24 12:37:51 +02:00
Aleksandr Khromykh
2b91ebe16e test: Bluetooth: Mesh: test replay attack on ble mesh rpc
The test checks the resistance of ble mesh stack to replay attack.
Replay protection cache shall store seqAuth last frames.
Device shall filter out such messages on the transport layer.
Power on\off sequence shouldn't impact that
since replay protection cache is stored in settings subsystem.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-08-23 18:55:53 -04:00
Aleksandr Khromykh
4b5cd92312 boards: bsim: fix bug with single settings file for few bsim devices
Multiple bsim devices cannot store individual settings
with the existing settings backend for bsim.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-08-23 18:55:53 -04:00
Johann Fischer
72be0ed332 tests: bluetooth: shell: update shell over CDC ACM UART configuration
Add usb.overlay which contains chosen node and cdc-acm-uart node.
Update USB configuration and test case.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Krzysztof Kopyściński
c94e53c9f5 Tests: bluetooth: tester: increase CONFIG_BT_ATT_PREPARE_COUNT
This is required for GATT/SR/GAW/BV-14-C

signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-08-21 21:34:08 -04:00
Ingar Kulbrandstad
2130e2b549 Bluetooth: Mesh: Test scanner when receiving invalid packets.
The scanner should not cause a device to crash or malfunction
if invalid packets are received.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-08-20 19:00:08 -04:00
Trond Einar Snekvik
705e056e4c test: Bluetooth Mesh: Catch friendship unseg app decrypt error
Increases the friendship unseg app payload size in the friend message
test and enables asserts to test the error described in #37519.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-08-20 12:49:28 +02:00
Torsten Rasmussen
1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Omkar Kulkarni
3dd61cfc5b bluetooth: mesh: Add test to check IVU counter
Adds a test to check value of the IV Update
counter at the time of provisioning based on
the status of IV Update flag. Also ensures that
the counter is reset if the mesh stack state
is reset.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2021-08-19 10:19:43 -04:00
Omkar Kulkarni
f868ca3497 bluetooth: mesh: Fix IVU duration counter update
When device is first provisioned with IV Update
flag is set to 0, it should wait for minimum of
96 hours before going into IV Update In Progress
state. Such limit does not apply, if device is
provisioned with IV Update flag is set to 1.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2021-08-19 10:19:43 -04:00
Pavel Vasilyev
75a51e9c50 Bluetooth: Mesh: Check access layer persistence storage
This commit tests persistence storage for access layer:
- Model publication
- Model subscription
- Model app keys binding
- Model data

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-19 10:19:02 -04:00
Pavel Vasilyev
0e647ee14f Bluetooth: Mesh: Fix overwriting existing entries in test backend
This commits fixes an issue where an existing entry in a settings file
causes settings file corruption when storing new value.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-19 10:19:02 -04:00
Piotr Pryga
5a4e0dca31 tests: Bluetooth: df: Add tests for enable CTE req and sampling HCI cmd
Add unit tests for HCI commands:
- HCI_LE_Set_Connection_CTE_Receive_Parameters,
- HCI_LE_Connection_CTE_Request_Enable.
Tests validate current implementation of commands handling in HCI/ULL.
Handling of the HCI_LE_Connection_CTE_Request_Enable is not complete,
thus tests don't validate positive behavior the functions.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-18 20:11:10 -04:00
Vinayak Kariappa Chettimada
13d9b5c2ed tests: Bluetooth: bsim: Add a little wait for connection establishment
Add a little wait before completing the test to ensure both
central and peripheral side of the test completes before the
test exits.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-17 17:36:19 +02:00
Vinayak Kariappa Chettimada
cd8735b36a tests: Bluetooth: bsim: Verify Extended Active Scanning
Added tests to verify Extended Active Scanning support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-17 17:36:19 +02:00
Trond Einar Snekvik
d0bf124837 tests: Bluetooth Mesh: Use unique names for all simulations
Adds a low_lat name to the duplicated low_lat babblesim tests to allow
them to run in parallel with their counter parts.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-08-17 06:04:08 -04:00
Vinayak Kariappa Chettimada
7ade4a2321 tests: Bluetooth: bsim: Use wait lower than advertising interval
Fix failure due to advertising report count being
incremented faster than the wait loop that had longer delay
compared to the received interval of the advertising report.

Fixes #37652.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-13 10:58:21 +02:00
Krzysztof Kopyściński
00bfac00ae Bluetooth: gatt: Add option to read multiple without variable length
Currently, with EATT enabled, when bt_gatt_read is called with multiple
handles first it'll try to use gatt_read_mult_vl, and if it fails
gatt_read_mult will be used to try again. Add option to skip
the gatt_read_mult_vl and use gatt_read_mult right away. This is needed
by tests that expect BT_ATT_OP_READ_MULT_REQ but support variable
lenght, thus don't return BT_ATT_ERR_NOT_SUPPORTED.

Removed fallback from read multiple vl to read multiple on
BT_ATT_ERR_NOT_SUPPORTED error.

This was affecting:
GATT/CL/GAR/BV-05-C, GATT/CL/GAR/BI-18-C, GATT/CL/GAR/BI-19-C,
GATT/CL/GAR/BI-20-C, GATT/CL/GAR/BI-21-C, GATT/CL/GAR/BI-22-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-08-12 11:07:08 -04:00
Lingao Meng
8e1682d1ea samples: conn_cb replace to const zsector
It is more efficient and saves part of RAM
by replacing it with static one dynamically.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-11 13:42:28 +02:00
Vinayak Kariappa Chettimada
f1f40b6675 tests: Bluetooth: bsim: Test random address change on adv re-enable
Verify that random address is changed when enabling an
already enabled advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
df3498bb75 tests: Bluetooth: init: Cover strict adv and scan enable/disable
Cover the strict advertising and scanning enable/disable
debug usecase.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
cd344fe24c tests: Bluetooth: bsim: test advertising re-enable
Test advertising re-enable to cover reset of event counter,
duration and the number of events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Piotr Pryga
86c4d9001b tests: Bluetooth: df: Add tests for use of CTE in per adv chains
Bluetooth host may request to send more than one CTE in
connectionless mode. That is relized by periodic advertising
chained PDUs.
To check correctness of implementation of such functionality
new unit tests were added.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-07 20:50:03 -04:00
Lingao Meng
ce40fa434f tester: bluetooth: gatt: fix null pointer case CASE failed
GATT/SR/GAD/BV-03-C will read attr value, but we parse NULL
from `attr->read` which point to `attr_read` function.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-05 17:34:57 +02:00
Johann Fischer
3240e0cc51 tests: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Lingao Meng
36a385386a Tester: Bluetooth: Mesh: Rename function avoiding conflict
Since `write` or `read` belong with system standard API, so rename
this to avoiding conflict.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-03 10:21:16 -04:00
Lingao Meng
3911ce8d40 Bluetooth: Mesh: Mark as internal function
Marks funcs:`show_faults` as internal, avoiding conflict.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-03 10:21:16 -04:00
Krzysztof Kopyściński
c8a196c65b Tests: Bluetooth: Tester: enable EATT by default
Since Zephyr supports EATT, which is reflected in ICS GATT_2_3
(Enhanced ATT bearer Attribute Protocol Supported (L2CAP fixed EATT PSM
supported) and GATT_2_3a (Enhanced ATT bearer supported over LE)
in GATT tests preamble 4.2.1.4 (Setup EATT Bearer over LE) is used
instead of 4.2.1.2 (Setup ATT Bearer over LE). Let's enable
EATT by default, allowing to run almost all GATT tests without
additional overlay.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-08-03 13:56:41 +02:00
Omkar Kulkarni
6c41bf6135 bsim_bt: mesh: persistence storage testing
Adds support for testing of persistence storage
for mesh Babblesim tests. Adds a sample test
for testing provisioning data.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2021-07-29 13:29:03 +02:00
Vinayak Kariappa Chettimada
194a9674b8 tests: Bluetooth: bsim: Verify AD Data backup
Verify that AD Data when switching to Legacy Directed, and
restore it when switching back to Legacy Non-Directed
Advertising mode.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-26 15:29:55 +02:00
Kumar Gala
57690f566e tests: bluetooth: shell: Limit build only tests to native_posix
Some recent updates to the bluetooth shell test cause build failures
in CI for platforms that don't have a uart that supports interrupts
(ie ip_k66f or xmc45_relax_kit).

As these tests are build-only a single platform is sufficient to get
coverage and utilize platform_allow to limit to just one board target
intead of integration_platforms.  As this will limit to the single
platform for both PR based CI and nightly CI (integration_platforms
only is utilized for PR based CI, so we'd need other filtering for
the nightly CI and there isn't any value in building these tests
on more than the single platform so platform_allow makes the most
sense).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-23 11:29:30 -05:00
Michał Narajowski
0bca465cab Bluetooth: tester: Add Bond Lost API
In GAP/SEC/AUT/BV-22-C the IUT needs to inform the Upper Tester about a
lost bond.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-07-23 14:43:01 +03:00
Agata Ponitka
0f61c0c65f Bluetooth: tester: Add Key Refresh Procedures tests support
Add support for automatic testing of KRP.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
1dbfc40705 Bluetooth: tester: Add provisioner support
Add provisioning procedure for automatic testing.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
41024b60eb Bluetooth: tester: Add Mesh Health Client Model tests support
Add support for automatic testing of Mesh Health Client Models.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
b89003df86 Bluetooth: tester: Add Mesh Configuration Client tests support
Add support for automatic testing of Mesh Configuration Client Models.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Kumar Gala
d00b37c8dd tests: bluetooth: shell: Filter tests on dts "storage_partition"
Some of the shell tests need a devicetree "fixed-partition" and
"storage_partition" for the settings partition support.  Not all
boards support this, so filter the tests on the devicetree having
this.

Fixes #37115

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-21 13:11:03 -05:00
Vinayak Kariappa Chettimada
529bb8d863 tests: Bluetooth: bsim: Multiple central connections to peripherals
Babblesim test of Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Aleksandr Khromykh
632a1cb95a Bluetooth: Mesh: fix ble mesh bsim tests compile warnings
If bsim tests are built without errors then warnings are hidden.
A couple of them has sneaked in recent PRs.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-07-20 20:02:02 -04:00
Emil Gydesen
1c04a7505e Bluetooth: shell: Add bluetooth tag to shell tests
Add missing bluetooth tag for recently added tests in
the testcase.yaml file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-20 18:04:03 -04:00
Vinayak Kariappa Chettimada
82297d9245 tests: Bluetooth: bsim: Mesh test with BT_CTLR_LOW_LAT
Add tests to cover BT_CTLR_LOW_LAT options which is used by
nRF51 Series.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Vinayak Kariappa Chettimada
ba16f201f3 tests: Bluetooth: bsim: basic test with BT_CTLR_LOW_LAT
Add tests to cover BT_CTLR_LOW_LAT options which is used by
nRF51 Series.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Emil Gydesen
57b5c32e82 Bluetooth: shell: Add bt audio compile tests for the bt shell
Add a couple of compile tests for the bt shell for
BT audio, including checking that the services can be
compiled individually without error.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Vinayak Kariappa Chettimada
0cb3d31e54 tests: Bluetooth: Controller: Cover in-system tests in CI
Include the in-system tests Kconfig option in build-only and
babblesim tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Trond Einar Snekvik
e6000e60ee Bluetooth: Mesh: Test provisioning multiple devices
Adds a BabbleSim test for provisioning multiple devices in a row. This
scenario had a regression in #33782, which is fixed in #35405.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-07-13 19:21:17 +03:00
Ingar Kulbrandstad
3ec6411c7f Bluetooth: Mesh: Align capitalization for BT mesh
Align the capitalization of the term "Bluetooth Mesh" to Bluetooth mesh"
in the documentation. This is done to to match the new updated naming
convention done in Bluetooth SIG. In the upcoming spec versions, it its
used "Bluetooth mesh" with the lower case convention.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-07-13 11:23:54 -04:00
Aleksandr Khromykh
2f3a3e3b51 Bluetooth: Mesh: Tests of BLE Mesh beacon flags management
Tests check transmission, receiving beacons in situations
of IV update (with test mode on) and key refresh procedures.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-07-13 11:54:47 +03:00
Vinayak Kariappa Chettimada
ecbc17fc21 tests: Bluetooth: bsim: name adv_handle for advertising handle
Use the name adv_handle instead of index to store advertising
handle.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-12 13:19:46 +02:00