-
Notifications
You must be signed in to change notification settings - Fork 1.4k
tests: bluetooth: custom LTK feature tests #26148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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); |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
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.
| TEST_ASSERT(!err, "bt_conn_set_bondablefailed (%d).", err); | |
| TEST_ASSERT(!err, "bt_conn_set_bondable failed (%d).", err); |
|
|
||
| static void enable_passkey(void) | ||
| { | ||
| LOG_INF("Enable paskey"); |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
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'.
| LOG_INF("Enable paskey"); | |
| LOG_INF("Enable passkey"); |
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:more detailsGithub labels
List of changed files detected by CI (0)Outputs:ToolchainVersion: Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
28ea309 to
471fcef
Compare
471fcef to
3a2a3d0
Compare
There was a problem hiding this 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){ |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
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.
| if (test->conn_cb){ | |
| if (test->conn_cb) { |
3a2a3d0 to
6b35c1f
Compare
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]>
6b35c1f to
2a073b6
Compare
There was a problem hiding this 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); |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
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.
| err = bt_unpair(BT_ID_DEFAULT, BT_ADDR_LE_ANY); | |
| err = bt_unpair(BT_ID_DEFAULT, BT_ADDR_LE_ANY); |
Adding bsim tests for basic custom LTK feature functions, it's coexistence with SMP and some invalid scenarios.