Skip to content

Commit c3881a1

Browse files
committed
BT_ON_OFF: use btloghcidiag and robust btgetpower interactive parsing
Call btloghcidiag() after adapter selection and before controller checks so failures provide immediate service/journal context. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent 4a680b5 commit c3881a1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • Runner/suites/Connectivity/Bluetooth/BT_ON_OFF

Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/run.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ elif findhcisysfs >/dev/null 2>&1; then
102102
else
103103
ADAPTER=""
104104
fi
105-
105+
106106
if [ -n "$ADAPTER" ]; then
107107
log_info "Using adapter: $ADAPTER"
108108
else
@@ -111,8 +111,13 @@ else
111111
exit 0
112112
fi
113113

114+
# --- NEW: warn/diag if non-interactive "bluetoothctl list" is empty (non-fatal) ---
115+
btwarniflistempty "$ADAPTER" || true
116+
114117
# Ensure controller is visible to bluetoothctl (try public-addr if needed)
115118
if ! bt_ensure_controller_visible "$ADAPTER"; then
119+
# --- NEW: print diagnostics before skipping ---
120+
btloghcidiag "$ADAPTER"
116121
log_warn "SKIP — no controller visible to bluetoothctl (HCI RAW/DOWN or attach incomplete)."
117122
echo "$TESTNAME SKIP" > "$res_file"
118123
exit 0
@@ -154,6 +159,9 @@ after_on="$(btgetpower "$ADAPTER" 2>/dev/null || true)"
154159
[ -z "$after_on" ] && after_on="unknown"
155160

156161
if [ "$after_on" = "yes" ]; then
162+
# --- NEW: post-check (covers your "list is empty after run" symptom) ---
163+
btwarniflistempty "$ADAPTER" || true
164+
157165
log_pass "Post-ON verification: Powered=yes (as expected)."
158166
echo "$TESTNAME PASS" > "$res_file"
159167
exit 0

0 commit comments

Comments
 (0)