Bluetooth test robustness: reuse lib helpers and harden scan/firmware checks#214
Merged
abbajaj806 merged 5 commits intoqualcomm-linux:mainfrom Nov 18, 2025
Merged
Conversation
Add helpers for scan control, discovering state and controller visibility. Harden btfwloaded() to catch common firmware failure patterns in dmesg. Introduce bt_set_scan/bt_get_discovering/bt_ensure_controller_visible for reuse. Keep existing public-addr/bootstrap and adapter selection logic intact. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Honor BT_ADAPTER and --adapter before auto-detection. Keep existing findhcisysfs fallback when no override is given. Improve logging to clearly report which adapter is used. No functional change to power cycle logic or result handling. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Add BT_ADAPTER/--adapter and BT_SCAN_TARGET_MAC/BT_TARGET_MAC/--target-mac. Use bt_ensure_controller_visible, bt_set_scan and bt_get_discovering consistently. Validate either generic visibility or user-provided target MAC from devices list. Preserve .res PASS/FAIL/SKIP semantics with detailed logging for CI. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Support BT_ADAPTER and --adapter overrides for firmware/KMD checks. Fallback to findhcisysfs when no explicit adapter is provided. Skip the test cleanly when no HCI adapter can be detected. Keep existing btfwloaded-based firmware/KMD validation unchanged. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Drop duplicated BT helpers in favour of lib_bluetooth.sh implementations. Retain only generic logging, dependency, and common infra helpers here. Update callers to source lib_bluetooth.sh for adapter/scan operations. No change to existing test result (.res) handling semantics. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refines the Bluetooth validation flow and consolidates common logic into shared helpers to make CI results more meaningful and less flaky.
Key changes
BT_ON_OFF:
BT_SCAN:
BT_FW_KMD:
lib_bluetooth.sh:
functestlib.sh: