Skip to content

Commit 2b50999

Browse files
authored
Merge branch 'main' into feature/gstchange
Signed-off-by: nitinn22 <nitinn@qti.qualcomm.com>
2 parents 8b2f32c + 69d01e7 commit 2b50999

129 files changed

Lines changed: 1293 additions & 720 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Qualcomm Preflight Checks
22
on:
3-
pull_request_target:
3+
pull_request:
44
branches: [ "main" ]
55
push:
66
branches: [ "main" ]
@@ -11,14 +11,13 @@ permissions:
1111
security-events: write
1212

1313
jobs:
14-
qcom-preflight-checks:
15-
uses: qualcomm/qcom-reusable-workflows/.github/workflows/qcom-preflight-checks-reusable-workflow.yml@v1.1.4
14+
preflight:
15+
name: Run QC Preflight Checks
16+
uses: qualcomm/qcom-reusable-workflows/.github/workflows/reusable-qcom-preflight-checks-orchestrator.yml@v2
1617
with:
17-
# ✅ Preflight Checkers
18-
repolinter: true # default: true
19-
semgrep: true # default: true
20-
copyright-license-detector: true # default: true
21-
pr-check-emails: true # default: true
22-
dependency-review: true # default: true
23-
secrets:
24-
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
18+
enable-semgrep-scan: true
19+
enable-dependency-review: true
20+
enable-repolinter-check: true
21+
enable-copyright-license-check: true
22+
enable-commit-email-check: true
23+
enable-commit-msg-check: false

CONTRIBUTING.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2-
# SPDX-License-Identifier: BSD-3-Clause-Clear
3-
2+
# SPDX-License-Identifier: BSD-3-Clause
43
# 🛠️ Contributing to qcom-linux-testkit
54

65
Thank you for considering contributing to the **qcom-linux-testkit** project! Your contributions help improve the quality and functionality of our test suite. Please follow the guidelines below to ensure a smooth contribution process.
@@ -78,8 +77,7 @@ Runner/
7877

7978
```sh
8079
#!/bin/sh
81-
# SPDX-License-Identifier: BSD-3-Clause-Clear
82-
80+
# SPDX-License-Identifier: BSD-3-Clause
8381
#Source init_env and functestlib.sh
8482
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8583
INIT_ENV=""
@@ -160,8 +158,7 @@ Ensure that all new files include the appropriate license header:
160158

161159
```sh
162160
#!/bin/sh
163-
# SPDX-License-Identifier: BSD-3-Clause-Clear
164-
```
161+
# SPDX-License-Identifier: BSD-3-Clause```
165162

166163
---
167164

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
22

3-
SPDX-License-Identifier: BSD-3-Clause-Clear
3+
SPDX-License-Identifier: BSD-3-Clause

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,4 @@ These tests can be used as CI jobs in:
111111

112112
```
113113
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
114-
SPDX-License-Identifier: BSD-3-Clause-Clear
115-
```
114+
SPDX-License-Identifier: BSD-3-Clause```

Runner/init_env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/sh
22

33
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
4-
# SPDX-License-Identifier: BSD-3-Clause-Clear
5-
4+
# SPDX-License-Identifier: BSD-3-Clause
65
# Idempotency guard: only initialize ONCE per shell session
76
[ -n "$__INIT_ENV_LOADED" ] && return
87
__INIT_ENV_LOADED=1

Runner/run-test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/sh
22

33
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
4-
# SPDX-License-Identifier: BSD-3-Clause-Clear
5-
4+
# SPDX-License-Identifier: BSD-3-Clause
65
# Resolve the real path of this script
76
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
87

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/sh
22
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3-
# SPDX-License-Identifier: BSD-3-Clause-Clear
4-
#
3+
# SPDX-License-Identifier: BSD-3-Clause#
54
# BT_FW_KMD_Service - Bluetooth FW + KMD + service + controller infra validation
65
# Non-expect version, using lib_bluetooth.sh helpers.
76

@@ -210,7 +209,18 @@ else
210209
fi
211210

212211
log_info "=== bluetoothctl list (controllers) ==="
213-
bluetoothctl list 2>/dev/null || true
212+
213+
out="$(bluetoothctl list 2>/dev/null | sanitize_bt_output || true)"
214+
if printf '%s\n' "$out" | grep -qi '^[[:space:]]*Controller[[:space:]]'; then
215+
# Non-interactive worked print what we got
216+
printf '%s\n' "$out"
217+
else
218+
# Non-interactive printed no controllers → retry using interactive method
219+
log_warn "bluetoothctl list returned no controllers in non-interactive mode, retrying interactive list."
220+
221+
log_info "=== bluetoothctl list (controllers) ==="
222+
btctl_script "list" "quit" | sanitize_bt_output || true
223+
fi
214224

215225
log_info "=== lsmod (subset: BT stack) ==="
216226
lsmod 2>/dev/null | grep -E '^(bluetooth|hci_uart|btqca|btbcm|rfkill|cfg80211)\b' || true

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/sh
22
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3-
# SPDX-License-Identifier: BSD-3-Clause-Clear
4-
# BT_ON_OFF - Basic Bluetooth power toggle validation (non-expect version)
3+
# SPDX-License-Identifier: BSD-3-Clause# BT_ON_OFF - Basic Bluetooth power toggle validation (non-expect version)
54

65
# Robustly find and source init_env
76
SCRIPT_DIR="$(
@@ -103,7 +102,7 @@ elif findhcisysfs >/dev/null 2>&1; then
103102
else
104103
ADAPTER=""
105104
fi
106-
105+
107106
if [ -n "$ADAPTER" ]; then
108107
log_info "Using adapter: $ADAPTER"
109108
else
@@ -112,8 +111,13 @@ else
112111
exit 0
113112
fi
114113

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

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

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

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/sh
22
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3-
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
# SPDX-License-Identifier: BSD-3-Clause#
44
# BT_SCAN – Bluetooth scanning validation (non-expect version)
5+
56
# ---------- Repo env + helpers ----------
67
SCRIPT_DIR="$(
78
cd "$(dirname "$0")" || exit 1
@@ -69,9 +70,12 @@ rm -f "$res_file"
6970

7071
log_info "------------------------------------------------------------"
7172
log_info "Starting $TESTNAME Testcase"
72-
log_info "Checking dependency: bluetoothctl"
73+
log_info "Checking dependencies: bluetoothctl pgrep"
7374

74-
check_dependencies bluetoothctl pgrep
75+
if ! check_dependencies bluetoothctl pgrep; then
76+
echo "$TESTNAME SKIP" > "$res_file"
77+
exit 0
78+
fi
7579

7680
# -----------------------------
7781
# 1. Ensure bluetoothd is running
@@ -168,10 +172,12 @@ log_info "Discovering state after scan ON window: $dstate_on"
168172

169173
# -----------------------------
170174
# 7. Get devices list after scan ON
175+
# - Try non-interactive bluetoothctl first
176+
# - If empty/flaky, fallback to btctl_script "devices" "quit"
171177
# -----------------------------
172178
devices_out="$(
173-
bluetoothctl devices 2>/dev/null \
174-
| sanitize_bt_output
179+
bt_list_devices_raw 2>/dev/null \
180+
| grep '^Device ' || true
175181
)"
176182

177183
if [ -n "$TARGET_MAC" ]; then
@@ -205,31 +211,17 @@ fi
205211
# -----------------------------
206212
log_info "Testing scan OFF..."
207213
if ! bt_set_scan off "$ADAPTER"; then
208-
log_warn "bt_set_scan(off) returned non-zero continuing with Discovering check."
214+
# bt_set_scan(off) can be flaky on minimal images; rely on poll helper
215+
log_warn "bt_set_scan(off) returned non-zero; continuing with scan-off polling."
209216
fi
210217

211-
SCAN_OFF_OK=0
212-
ITER=10
213-
i=1
214-
while [ "$i" -le "$ITER" ]; do
215-
dstate_off="$(bt_get_discovering 2>/dev/null || true)"
216-
[ -z "$dstate_off" ] && dstate_off="unknown"
217-
218-
log_info "Discovering state during scan OFF wait (iteration $i/$ITER): $dstate_off"
219-
220-
if [ "$dstate_off" = "no" ]; then
221-
SCAN_OFF_OK=1
222-
break
223-
fi
224-
225-
sleep 2
226-
i=$((i + 1))
227-
done
228-
229-
if [ "$SCAN_OFF_OK" -eq 1 ]; then
230-
log_pass "Discovering=no observed after scan OFF polling."
218+
# Use lib helper to avoid repetitive log spam and handle 'unknown' cleanly.
219+
if bt_scan_poll_off 10 1; then
220+
# On minimal/ramdisk images bt_scan_poll_off may treat persistent 'unknown' as non-fatal.
221+
log_pass "Scan OFF cleanup completed."
231222
else
232-
log_warn "Discovering did not transition to 'no' after scan OFF window."
223+
# If you keep bt_scan_poll_off strict, this may still warn; not a test failure.
224+
log_warn "Scan OFF cleanup did not confirm Discovering=no (non-fatal)."
233225
fi
234226

235227
echo "$TESTNAME PASS" > "$res_file"

Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/BT_SCAN_PAIR_README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,4 @@ When a whitelist is specified (CLI or `BT_WHITELIST_ENV`), only devices whose MA
121121

122122
## License
123123

124-
SPDX-License-Identifier: BSD-3-Clause-Clear
125-
© Qualcomm Technologies, Inc. and/or its subsidiaries.
124+
SPDX-License-Identifier: BSD-3-Clause© Qualcomm Technologies, Inc. and/or its subsidiaries.

0 commit comments

Comments
 (0)