Skip to content

Conversation

@ardo-nordic
Copy link

Adding bsim tests for basic custom LTK feature functions, it's coexistence with SMP and some invalid scenarios.

Copilot AI review requested due to automatic review settings December 8, 2025 14:19
@NordicBuilder NordicBuilder added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Dec 8, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces bsim tests for the custom LTK (Long Term Key) feature in Bluetooth functionality. The tests verify basic custom LTK operations, its coexistence with the Security Manager Protocol (SMP), and various invalid scenarios.

Key Changes

  • Added comprehensive test suite with three test scripts covering basic functionality, SMP coexistence, and invalid scenarios
  • Implemented test cases for both central and peripheral roles
  • Created test infrastructure including configuration files and build setup

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/bluetooth/bsim/custom_ltk/testcase.yaml Test configuration defining build and platform requirements
tests/bluetooth/bsim/custom_ltk/test_scripts/custom_ltk_invalid.sh Shell script for testing invalid LTK scenarios
tests/bluetooth/bsim/custom_ltk/test_scripts/custom_ltk_coex.sh Shell script for testing custom LTK coexistence with SMP
tests/bluetooth/bsim/custom_ltk/test_scripts/custom_ltk.sh Shell script for testing basic custom LTK functionality
tests/bluetooth/bsim/custom_ltk/src/main.c Main test implementation with test vectors and callbacks
tests/bluetooth/bsim/custom_ltk/prj.conf Project configuration enabling required Bluetooth features
tests/bluetooth/bsim/custom_ltk/CMakeLists.txt CMake build configuration for the test suite

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


is_bondable = !is_bondable;
err = bt_conn_set_bondable(test_conn, is_bondable);
TEST_ASSERT(!err, "bt_conn_set_bondablefailed (%d).", err);
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between 'bondable' and 'failed' in error message.

Suggested change
TEST_ASSERT(!err, "bt_conn_set_bondablefailed (%d).", err);
TEST_ASSERT(!err, "bt_conn_set_bondable failed (%d).", err);

Copilot uses AI. Check for mistakes.

static void enable_passkey(void)
{
LOG_INF("Enable paskey");
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'paskey' to 'passkey'.

Suggested change
LOG_INF("Enable paskey");
LOG_INF("Enable passkey");

Copilot uses AI. Check for mistakes.
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Dec 8, 2025

CI Information

To view the history of this post, click the 'edited' button above
Build number: 5

Inputs:

Sources:

more details

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (0)

Outputs:

Toolchain

Version:
Build docker image:

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ❌ Toolchain
  • ❌ Build twister
  • ❌ Integration tests

Note: This message is automatically posted and updated by the CI

@NordicBuilder NordicBuilder removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Dec 8, 2025
Copilot AI review requested due to automatic review settings December 9, 2025 12:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ARRAY_FOR_EACH_PTR(tests, test) {
p_test = test;

if (test->conn_cb){
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace. Add a space between ')' and '{' to match the coding style used throughout the file.

Suggested change
if (test->conn_cb){
if (test->conn_cb) {

Copilot uses AI. Check for mistakes.
Adding bsim tests for basic custom LTK feature functions,
it's coexistence with SMP and some invalid scenarios.

Signed-off-by: Artur Dobrynin <[email protected]>
Copilot AI review requested due to automatic review settings December 9, 2025 13:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
int err;

err = bt_unpair(BT_ID_DEFAULT, BT_ADDR_LE_ANY);
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tab character used for indentation instead of space. This is inconsistent with the surrounding code which uses spaces.

Suggested change
err = bt_unpair(BT_ID_DEFAULT, BT_ADDR_LE_ANY);
err = bt_unpair(BT_ID_DEFAULT, BT_ADDR_LE_ANY);

Copilot uses AI. Check for mistakes.
@ardo-nordic ardo-nordic marked this pull request as ready for review December 9, 2025 14:34
@ardo-nordic ardo-nordic requested review from a team as code owners December 9, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants