Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Runner/config/pkg_command_map.conf
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,17 @@ apt:parecord=pulseaudio-utils
# Important:
# - Never use wildcard package names.
# - Never install dbgsym packages.
# - The six qcom-sensors-*-dev packages are temporarily required because
# ssc_sensor_info fails to load its sensor libraries without the unversioned
# library links currently shipped by those development packages.
# - qcom-sensing-hub-dev remains required for the sensing-hub development
# library links.
# - libqcsi1 is a required runtime library.
# - Debian staging repositories currently publish several qcom-sensors-*-dev
# packages against an older exact runtime version. Do not include those
# packages in the Debian set because APT cannot resolve that mixed version
# transaction.
# - The Debian list below is validated against the current staging runtime.
# - Debian and Ubuntu use the same compatible runtime/test package set.
# ---------------------------------------------------------------------------

debian:package-set:sensors=qcom-sensing-hub qcom-sensing-hub-dev libqcsi1 qcom-sensors-api qcom-sensors-api-dev qcom-sensors-core qcom-sensors-core-dev qcom-sensors-registry qcom-sensors-registry-dev qcom-sensors-services qcom-sensors-services-dev qcom-sensors-test-core qcom-sensors-test-core-dev qcom-sensors-test-apps qcom-sensors-test-apps-dev
debian:package-set:sensors=qcom-sensing-hub qcom-sensing-hub-dev qcom-sensors-test-apps qcom-sensors-services qcom-sensors-core-dev

ubuntu:package-set:sensors=qcom-sensing-hub qcom-sensing-hub-dev libqcsi1 qcom-sensors-api qcom-sensors-api-dev qcom-sensors-core qcom-sensors-core-dev qcom-sensors-registry qcom-sensors-registry-dev qcom-sensors-services qcom-sensors-services-dev qcom-sensors-test-core qcom-sensors-test-core-dev qcom-sensors-test-apps qcom-sensors-test-apps-dev
ubuntu:package-set:sensors=qcom-sensing-hub qcom-sensing-hub-dev qcom-sensors-test-apps qcom-sensors-services qcom-sensors-core-dev

# Keep CentOS limited to confirmed RPM package names.
# Debian -dev names must not be copied to RPM systems. Add RPM -devel packages
Expand All @@ -354,17 +354,17 @@ centos:package-set:sensors=qcom-sensing-hub qcom-sensors-api qcom-sensors-core q
# ---------------------------------------------------------------------------
# Sensors command recovery.
#
# ssc_sensor_info currently requires the runtime packages plus all confirmed
# development packages that provide its load-time library links.
# The Debian command mappings must stay aligned with the package set above so
# command recovery cannot reintroduce incompatible development packages.
# ---------------------------------------------------------------------------

debian:Sensors:ssc_sensor_info=qcom-sensing-hub qcom-sensing-hub-dev libqcsi1 qcom-sensors-api qcom-sensors-api-dev qcom-sensors-core qcom-sensors-core-dev qcom-sensors-registry qcom-sensors-registry-dev qcom-sensors-services qcom-sensors-services-dev qcom-sensors-test-core qcom-sensors-test-core-dev qcom-sensors-test-apps qcom-sensors-test-apps-dev
debian:Sensors:see_workhorse=qcom-sensors-test-core qcom-sensors-test-apps
debian:Sensors:ssc_drva_test=qcom-sensors-test-core qcom-sensors-test-apps
debian:Sensors:ssc_sensor_info=qcom-sensing-hub qcom-sensing-hub-dev qcom-sensors-test-apps qcom-sensors-services qcom-sensors-core-dev
debian:Sensors:see_workhorse=qcom-sensors-test-apps
debian:Sensors:ssc_drva_test=qcom-sensors-test-apps

ubuntu:Sensors:ssc_sensor_info=qcom-sensing-hub qcom-sensing-hub-dev libqcsi1 qcom-sensors-api qcom-sensors-api-dev qcom-sensors-core qcom-sensors-core-dev qcom-sensors-registry qcom-sensors-registry-dev qcom-sensors-services qcom-sensors-services-dev qcom-sensors-test-core qcom-sensors-test-core-dev qcom-sensors-test-apps qcom-sensors-test-apps-dev
ubuntu:Sensors:see_workhorse=qcom-sensors-test-core qcom-sensors-test-apps
ubuntu:Sensors:ssc_drva_test=qcom-sensors-test-core qcom-sensors-test-apps
ubuntu:Sensors:ssc_sensor_info=qcom-sensing-hub qcom-sensing-hub-dev qcom-sensors-test-apps qcom-sensors-services qcom-sensors-core-dev
ubuntu:Sensors:see_workhorse=qcom-sensors-test-apps
ubuntu:Sensors:ssc_drva_test=qcom-sensors-test-apps

centos:Sensors:ssc_sensor_info=qcom-sensing-hub
centos:Sensors:see_workhorse=qcom-sensors-test-core qcom-sensors-test-apps
Expand Down
31 changes: 25 additions & 6 deletions Runner/suites/Multimedia/Sensors/README_Sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ This test validates Qualcomm SSC/ADSP sensor streaming **without relying on Devi
- Parses **TYPE** entries where `AVAILABLE=true` (and prefers physical sensors where possible)

3. **Auto-selects sensor set**
- Default: `--profile auto`
- If `mag` or `pressure` is present → **Vision-like** profile: `accel,gyro,mag,pressure`
- Else → **Core-like** profile: `accel,gyro`
- Default: `--profile auto`
- Auto mode selects the discovered sensor types supported by the streaming
tools, such as `accel`, `gyro`, `mag`, and `pressure`.
- Auto mode passes the SSC platform-service validation when no testable data
sensor is present. Service and test endpoint types are not functional
streaming targets.

4. **Runs functional validation**
- For each selected sensor TYPE:
Expand Down Expand Up @@ -99,7 +102,7 @@ Profiles:
- `basic` / `core`: `accel,gyro`
- `vision`: `accel,gyro,mag,pressure`
- `all`: all discovered types (debug)
- `auto` (default): picks core/vision based on presence of `mag`/`pressure`
- `auto` (default): tests discovered supported data sensor types only

### Run an explicit list of sensors
```sh
Expand Down Expand Up @@ -134,7 +137,8 @@ Profiles:
- `--hb <sec>`
Heartbeat interval printed to stdout (default: `5`)
- `--strict <0|1>`
Require `accel` and `gyro` to exist (default: `1`)
Fail when an explicitly selected or named-profile sensor is absent (default:
`1`). Auto mode always uses the discovered present-sensor set.

### Environment overrides
- `OUT_DIR` (same as `--out`)
Expand Down Expand Up @@ -170,7 +174,22 @@ Result file:
- `Sensors.res` in the testcase directory
- `Sensors PASS`
- `Sensors FAIL`
- `Sensors SKIP`
- `Sensors SKIP`

## Verdict policy

- **PASS, control plane only:** package/runtime checks, `sscrpcd`, ADSP, and
`ssc_sensor_info` are healthy, but the runtime inventory has no streamable
physical data-sensor type. This does not claim that sensor streaming was
tested.
- **PASS, functional:** one or more discovered streamable data sensors pass
`see_workhorse` and the available `ssc_drva_test` validation.
- **FAIL:** a required runtime component is broken, a discovered streamable
sensor fails functional validation, or an explicitly requested/named-profile
sensor is absent while strict mode is enabled.
- **SKIP:** prerequisites are unavailable or the runtime cannot provide a
usable inventory, for example no Sensors configuration, no ADSP remoteproc,
missing commands, or no parsable `ssc_sensor_info` output.

---

Expand Down
78 changes: 46 additions & 32 deletions Runner/suites/Multimedia/Sensors/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ Discovery:
core : accel,gyro
vision: accel,gyro,mag,pressure
all : all discovered types (debug)
Default: auto (core/vision inferred by presence of mag/pressure)
Default: auto (all discovered testable data sensors)

Durations / progress:
--out <dir> Output directory (default: ./logs_Sensors)
--see-duration <sec> see_workhorse duration (default: 5)
--drva-duration <sec> ssc_drva_test duration (default: 10)
--hb <sec> Heartbeat seconds (default: 5)
--strict <0|1> Require accel+gyro to exist (default: 1)
--strict <0|1> Fail when an explicitly selected or named-profile sensor is
absent (default: 1). Auto mode uses present sensors only.

Other:
--help Show this help
Expand Down Expand Up @@ -323,33 +324,12 @@ if [ "$LIST_ONLY" -eq 1 ]; then
exit 0
fi

# strict accel+gyro requirement
req_missing=0
for r in accel gyro; do
if ! sensors_type_present "$types_nl" "$r"; then
log_warn "Missing required sensor type: $r"
req_missing=1
fi
done
if [ "$STRICT_REQUIRED" = "1" ] && [ "$req_missing" -eq 1 ]; then
log_fail "$TESTNAME FAIL - required sensor types missing (need accel+gyro)"
echo "$TESTNAME FAIL" >"$RES_FILE"
exit 0
fi

# infer kit for auto profile
is_vision=0
if sensors_type_present "$types_nl" "mag" || sensors_type_present "$types_nl" "pressure"; then
is_vision=1
log_info "Kit guess (DT-free): Vision-like (mag/pressure present)"
else
log_info "Kit guess (DT-free): Core-like (mag/pressure not present)"
fi

TARGET_NL=""
TARGET_SOURCE=""

# 1) explicit sensor list overrides everything
if [ -n "$SENSORS_CSV" ]; then
TARGET_SOURCE="explicit list"
OLDIFS=$IFS
IFS=,
set -- "$SENSORS_CSV"
Expand All @@ -363,26 +343,28 @@ else
# 2) profile selection
case "$PROFILE" in
auto)
if [ "$is_vision" -eq 1 ]; then
PROFILE="vision"
else
PROFILE="core"
fi
TARGET_SOURCE="dynamic inventory"
TARGET_NL="$(sensors_select_testable_types "$types_nl")"
;;
esac

case "$PROFILE" in
auto)
;;
basic|core)
TARGET_SOURCE="$PROFILE profile"
TARGET_NL="accel
gyro"
;;
vision)
TARGET_SOURCE="vision profile"
TARGET_NL="accel
gyro
mag
pressure"
;;
all)
TARGET_SOURCE="all profile"
TARGET_NL="$types_nl"
;;
*)
Expand All @@ -393,7 +375,40 @@ pressure"
esac
fi

log_info "Sensors selected to test:"
present_targets=""
missing_targets=""
for s in $TARGET_NL; do
if sensors_type_present "$types_nl" "$s"; then
present_targets="$(sensors_append_unique_line "$present_targets" "$s")"
else
missing_targets="$(sensors_append_unique_line "$missing_targets" "$s")"
fi
done

if [ -n "$missing_targets" ]; then
printf '%s\n' "$missing_targets" | while IFS= read -r s; do
[ -n "$s" ] && log_warn "Selected sensor type is not present: $s"
done

if [ "$STRICT_REQUIRED" = "1" ]; then
if [ "$PROFILE" != "auto" ] || [ -n "$SENSORS_CSV" ]; then
log_fail "$TESTNAME FAIL - required selected sensor types are missing"
echo "$TESTNAME FAIL" >"$RES_FILE"
exit 0
fi
fi
fi

TARGET_NL="$present_targets"

if [ -z "$TARGET_NL" ]; then
log_info "No streamable data sensor types are present, completing SSC control-plane validation only"
log_pass "$TESTNAME PASS - SSC control plane is healthy, no physical data-sensor streaming was applicable"
echo "$TESTNAME PASS" >"$RES_FILE"
exit 0
fi

log_info "Sensors selected to test from $TARGET_SOURCE:"
printf '%s\n' "$TARGET_NL" | while IFS= read -r s; do
[ -n "$s" ] && log_info " - $s"
done
Expand Down Expand Up @@ -457,4 +472,3 @@ else
fi

exit 0

18 changes: 18 additions & 0 deletions Runner/utils/lib_sensors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,24 @@ sensors_type_present() {
printf '%s\n' "$types_nl" | grep -Fxq "$needle" 2>/dev/null
}

# Print discovered sensor types that support the streaming validation tools.
# Service, registry, diagnostic, camera, and test endpoint types are omitted
# because they are not hardware data sensors for see_workhorse/ssc_drva_test.
sensors_select_testable_types() {
types_nl="$1"

printf '%s\n' "$types_nl" | while IFS= read -r sensor_type; do
case "$sensor_type" in
accel|gyro|mag|pressure|light|prox|temperature|humidity|gravity|\
linear_accel|rotation_vector|game_rotation_vector|\
geomagnetic_rotation_vector|step_counter|step_detector|\
significant_motion|tilt)
printf '%s\n' "$sensor_type"
;;
esac
done
}

# Run a command in background, redirect all output to logfile, and print a heartbeat.
# sensors_run_cmd_with_progress <logfile> <label> <duration_sec> <heartbeat_sec> -- <cmd...>
sensors_run_cmd_with_progress() {
Expand Down
Loading