Skip to content
Open
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
88 changes: 84 additions & 4 deletions Runner/suites/Multimedia/Video/Video_V4L2_Runner/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,30 @@ case "$plat" in
fi
fi
;;
shikra)
if [ "$post_stack" = "upstream" ]; then
if video_has_module_loaded qcom_iris; then
log_pass "Upstream validated: qcom_iris present (Shikra)"
else
log_warn "Upstream expected but qcom_iris not present (Shikra)"
fi
fi
;;
hamoa)
if [ "$post_stack" = "upstream" ]; then
if video_has_module_loaded qcom_iris; then
log_pass "Upstream validated: qcom_iris present (Hamoa)"
else
log_warn "Upstream expected but qcom_iris not present (Hamoa)"
fi
elif [ "$post_stack" = "downstream" ]; then
if video_has_module_loaded iris_vpu; then
log_pass "Downstream validated: iris_vpu present (Hamoa)"
else
log_warn "Downstream expected but iris_vpu not present (Hamoa)"
fi
fi
;;
*)
log_warn "Unknown platform; skipping strict module validation"
;;
Expand Down Expand Up @@ -1157,6 +1181,62 @@ while IFS= read -r cfg; do
continue
fi

# -----------------------------------------------------------------------
# Stage the effective config once per test case, before the repeat loop.
# Both normal runs and retries use the same staged path so they cannot
# diverge. Platforms with no matching policy row use the original config
# unchanged (no-op path through video_policy_lookup).
# -----------------------------------------------------------------------
effective_cfg="$cfg"
vpl_policy_file="$LOG_DIR/.policy_${id}.$$.txt"
video_policy_lookup "$plat" "$mode" "$codec" > "$vpl_policy_file" 2>/dev/null || true

if [ -s "$vpl_policy_file" ]; then
vpl_staged="$cfg"
vpl_stage_ok=1
while IFS='|' read -r vpl_ctrl vpl_val; do
[ -z "$vpl_ctrl" ] && continue
vpl_result="$(video_stage_control_override \
"$vpl_staged" "$vpl_ctrl" "$vpl_val" "$LOG_DIR")"
vpl_rc=$?
if [ "$vpl_rc" -eq 2 ]; then
# Policy requires this control but the config does not declare it.
# Running the original config would silently use the platform default
# (potentially unsupported) value — fail preparation instead.
log_warn "[$id] Required control '$vpl_ctrl' is absent from config '$vpl_staged'; aborting preparation"
vpl_stage_ok=0
break
fi
if [ "$vpl_rc" -ne 0 ]; then
log_warn "[$id] Config staging failed for control '$vpl_ctrl'; aborting preparation"
vpl_stage_ok=0
break
fi
if [ -n "$vpl_result" ] && [ -f "$vpl_result" ]; then
vpl_staged="$vpl_result"
fi
done < "$vpl_policy_file"

if [ "$vpl_stage_ok" -eq 0 ]; then
rm -f "$vpl_policy_file" 2>/dev/null || true
log_fail "[$id] FAIL - config preparation failed"
printf '%s\n' "$id FAIL $pretty" >> "$LOG_DIR/summary.txt"
printf '%s\n' "$mode,$id,FAIL,$pretty,0,0,0" >> "$LOG_DIR/results.csv"
fail=$((fail + 1))
suite_rc=1
if [ "$STOP_ON_FAIL" -eq 1 ]; then
break
fi
continue
fi

if [ "$vpl_staged" != "$cfg" ]; then
effective_cfg="$vpl_staged"
log_info "[$id] Using staged config: $effective_cfg"
fi
fi
rm -f "$vpl_policy_file" 2>/dev/null || true

pass_runs="0"
fail_runs="0"
rep="1"
Expand All @@ -1169,7 +1249,7 @@ while IFS= read -r cfg; do
fi

video_step "$id" "Execute app"
log_info "[$id] CMD: $VIDEO_APP --config \"$cfg\" --loglevel $LOGLEVEL"
log_info "[$id] CMD: $VIDEO_APP --config \"$effective_cfg\" --loglevel $LOGLEVEL"

case "$APP_LAUNCH_SLEEP" in
''|*[!0-9]* )
Expand All @@ -1184,7 +1264,7 @@ while IFS= read -r cfg; do
;;
esac

if video_run_once "$cfg" "$logf" "$TIMEOUT" "$SUCCESS_RE" "$LOGLEVEL"; then
if video_run_once "$effective_cfg" "$logf" "$TIMEOUT" "$SUCCESS_RE" "$LOGLEVEL"; then
pass_runs=$((pass_runs + 1))
else
rc_val="$(awk -F'=' '/^END-RUN rc=/{print $2}' "$logf" 2>/dev/null | tail -n1 | tr -d ' ')"
Expand Down Expand Up @@ -1238,7 +1318,7 @@ while IFS= read -r cfg; do
fi

# (2) Retry on final failure (extra attempts outside REPEAT loop, before recording results)
if [ "$final" = "FAIL" ] && [ "$RETRY_ON_FAIL" -gt 0 ] 2>/dev/null; then
if [ "$final" = "FAIL" ] && [ "$RETRY_ON_FAIL" -gt 0 ] 2>/dev/null; then
r=1
log_info "[$id] RETRY_ON_FAIL: up to $RETRY_ON_FAIL additional attempt(s)"
while [ "$r" -le "$RETRY_ON_FAIL" ]; do
Expand All @@ -1247,7 +1327,7 @@ while IFS= read -r cfg; do
fi

log_info "[$id] retry attempt $r/$RETRY_ON_FAIL"
if video_run_once "$cfg" "$logf" "$TIMEOUT" "$SUCCESS_RE" "$LOGLEVEL"; then
if video_run_once "$effective_cfg" "$logf" "$TIMEOUT" "$SUCCESS_RE" "$LOGLEVEL"; then
pass_runs=$((pass_runs + 1))
final="PASS"
log_pass "[$id] RETRY succeeded — marking PASS"
Expand Down
13 changes: 11 additions & 2 deletions Runner/utils/audio_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2762,9 +2762,18 @@ audio_remoteproc_is_modem() {
}

# Return success when runtime platform evidence identifies a Shikra target.
# The preflight runs before the suites call detect_platform, so inspect both
# any already-populated platform variables and the standard runtime DT paths.
#
# Delegates to platform_identity_matches() from functestlib.sh when available
# (the shared single source of truth for board identity consumed by both audio
# and video). Falls back to an inline implementation with identical logic for
# environments where functestlib.sh is not sourced before audio_common.sh.
audio_platform_is_shikra() {
if command -v platform_identity_matches >/dev/null 2>&1; then
platform_identity_matches "shikra"
return
fi

# Inline fallback — identical logic to platform_runtime_identity() + match.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All repository callers source functestlib.sh before audio_common.sh, including the child user-session paths. This fallback therefore preserves a parallel DT scanner unnecessarily.

Remove the duplicate implementation and use platform_identity_matches shikra as the single contract. If standalone sourcing is required, source the shared helper explicitly.

apis_identity="${PLATFORM_MACHINE:-} ${PLATFORM_TARGET:-}"
apis_identity="$apis_identity ${PLATFORM_SOC_MACHINE:-}"
apis_identity="$apis_identity ${PLATFORM_DT_MODEL:-}"
Expand Down
Loading