From db0e5caa8bd2d1227d453d497e282f0fed60e461 Mon Sep 17 00:00:00 2001 From: Srikanth Muppandam Date: Wed, 8 Oct 2025 21:14:45 +0530 Subject: [PATCH 1/4] functestlib: add get_remoteproc_path_by_firmware() to fix WiFi_Firmware_Driver Problem - WiFi_Firmware_Driver failed with: `get_remoteproc_path_by_firmware: command not found`. - The runner expects a helper to resolve the remoteproc sysfs path for a given firmware (e.g., `wpss.mbn` on Kodiak/qcm6490/WCN6750), but the function was missing. Signed-off-by: Srikanth Muppandam --- Runner/utils/functestlib.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Runner/utils/functestlib.sh b/Runner/utils/functestlib.sh index 76f744c..4e24a54 100755 --- a/Runner/utils/functestlib.sh +++ b/Runner/utils/functestlib.sh @@ -1264,6 +1264,19 @@ dt_has_remoteproc_fw() { return 1 } +# Find the remoteproc path for a given firmware substring (e.g., "adsp", "cdsp", "gdsp"). +get_remoteproc_path_by_firmware() { + name="$1" + idx path + # List all remoteproc firmware nodes, match name, and return the remoteproc path + idx=$(cat /sys/class/remoteproc/remoteproc*/firmware 2>/dev/null | grep -n "$name" | cut -d: -f1 | head -n1) + [ -z "$idx" ] && return 1 + idx=$((idx - 1)) + path="/sys/class/remoteproc/remoteproc${idx}" + [ -d "$path" ] && echo "$path" && return 0 + return 1 +} + # Get remoteproc state get_remoteproc_state() { rp="$1" From d659870da2f261ba43595c9ef9d8e38643605b1d Mon Sep 17 00:00:00 2001 From: Srikanth Muppandam Date: Wed, 8 Oct 2025 21:36:16 +0530 Subject: [PATCH 2/4] WiFi_Dynamic_IP: add --ssid/--password CLI - Accepts new CLI flags: --ssid and --password . - If provided, these override positional args; otherwise falls back to the existing get_wifi_credentials resolution (args/env/ssid_list). - Converted inline one-liners to multi-line commands for readability while preserving behavior (nmcli path, wpa_supplicant+udhcpc path, ping checks). - No exports of SSID/PASSWORD kept values local to the script. - No changes to connection logic, retries, gating, or result reporting. Signed-off-by: Srikanth Muppandam --- .../Connectivity/WiFi/WiFi_Dynamic_IP/run.sh | 87 ++++++++++++++++--- 1 file changed, 75 insertions(+), 12 deletions(-) diff --git a/Runner/suites/Connectivity/WiFi/WiFi_Dynamic_IP/run.sh b/Runner/suites/Connectivity/WiFi/WiFi_Dynamic_IP/run.sh index 77517a3..ddafbc4 100755 --- a/Runner/suites/Connectivity/WiFi/WiFi_Dynamic_IP/run.sh +++ b/Runner/suites/Connectivity/WiFi/WiFi_Dynamic_IP/run.sh @@ -1,5 +1,4 @@ #!/bin/sh - # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. # SPDX-License-Identifier: BSD-3-Clause-Clear @@ -33,42 +32,106 @@ TESTNAME="WiFi_Dynamic_IP" test_path=$(find_test_case_by_name "$TESTNAME") cd "$test_path" || exit 1 +# ---------------- CLI (SSID/PASSWORD) ---------------- +SSID="" +PASSWORD="" + +while [ $# -gt 0 ]; do + case "$1" in + --ssid) + shift + if [ -n "${1:-}" ]; then + SSID="$1" + fi + ;; + --password) + shift + if [ -n "${1:-}" ]; then + PASSWORD="$1" + fi + ;; + --help|-h) + echo "Usage: $0 [--ssid SSID] [--password PASS]" + exit 0 + ;; + *) + log_warn "Unknown argument: $1" + ;; + esac + shift +done + log_info "-------------------------------------------------------------" log_info "------------------- Starting $TESTNAME Test -----------------" +log_info "Host: $(hostname 2>/dev/null || printf 'unknown')" +log_info "Kernel: $(uname -r 2>/dev/null || printf 'unknown')" +log_info "Date: $(date -u 2>/dev/null || printf 'unknown')" # Credential extraction -creds=$(get_wifi_credentials "$1" "$2") || log_skip_exit "$TESTNAME" "WiFi: SSID and/or password missing. Skipping test." wifi_cleanup "" +creds=$(get_wifi_credentials "$SSID" "$PASSWORD") || \ + log_skip_exit "$TESTNAME" "WiFi: SSID and/or password missing. Skipping test." wifi_cleanup "" + SSID=$(echo "$creds" | awk '{print $1}') PASSWORD=$(echo "$creds" | awk '{print $2}') + log_info "Using SSID='$SSID' and PASSWORD='[hidden]'" check_dependencies iw ping # If not a kernel-only/minimal build, systemd is checked, else skipped automatically -check_systemd_services systemd-networkd.service || log_fail_exit "$TESTNAME" "Network services check failed" wifi_cleanup "" +log_info "Checking network service: systemd-networkd.service" +check_systemd_services systemd-networkd.service || \ + log_fail_exit "$TESTNAME" "Network services check failed" wifi_cleanup "" + +WIFI_IFACE=$(get_wifi_interface) || \ + log_fail_exit "$TESTNAME" "No WiFi interface found" wifi_cleanup "" -WIFI_IFACE=$(get_wifi_interface) || log_fail_exit "$TESTNAME" "No WiFi interface found" wifi_cleanup "" log_info "Using WiFi interface: $WIFI_IFACE" +# Prepare a ping log file for command output (appended across retries) +PING_LOG="./wifi_ping_${WIFI_IFACE}.log" +: > "$PING_LOG" +log_info "Ping output will be logged to: $PING_LOG" + # nmcli with retry +log_info "Attempting connection via nmcli…" if wifi_connect_nmcli "$WIFI_IFACE" "$SSID" "$PASSWORD"; then IP=$(wifi_get_ip "$WIFI_IFACE") - [ -z "$IP" ] && log_fail_exit "$TESTNAME" "No IP after nmcli" wifi_cleanup "$WIFI_IFACE" - if retry_command "ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 >/dev/null 2>&1" 3 3; then - log_pass_exit "$TESTNAME" "Internet connectivity verified via ping" wifi_cleanup "$WIFI_IFACE" + + if [ -z "$IP" ]; then + log_fail_exit "$TESTNAME" "No IP after nmcli" wifi_cleanup "$WIFI_IFACE" + fi + + log_info "Acquired IP via nmcli: $IP" + + PING_CMD="ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 2>&1 | tee -a \"$PING_LOG\"" + log_info "Connectivity check command: $PING_CMD" + + if retry_command "$PING_CMD" 3 3; then + log_pass_exit "$TESTNAME" "Internet connectivity verified via ping (iface=$WIFI_IFACE ip=$IP)" wifi_cleanup "$WIFI_IFACE" else - log_fail_exit "$TESTNAME" "Ping test failed after nmcli connection" wifi_cleanup "$WIFI_IFACE" + log_fail_exit "$TESTNAME" "Ping test failed after nmcli connection (iface=$WIFI_IFACE ip=$IP). See $PING_LOG" wifi_cleanup "$WIFI_IFACE" fi fi # wpa_supplicant+udhcpc with retry +log_info "Attempting connection via wpa_supplicant + udhcpc…" if wifi_connect_wpa_supplicant "$WIFI_IFACE" "$SSID" "$PASSWORD"; then IP=$(wifi_get_ip "$WIFI_IFACE") - [ -z "$IP" ] && log_fail_exit "$TESTNAME" "No IP after wpa_supplicant" wifi_cleanup "$WIFI_IFACE" - if retry_command "ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 >/dev/null 2>&1" 3 3; then - log_pass_exit "$TESTNAME" "Internet connectivity verified via ping" wifi_cleanup "$WIFI_IFACE" + + if [ -z "$IP" ]; then + log_fail_exit "$TESTNAME" "No IP after wpa_supplicant" wifi_cleanup "$WIFI_IFACE" + fi + + log_info "Acquired IP via wpa_supplicant: $IP" + + PING_CMD="ping -I \"$WIFI_IFACE\" -c 3 -W 2 8.8.8.8 2>&1 | tee -a \"$PING_LOG\"" + log_info "Connectivity check command: $PING_CMD" + + if retry_command "$PING_CMD" 3 3; then + log_pass_exit "$TESTNAME" "Internet connectivity verified via ping (iface=$WIFI_IFACE ip=$IP)" wifi_cleanup "$WIFI_IFACE" else - log_fail_exit "$TESTNAME" "Ping test failed after wpa_supplicant connection" wifi_cleanup "$WIFI_IFACE" + log_fail_exit "$TESTNAME" "Ping test failed after wpa_supplicant connection (iface=$WIFI_IFACE ip=$IP). See $PING_LOG" wifi_cleanup "$WIFI_IFACE" fi fi From 8ae75e621995389a033d59f6fed47199d5d80fde Mon Sep 17 00:00:00 2001 From: Srikanth Muppandam Date: Wed, 8 Oct 2025 21:40:19 +0530 Subject: [PATCH 3/4] WiFi_Manual_IP: add --ssid/--password CLI; preserve flow; expand one-liners - Introduce explicit credential flags: --ssid and --password . - When provided, flags take precedence over positional args; otherwise continue to resolve via get_wifi_credentials(,) (args/env/ssid_list). Signed-off-by: Srikanth Muppandam --- .../Connectivity/WiFi/WiFi_Manual_IP/run.sh | 53 +++++++++++++++---- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/Runner/suites/Connectivity/WiFi/WiFi_Manual_IP/run.sh b/Runner/suites/Connectivity/WiFi/WiFi_Manual_IP/run.sh index c45101a..b8f3484 100755 --- a/Runner/suites/Connectivity/WiFi/WiFi_Manual_IP/run.sh +++ b/Runner/suites/Connectivity/WiFi/WiFi_Manual_IP/run.sh @@ -29,32 +29,65 @@ fi . "$TOOLS/functestlib.sh" TESTNAME="WiFi_Manual_IP" -test_path=$(find_test_case_by_name "$TESTNAME") +test_path="$(find_test_case_by_name "$TESTNAME")" cd "$test_path" || exit 1 log_info "--------------------------------------------------------------------------" log_info "-------------------Starting $TESTNAME Testcase----------------------------" log_info "=== Test Initialization ===" +# ---------------- CLI (SSID/PASSWORD) ---------------- +SSID="" +PASSWORD="" + +while [ $# -gt 0 ]; do + case "$1" in + --ssid) + shift + if [ -n "${1:-}" ]; then + SSID="$1" + fi + ;; + --password) + shift + if [ -n "${1:-}" ]; then + PASSWORD="$1" + fi + ;; + --help|-h) + echo "Usage: $0 [--ssid SSID] [--password PASS]" + exit 0 + ;; + *) + log_warn "Unknown argument: $1" + ;; + esac + shift +done + # Trap to always restore udhcpc script trap 'restore_udhcpc_script' EXIT -# Credential extraction (from arguments, env, or ssid_list.txt) -if ! CRED=$(get_wifi_credentials "$1" "$2") || [ -z "$CRED" ]; then +# Credential extraction (from CLI, env, or ssid_list.txt via helper) +if ! CRED="$(get_wifi_credentials "$SSID" "$PASSWORD")" || [ -z "$CRED" ]; then log_skip_exit "$TESTNAME" "WiFi: SSID and/or password missing. Skipping test." fi -SSID=$(echo "$CRED" | awk '{print $1}') -PASSWORD=$(echo "$CRED" | awk '{print $2}') +SSID="$(echo "$CRED" | awk '{print $1}')" +PASSWORD="$(echo "$CRED" | awk '{print $2}')" log_info "Using SSID='$SSID' and PASSWORD='[hidden]'" check_dependencies iw wpa_supplicant udhcpc ip -WIFI_IF=$(get_wifi_interface) -[ -z "$WIFI_IF" ] && log_fail_exit "$TESTNAME" "No WiFi interface detected." +WIFI_IF="$(get_wifi_interface)" +if [ -z "$WIFI_IF" ]; then + log_fail_exit "$TESTNAME" "No WiFi interface detected." +fi -UDHCPC_SCRIPT=$(ensure_udhcpc_script) -[ ! -x "$UDHCPC_SCRIPT" ] && log_fail_exit "$TESTNAME" "Failed to create udhcpc script." +UDHCPC_SCRIPT="$(ensure_udhcpc_script)" +if [ ! -x "$UDHCPC_SCRIPT" ]; then + log_fail_exit "$TESTNAME" "Failed to create udhcpc script." +fi wifi_cleanup() { killall -q wpa_supplicant 2>/dev/null @@ -76,7 +109,7 @@ sleep 4 udhcpc -i "$WIFI_IF" -s "$UDHCPC_SCRIPT" -n -q & sleep 8 -IP=$(ip addr show "$WIFI_IF" | awk '/inet / {print $2}' | cut -d/ -f1) +IP="$(ip addr show "$WIFI_IF" | awk '/inet / {print $2}' | cut -d/ -f1)" if [ -n "$IP" ]; then log_info "WiFi got IP: $IP (manual DHCP via udhcpc)" if ping -I "$WIFI_IF" -c 3 -W 2 8.8.8.8 >/dev/null 2>&1; then From a3b77331686fd40b3a434ad1fbe923d18cc208aa Mon Sep 17 00:00:00 2001 From: anilyada Date: Mon, 13 Oct 2025 17:37:16 +0530 Subject: [PATCH 4/4] Add FastCV OpenCV SFM validation test script This script performs rootfs resizing, sets permissions for OpenCV binaries, installs required IPK packages, and runs the OpenCV SFM test suite with performance parameters. It validates the output to ensure all 19 tests pass. Signed-off-by: Anil Yadav " --- .../suites/Multimedia/OpenCV/FastCV/Readme.md | 50 +++++++++++++ Runner/suites/Multimedia/OpenCV/FastCV/run.sh | 74 +++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 Runner/suites/Multimedia/OpenCV/FastCV/Readme.md create mode 100644 Runner/suites/Multimedia/OpenCV/FastCV/run.sh diff --git a/Runner/suites/Multimedia/OpenCV/FastCV/Readme.md b/Runner/suites/Multimedia/OpenCV/FastCV/Readme.md new file mode 100644 index 0000000..141e040 --- /dev/null +++ b/Runner/suites/Multimedia/OpenCV/FastCV/Readme.md @@ -0,0 +1,50 @@ +# FastCV OpenCV SFM Validation Test + +This test validates the OpenCV Structure from Motion (SFM) module functionality using the FastCV framework on Qualcomm platforms with Yocto builds. + +## Overview + +The test script performs the following functional checks: + +1. **Filesystem Preparation** + - Resizes the root filesystem partition to ensure sufficient space using `resize2fs`. + +2. **Binary Permissions** + - Sets executable permissions for OpenCV binaries located in `/usr/bin/FastCV` and `/usr/bin`. + +3. **Package Installation** + - Installs required `.ipk` packages from `/usr/bin/FastCV/opencv` using `opkg` + +4. **Test Execution** + - Runs the OpenCV SFM test suite with performance parameters: + ``` + OPENCV_TEST_DATA_PATH=/usr/bin/FastCV/testdata/ /usr/bin/opencv_test_sfm --perf_min_samples=10 --perf_force_samples=10 + ``` + +5. **Validation** + - Parses the test output to confirm that all 19 tests have passed. + +## How to Run + +source init_env +cd suites/Vision/FunctionalArea/FastCV +./run.sh + + +## Prerequisites + +- `resize2fs`, `opkg`, and OpenCV binaries must be available on the target device +- Root access is required for resizing partitions and setting permissions +- Test data must be present at `/usr/bin/FastCV/testdata/` +- `.ipk` packages should be available in `/usr/bin/FastCV/opencv/` + +## Result Format +Test result will be saved in fastCV.res as: + +- OpenCV test suite passed successfully. `[ PASSED ] 19 tests` – if all validations pass +- OpenCV test suite failed or incomplete. Test output did not match expected results. – if any check fails + +## License + +SPDX-License-Identifier: BSD-3-Clause-Clear +(C) Qualcomm Technologies, Inc. and/or its subsidiaries. \ No newline at end of file diff --git a/Runner/suites/Multimedia/OpenCV/FastCV/run.sh b/Runner/suites/Multimedia/OpenCV/FastCV/run.sh new file mode 100644 index 0000000..b70495f --- /dev/null +++ b/Runner/suites/Multimedia/OpenCV/FastCV/run.sh @@ -0,0 +1,74 @@ +#!/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="" +SEARCH="$SCRIPT_DIR" +while [ "$SEARCH" != "/" ]; do + if [ -f "$SEARCH/init_env" ]; then + INIT_ENV="$SEARCH/init_env" + break + fi + SEARCH=$(dirname "$SEARCH") +done + +if [ -z "$INIT_ENV" ]; then + echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2 + exit 1 +fi + +# Only source if not already loaded (idempotent) +if [ -z "$__INIT_ENV_LOADED" ]; then + # shellcheck disable=SC1090 + . "$INIT_ENV" +fi + +# Always source functestlib.sh, using $TOOLS exported by init_env +# shellcheck disable=SC1090,SC1091 +. "$TOOLS/functestlib.sh" + +TESTNAME="fastCV" +test_path=$(find_test_case_by_name "$TESTNAME") +cd "$test_path" || exit 1 +res_file="./$TESTNAME.res" +summary_file="./$TESTNAME.summary" +rm -f "$res_file" "$summary_file" + +log_info "-------------------------------------------------" +log_info "----------- Starting $TESTNAME Test -------------" + +# Step 1: Resize rootfs +log_info "Resizing rootfs partition..." +resize2fs /dev/disk/by-partlabel/rootfs + +# Step 2: Set permissions +log_info "Setting permissions for OpenCV binaries..." +chmod 777 /usr/bin/FastCV/opencv +chmod 777 /usr/bin/opencv* + +# Step 3: Install IPK packages +log_info "Installing IPK packages from /usr/bin/FastCV/opencv..." +cd /usr/bin/FastCV/opencv || exit 1 +opkg install *.ipk + +# Step 4: Run OpenCV test +log_info "Running OpenCV SFM test suite..." +OPENCV_TEST_DATA_PATH=/usr/bin/FastCV/testdata/ /usr/bin/opencv_test_sfm --perf_min_samples=10 --perf_force_samples=10 > test_output.log 2>&1 + +# Step 5: Validate output +if grep -q "\[ PASSED \] 19 tests" test_output.log; then + log_pass "OpenCV test suite passed successfully." + echo "$TESTNAME PASS" > "$res_file" + echo "All 19 tests passed." >> "$summary_file" + exit 0 +else + log_fail "OpenCV test suite failed or incomplete." + echo "$TESTNAME FAIL" > "$res_file" + echo "Test output did not match expected results." >> "$summary_file" + exit 1 +fi + +log_info "----------- Completed $TESTNAME Test ------------" \ No newline at end of file