diff --git a/Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/BT_ON_OFF.yaml b/Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/BT_ON_OFF.yaml new file mode 100644 index 00000000..96a85f21 --- /dev/null +++ b/Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/BT_ON_OFF.yaml @@ -0,0 +1,19 @@ +metadata: + name: bt-on-off + format: "Lava-Test Test Definition 1.0" + description: "Toggle Bluetooth on/off using qcom-linux-testkit BT_ON_FF" + os: + - linux + scope: + - functional + +run: + steps: + - cd Runner + - REPO_ROOT="$PWD" + - RPATH="$REPO_ROOT/suites/Connectivity/Bluetooth/BT_ON_FF/run.sh" + - RESFILE="$REPO_ROOT/suites/Connectivity/Bluetooth/BT_ON_FF/BT_ON_FF.res" + - rm -f "$RESFILE" 2>/dev/null || true + - "$RPATH" || true + - "$REPO_ROOT/utils/send-to-lava.sh" "$RESFILE" || true + - "$REPO_ROOT/utils/result_parse.sh" || true diff --git a/Runner/suites/Connectivity/Bluetooth/BT_ON_FF/README.md b/Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/README.md similarity index 100% rename from Runner/suites/Connectivity/Bluetooth/BT_ON_FF/README.md rename to Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/README.md diff --git a/Runner/suites/Connectivity/Bluetooth/BT_ON_FF/run.sh b/Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/run.sh similarity index 100% rename from Runner/suites/Connectivity/Bluetooth/BT_ON_FF/run.sh rename to Runner/suites/Connectivity/Bluetooth/BT_ON_OFF/run.sh diff --git a/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/bt_scan_pair.yaml b/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/bt_scan_pair.yaml new file mode 100644 index 00000000..eb956f4c --- /dev/null +++ b/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/bt_scan_pair.yaml @@ -0,0 +1,24 @@ +metadata: + name: bt-scan-pair + format: "Lava-Test Test Definition 1.0" + description: "Pair/connect to a BT device using qcom-linux-testkit BT_SCAN_PAIR" + os: + - Yocto + - Ubuntu + - Debina + scope: + - functional + +params: + bt_mac: "" + bt_name: "" + whitelist: "" + pair_retries: "3" + scan_attempts: "2" + +run: + steps: + - cd qcom-linux-testkit/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR + - ./run.sh + - ../../../../utils/send-to-lava.sh ./BT_SCAN_PAIR.res || true + - ../../../../utils/result_parse.sh || true diff --git a/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/run.sh b/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/run.sh index d4a585ed..e36be5e3 100755 --- a/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/run.sh +++ b/Runner/suites/Connectivity/Bluetooth/BT_SCAN_PAIR/run.sh @@ -1,8 +1,6 @@ #!/bin/sh - # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. # SPDX-License-Identifier: BSD-3-Clause-Clear - # Robustly find and source init_env SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" INIT_ENV="" @@ -42,29 +40,170 @@ rm -f "$RES_FILE" log_info "------------------------------------------------------------" log_info "Starting $TESTNAME Testcase" +# ------------------- Minimal long-option support (multi-line) ------------------- +# Env defaults are honored; long options update variables; positional fallback remains. + # Defaults PAIR_RETRIES="${PAIR_RETRIES:-3}" SCAN_ATTEMPTS="${SCAN_ATTEMPTS:-2}" -BT_NAME="" -BT_MAC="" -WHITELIST="" +# Accept env overrides for identity too (optional) +BT_NAME="${BT_NAME:-}" +BT_MAC="${BT_MAC:-}" +WHITELIST="${WHITELIST:-}" + +# Params from LAVA (lowercase -> our uppercase) – only if not already set +if [ -z "${BT_MAC:-}" ] && [ -n "${bt_mac:-}" ]; then + BT_MAC="$bt_mac" +fi + +if [ -z "${BT_NAME:-}" ] && [ -n "${bt_name:-}" ]; then + BT_NAME="$bt_name" +fi + +if [ -z "${WHITELIST:-}" ] && [ -n "${whitelist:-}" ]; then + WHITELIST="$whitelist" +fi + +# Numeric knobs (pair/scan) – use if provided and numeric (multi-line) +case "${pair_retries:-}" in + ''|*[!0-9]*) + : + ;; + *) + PAIR_RETRIES="$pair_retries" + ;; +esac + +case "${scan_attempts:-}" in + ''|*[!0-9]*) + : + ;; + *) + SCAN_ATTEMPTS="$scan_attempts" + ;; +esac + +usage_bt() { + cat <