Commit graph

2,691 commits

Author SHA1 Message Date
Lyle Zhu
b6f555b750 Bluetooth: tester: Support BR L2CAP send data command
If the channel id is more than ARRAY_SIZE(channels), send L2CAP data
through BR transport.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-24 17:19:20 +01:00
Emil Gydesen
7bbf704f60 tests: Bluetooth: Tester: Add validation of preconfig values
Add checks for the values in btp_ascs_preconfigure_qos
to determine if they are valid. If they are invalid
we reject the command.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-22 05:11:54 -05:00
Aleksandr Khromykh
f93e78b7f7 tests: bluetooth: tester: fix model rx handler
Commit fixes the model rx handler.
Model can receive maximum access payload.
Test should be able fit maximum access payload and
its own header for serial communication.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-11-20 08:59:31 -05:00
Emil Gydesen
318067ec6c tests: Bluetooth: tester: Removed bad guard in btp_gap.h
As per the Zephyr coding guidelines, functions declarations
in header files should not be conditionally compiled.

This fixes an issue with tester_gap_clear_adv_instance
where btp_gap.c always expect it to be available.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-20 08:58:56 -05:00
John Batch
3c126ef124 tests: cyw920829m2evk_02: Updating tests boards for multiple socs
Updating supported tests for the cyw920829m2evk_02 board to support
multiple socs.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-11-20 06:02:48 -05:00
Timothy Keys
6bfa6fa9a8 bluetooth: host: shell: Add SCI shell commands
This adds support for Shorter Connection Interval commands in the bt
shell.

Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
2025-11-19 09:15:18 -05:00
Timothy Keys
c14dcaf199 bluetooth: host: Change uses of interval to interval_us
Since Shorter Connection Intervals changes the unit that connection
intervals can be represented in. It is necessary to change how
they are stored and represented.

This commit deprecates interval in favour of interval_us.

Remove use of interval in internal bt_conn struct since it is no longer
needed.

Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
2025-11-19 09:15:18 -05:00
Pavel Vasilyev
116d4ddb89 tests: bluetooth: qualification: Remove data signing related ICS
This commit removes data signing related ICS.

Removed ICS:
- SM 6/1: Signing Algorithm Generation
- SM 6/2: Signing Algorithm Resolving
- GATT 3/13: Signed Write Without Response
- GATT 9/10: Signed Write Command
- GATT 7/3: LE Security mode 2
- GAP 25/2: LE Security mode 2
- GAP 35/2: LE Security mode 2
- GAP 25/5: Connection data signing procedure
- GAP 35/5: Connection data signing procedure
- GAP 25/6: Authenticate signed data procedure
- GAP 35/6: Authenticate signed data procedure
- GAP 27b/8: Connection Signature Resolving Key (CSRK)
- GAP 37b/8: Connection Signature Resolving Key (CSRK)

The following tests are not supported any longer:
- GAP/SEC/CSIGN/BI-01-C
- GAP/SEC/CSIGN/BI-02-C
- GAP/SEC/CSIGN/BI-03-C
- GAP/SEC/CSIGN/BI-04-C
- GAP/SEC/CSIGN/BV-01-C
- GAP/SEC/CSIGN/BV-02-C
- GATT/CL/GAW/BV-02-C
- SM/CEN/SIGN/BV-01-C

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-11-19 06:52:38 -05:00
Pavel Vasilyev
66679c1886 tests: bluetooth: init: Remove duplicate prj_<x>.conf files
Remove duplicated prj.conf file.

prj_6, prj_7, prj_14 are identicall. Since prj_6.conf is unchanged,
keeping it.

prj_8, prj_9, prj_15 are identicall. Since prj_15.conf is
unchanged, keeping it.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-11-19 06:52:38 -05:00
Pavel Vasilyev
b7b35b89ed bluetooth: host: Deprecate CONFIG_BT_SIGNING
This commit deprecates:
- the `CONFIG_BT_SIGNING` Kconfig option
- `BT_GATT_CHRC_AUTH` property

IOW, this commit deprecates the LE Security mode 2 support.

Explanation:

Erratum ES-26047 introduced in Bluetooth Core Specification v6.2
requires SingCounter to be persistently stored to prevent replay
attacks.

Currently, the Host doesn't store SignCounter, therefore the device is
vulnerable to replay attacks after reboot.

Additionally, the current implementation doesn't assume that SignCounter
of a received message can be incremented by more than one and thus may
not validate correct message.

The Bluetooth Security and Privacy Best Practices Guide recommends to
not using Data signing and recommends to use LE Security mode 1 levels
2, 3 or 4 instead.

The Signed Write Without Response sub-procedure, which is the only user
of Data signing, is optional (see Vol 3, Part G, Table 4.1).

See also ES-18901.

The aforementioned reasons make no sense to keep this feature.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-11-19 06:52:38 -05:00
Aleksandr Khromykh
613d228002 bluetooth: mesh: update max oob size till 32 bytes
Commit updates maximum OOB authentication size from 8 bytes
till 32 bytes according to specification errata ES-27446.
Since previous OOB API does not allow to expose OOB values
with such width the new API has been introduced.
The previous API was deprecated and hidden under
BT_MESH_PROV_OOB_API_LEGACY option and left for backward
compatibility with existing code base.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-11-18 10:48:18 -05:00
Frode van der Meeren
48f82d1e34 tests: bluetooth: tester: Fix VCS tests
Zephyr automatically sets the persisted flag for VCS if the volume is
changed after the service is registered. As some of these PTS tests
require a set volume with the flag cleared, the initial volume needs to
be set before registering VCS.

Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
2025-11-18 10:48:01 -05:00
Emil Gydesen
42ad1a3821 tests: Bluetooth: Tester: Increase ISO buffers
The ISO buffers defaults to 1, but since there are
risks that the ISO RX events cannot be sent to
the upper tester via UART before the next RX,
the RX is increased. This also allows to better
support cases where the ISO interval is larger than
the SDU interval.
The ISO TX buffers are similarly increase to help
prevent cases where a TX isn't scheduled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-18 10:45:41 -05:00
Alexander Svensen
52f2686de6 tests: bluetooth: tester: CSIS: Add more commands
- Add command for setting the set size
- Add command for setting the SIRK
- Allows the following tests to pass:
 - CSIS/SR/CN/BV-01-C
 - CSIS/SR/CN/BV-02-C
 - CSIS/SR/CN/BV-03-C
 - CSIS/SR/CN/BV-04-C

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-11-18 08:12:06 -05:00
Josuah Demangeon
e6e7fc549e style: tests: apply coding style on CMakeLists.txt files
Apply the CMake style guidelines to CMakeList.txt files in tests/.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Lyle Zhu
3f201d5c5f Bluetooth: Classic: shell: Add cover art shell commands
Add cover art shell commands for AVRCP controller and target.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-17 10:58:06 -05:00
Frode van der Meeren
03bfafe05e tests: bluetooth: tester: Fix CSIS/SR/SP/BV-07-C
This particular test-case requires bttester to respond with an OOB
procedure SIRK only error. To enable this response, the BTP command to
set SIRK mode has been extended with a new selection.

Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
2025-11-17 10:57:28 -05:00
Lyle Zhu
270a2e6584 Bluetooth: shell: Add BIP shell commands
Add commands for transport over RFCOMM, including `register-rfcomm`,
`connect-rfcomm`, and `disconnect-rfcomm`.

Add commands for transport over L2CAP, including `register-l2cap`,
`connect-l2cap`, and `disconnect-l2cap`.

Add command `alloc-buf` and `release-buf` to allocate and release TX
buffer.

Add command set `add-header` to add the OBEX headers to allocated TX
buffer.

Add command set `client` to send BIP client requests with allocated
TX buffer.

Add command set `server` to send BIP responses with allocated TX
buffer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-14 10:31:16 +02:00
Alexander Svensen
fa7d9bf09c tests: bluetooth: tester: Fix bis_sink_sync
- Allows the tester to match on either ID or addr
- Previously required that both needed to match, but Auto-PTS is sending
  the wrong address

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-11-13 20:44:02 -05:00
Omkar Kulkarni
e6ba8a6ade Bluetooth: Mesh: Test network cache improvement
Adds a test that checks that the network message cache differentiates
between PDUs with the same SRC and SEQ but different NetKey Index.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2025-11-13 20:36:24 -05:00
Alexander Svensen
c4ab06b9c4 tests: bluetooth: tester: Add ASE ID when configuring codec
- We want to add the ASE ID to a stream as early as possible
  to make sure the events coming from BTTester to Auto-PTS
  contains the correct information.
- Previously the events that came before stream_configured
  would contain ASE ID 0, regardless of actual value.

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-11-13 23:15:36 +02:00
Emil Gydesen
29f097b2c5 tests: Bluetooth: tester: Add info on running with native_sim
Add a few useful commands and information when running the
BT Tester with native_sim, either with or without the
Zephyr controller.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-12 14:38:23 +02:00
Troels Nilsson
22fe7680f8 Bluetooth: Controller: Various fixes for CIS termination handling
Handling of CIS termination had several issues, most notably:

- it depended on allocating a termination node from the general rx
  node pool, causing asserts if the pool was exhausted
- CIS established events was not always generated when required,
  potentially causing CIS Centrals to get stuck without being able
  to create any new CISes
- Cancelling a CIS Create procedure only worked correctly if the
  CIS Create was currently active and happened to belong to the
  same CIS
- CIG state handling often (always?) assumed a CIG with only one CIS

ll_conn_iso_stream now has a dedicated termination node, same as
ll_conn and ll_sync_iso_set

LLCP statemachine for Cis Create procedure has been reworked to ensure
a notification node for CIS Established is available as early as possible.
In addition, it should now always be sent when needed

Introduced ull_central_iso_all_cises_terminated() to check if all CISes
in a CIG has been terminated (or not created yet) - which is now
used for updating the CIG state

ull_cp_cc_cancel() now takes the CIS to cancel as an argument so
it doesn't end up canceling an entirely different CIS Create procedure;
In addition it now works for queued procedures as well

Flushing a (central) CIS Create procedure in LLCP will now properly
generate a CIS Established event (with an error)

Signed-off-by: Troels Nilsson <trnn@demant.com>
2025-11-08 10:22:00 +02:00
Szymon Janc
184f053bca tests: Bluetooth: Tester: Fix NULL pointer dereference
PA sync can be terminated before BIG sync is stopped. This results
in ps_sync being NULL and thus crash in stop callback. Simply store
address needed by BTP events and don't rely on pa_sync.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-11-07 06:52:03 -05:00
Szymon Janc
0ab5005304 tests: Bluetooth: Tester: Fix GATT Notify Multiple BTP command
This fix multiple issues with command implementation:
 - lack of LE to host convertion
 - using strtoul() on non-string data
 - passing stack variable as attr data (which must be present until
   notification is sent)

This was affecting GATT/SR/GAN/BV-02-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-11-06 12:29:59 +02:00
Szymon Janc
d054025fa3 tests: Bluetooth: Tester: Implement TBS Terminate Call BTP command
This allows upper tester to terminate existing call.
Was affecting TMAP/CG/VRC/BV-01-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-11-04 16:56:28 +02:00
Szymon Janc
a3aa51393b Bluetooth: tester: Fix TBS Originate Call BTP command
bt_tbs_originate() returns assigned Call ID as non-negative value.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-11-03 17:00:08 +02:00
Anas Nashif
303af992e5 style: fix 'if (' usage in cmake files
Replace with 'if(' and 'else(' per the cmake style guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-29 11:44:13 +02:00
Szymon Janc
6dfad60de7 tests: bt: host: mock z_sys_post_kernel
unit tests needs mocking for z_sys_post_kernel.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-28 17:40:42 +02:00
Lyle Zhu
d3bae1d442 tests: Bluetooth: SDP: Wait for DUT connect event before send any cmd
There is a corner case found that the ACL connected event may be
printed when script is sending shell command by calling function
`shell.exec_command()`. The echo of shell command will mix with the
ACL connected event message. The received message cannot be
recognized by the function `shell.exec_command()`. It caused the
timeout exception reported by the function `shell.exec_command()`.

Before sending any shell commands, check the DUT connected event
after the connection is established on script side.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-28 11:50:26 +02:00
Can Wang
d64c8a9c0f tests: Bluetooth: BR: fix import error in smp_general test suite.
Because HCI_XXX_IO_CAPABILITY is removed from bumble v0.0.214.

Signed-off-by: Can Wang <can.wang@nxp.com>
2025-10-24 09:45:11 +03:00
Szymon Janc
b79ef27f14 tests: Bluetooth: Tester: Fix accessing out of scope variables in VCP
Input and output descriptors are writable storage for VCP parameters
and shall be valid for use duration. This fix usage of variables being
used outside of their declaration scope.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-23 15:55:31 -04:00
Vinayak Kariappa Chettimada
796c0002f8 Bluetooth: Controller: Introduce LL_ASSERT_DBG/ERR
Introduce development and fatal assertion classification
in the Controller implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-23 11:43:10 +03:00
Håvard Reierstad
b6252b57aa Bluetooth: Host: shell: Don't use BT_FIXED_PASSKEY
Updates the bt shell API to use the new Kconfig option
BT_APP_PASSKEY instead of BT_FIXED_PASSKEY as this is being
deprecated.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-10-22 16:01:08 +03:00
Alexander Svensen
4896194be8 tests: bluetooth: Recycle ext_adv_sets when stopping adv
- We want to reuse ext_advs when first stopped and restarted
- This ensures SID is the same
- Fixes CAP/CL/ADV/BV-03-C

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-10-22 15:55:10 +03:00
Szymon Janc
719fd299ab tests: Bluetooth: Tester: Enable CONFIG_ASAN for native target
This helps in finding issues in code and produces helpfull trace
in case of segmentation fault.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-17 21:04:57 -04:00
Valerio Setti
019e26aecf bluetooth: mesh: use new Kconfig CONFIG_PSA_CRYPTO
Remove previous Kconfig choices CONFIG_BT_MESH_USES_MBEDTLS_PSA and
CONFIG_BT_MESH_USES_TFM_PSA and use CONFIG_PSA_CRYPTO instead.
This commit also updates test code accordingly.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Tim Pambor
30cdbd3dfc tests: bluetooth: controller: Fix too many arguments for format error
Remove additional NULL argument passed to zassert_not_null that caused
a -Wformat error.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-10-16 17:15:11 -07:00
Johan Hedberg
46dddc5e51 Bluetooth: samples/tests: Update auto PHY usage to recent changes
Remove deprecated Kconfig option usage, and replace it with corresponding
options which yield the same behavior as before.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-10-14 18:53:08 +02:00
Szymon Janc
aa24a28809 Revert "Bluetooth: tester: Tune native_sim HCI configuration"
Those are not applied properly as subsequent overlays may (and
actually do!) overwrite some of configurations tuned in here.
Also with latest improvements in userchannel HCI driver low
buffers are handled in similar way as on real boards so no extra
tuning is needed anyway.

This reverts commit b6e7b650a2.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-14 18:52:37 +02:00
Petri Pitkanen
022de69491 tests: Bluetooth: Tester: Add support for scan parameters
Add new command to set scanning parameters, including scan window,
scan interval, and physical interface (1M and coded PHYs).

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-10-14 12:52:13 +03:00
Can Wang
0610da60e6 tests: Bluetooth: BR: fix import error in smp_io_cap test suite.
Because HCI_XXX_IO_CAPABILITY is removed from bumble v0.0.214.

Signed-off-by: Can Wang <can.wang@nxp.com>
2025-10-14 12:51:13 +03:00
Petri Pitkanen
f04d0196de test: Bluetooth: tester: Add support for EAD peripheral
Added three functions to support the EAD peripheral:
    - Setting and storing key materials for EAD
    - Encrypting data for EAD advertisements
    - Decrypting data from EAD advertisements

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-10-13 09:36:11 -04:00
Emil Gydesen
1c004a08c3 Bluetooth: CCP: Client: Add support for get provider name
Add support for getting the remote bearer provider
name.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-13 08:43:47 +02:00
Szymon Janc
8c13c0740c tests: bluetooth: tester: Fix extra newline in logs
LOG_INF macro already adds newline at the line end.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-08 10:09:56 +02:00
Emil Gydesen
1e436f43d1 tests: Bluetooth: PACS: Modify unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-08 10:09:33 +02:00
Emil Gydesen
af00bc5a90 tests: Bluetooth: Codec: Modify unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-08 10:09:27 +02:00
Emil Gydesen
35a4613bf7 tests: Bluetooth: Controller: Fix bad string formats
A handful of Bluetooth controller tests were using %d for
non-int values. Some of the values were either uint64_t or
long unsigned ints.

In most cases, the types could be modified to uint8_t and
the formats changed to use %u.
In some macros, the types were just cast, as the values
would never be larger than uint8_t. The values in this case
were defined as e.g. BIT(0), BIT(1) and BIT(2) (which use the
UL type in the macro).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-08 08:45:37 +02:00
Emil Gydesen
d9a691c2bf tests: Bluetooth: BAP: Modify BASE unittests to native_sim
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.

This commit also removes unused includes in the CMakelists.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-08 08:44:52 +02:00
Ravinder Singh
0520dfe8ff Bluetooth: Tester: Fixed read_multiple_var
read_multi_var was always sending 5 as count of handles.
This was causing failure in GATT/CL/GAR/BI-36-C, GATT/CL/GAR/BI-40-C
and other tests expecting IUT to send
GATT_ReadMultipleVariableLengthRequest
Fixed this was using the cp->handles_count coming by autoPTS.

Signed-off-by: Ravinder Singh <ravinder.singh2@infineon.com>
2025-10-07 12:50:21 +02:00