Skip to content

Conversation

@vijpatel22
Copy link

PR – Add AI/ML GStreamer Test Suite


Overview

This pull request introduces, a self‑contained test suite for the AI/ML GStreamer suite located at:
Runner/suites/Multimedia/GStreamer/AI_ML/run.sh

The script automates the end‑to‑end validation of object‑detection and image‑classification pipelines that leverage Qualcomm‑specific GStreamer plugins.

It will:

  1. Downloads TFLite models, sample video, and label zip‑files on‑the‑fly.
  2. Checks that all GStreamer elements needed by the pipelines are available.
  3. Executes both pipelines with configurable timeout, GST_DEBUG level, and output‑video path.
  4. Handles Wayland socket discovery/adoption when a compositor is present.
  5. Emits a result file (AI_ML.res) containing PASS, FAIL, or SKIP.
  6. Provides detailed logging via the existing test‑kit helper functions.

🛠️ What’s Added / Modified

Runner/suites/Multimedia/GStreamer/AI_ML/run.sh - New executable script (the full implementation is attached in this PR).
Runner/suites/Multimedia/GStreamer/AI_ML/AI_ML.yaml - New YAML file
Runner/suites/Multimedia/GStreamer/AI_ML/Readme.md - New Readme file
Runner/utils/lib_gstreamer.sh - Added new functions.

Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
@smuppand
Copy link
Contributor

smuppand commented Feb 8, 2026

Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
@vijpatel22
Copy link
Author

Hi @smuppand, I’ve pushed the latest changes. Could you please review.

# Optional: make sure we have network connectivity (kept from the
# original script)
# ------------------------------------------------------------------
if command -v ensure_network_online >/dev/null 2>&1; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Skip download if required assets already exist (non-empty).
  2. Otherwise bring up Ethernet first (get_ethernet_interfaces, bringup_interface, try_dhcp_client_safe) and re-check connectivity (check_network_status / ensure_network_online).
  3. If Ethernet fails, try Wi-Fi fallback using get_wifi_interface + get_wifi_credentials + wifi_connect_nmcli/wifi_connect_wpa_supplicant + DHCP.
  4. If still offline/limited → SKIP (not FAIL), since downloads can’t proceed.

- REPO_PATH=$PWD
- cd Runner/suites/Multimedia/GSTreamer/AI_ML/
- ./run.sh --timeout "${TIMEOUT}" --gstdebug "${GST_DEBUG_LEVEL}" --output-video "${OUTPUT_VIDEO_PATH}" || true
- $REPO_PATH/Runner/utils/send-to-lava.sh AI_ML.res || true No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No newline at end of file.

Run.sh should handle proper exits, so there's no need to use || true for the send-to-lava.sh step.


### PASS
- **All pipelines** successfully run to PLAYING state without critical errors
- Output file contains `PASS AI_ML`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but your existing testkit convention is AI_ML PASS / AI_ML FAIL, and this run.sh currently prints PASS AI_ML format.


### FAIL
- **Any pipeline** fails to reach PLAYING state or encounters critical errors
- Output file contains `FAIL AI_ML`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here also.

# Source the environment and helper libraries.
# ----------------------------------------------------------------------
# shellcheck disable=SC1090
. "$INIT_ENV"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

init_env sourcing is wrong (double-source + idempotence variable)

TIMEOUT=${timeout:-60} # default 60 seconds

console_log="${name}_console.log"
gst_debug_log="${name}_gst_debug.log"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README expects ./logs/..., but run_pipeline_with_logs() currently writes object_detection_console.log in CWD, not ./logs/.
Create ./logs in run.sh and pass logdir to helper, or

Make helper write under ${GST_LOG_DIR:-./logs}.

mkdir -p "$(dirname "${dest}")"

if command -v curl >/dev/null 2>&1; then
curl -fkL "${url}" -o "${dest}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn’t verify download success / partial downloads

curl -fkL ... -o is okay, but you should check exit code and file is non-empty to avoid silent failures.

after download: [ -s "$dest" ] || return 1

cp -r "${tmp_dir}"/* "${dest_dir}/"

# Clean up the temporary folder;
rm -rf "${tmp_dir}" "${zip_path}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removes the zip file always. Remove zip only on success, or gate removal behind env var.

fi

# ---- Get the actual size -------------------------------------------------
size_in_bytes=$(stat -c %s "$input_file_path" 2>/dev/null) || {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equires GNU stat -c %s

size_in_bytes=$(stat -c %s "$f" 2>/dev/null || wc -c <"$f" 2>/dev/null)

printf '%s\n' "filesrc location=${file} ! ${dec} ! audioconvert ! audioresample ! ${sinkElem}"
return 0
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep mode consistent with existing utilities (usually 100755).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants