Skip to content

Commit 4528956

Browse files
committed
fastrpc-test: Add runtime validation and remove SoC-based filtering
Replace hardcoded SoC/GPDSP skip lists with runtime discovery to enable FastRPC testing on QRB2210 and Glymur CRD. - Remove SoC-based filtering (QRB2210/Glymur CRD skip, per-SoC GPDSP blacklist for QCS9075/QCS8275/QCS8300/QCS9100) - Remove fastrpc_chardev_iface bypass; endpoint check is unconditional - Add fastrpc_domain_endpoint_available() checking both /dev/fastrpc-<label> and /dev/fastrpc-<label>-secure - Add domain_to_endpoint_label() mapping GPDSP0/1 to DT labels gdsp0/gdsp1 - Require all three system libs (libadsprpc/libcdsprpc/libsdsprpc) - Require all three test libs (libcalculator/libhap_example/libmultithreading) - Require non-empty skeleton directory (verified .so artifacts present) - Add SKIP gate for missing test libs before any domain is scheduled - Explicitly selected domains with missing endpoint produce FAIL with remoteproc diagnostics; auto-discovered domains are silently skipped - Consolidate domain metadata into single fastrpc_domain_info() table (name, endpoint label, fw aliases, supported PDs) - Add TIMEOUT=120 per-invocation default and worst-case matrix duration log - Remove only_hap_example_failed() SM8850 exception Signed-off-by: Anand Kulkarni <anankulk@qti.qualcomm.com> Signed-off-by: Anand Kulkarni <anankulk@qti.qualcomm.com>
1 parent f346820 commit 4528956

3 files changed

Lines changed: 275 additions & 158 deletions

File tree

‎Runner/suites/Multimedia/CDSP/fastrpc_test/fastrpc_test.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ metadata:
88
- Now tests ALL supported DSP domains detected at runtime (ADSP, MDSP, SDSP, CDSP, CDSP1, GPDSP0, GPDSP1)
99
- Tests BOTH signed (system) and unsigned (user) Protection Domains where hardware supports them
1010
- ADSP/MDSP/SDSP: signed PD only; CDSP/CDSP1/GPDSP: both signed and unsigned PDs
11-
- QCS9075, QCS8275, QCS8300, QCS9100: GPDSP0/GPDSP1 domains are skipped (fastrpc_tests binaries not supported temporarily)
11+
- Entire test SKIPs early if FastRPC system libraries (libadsprpc/libcdsprpc/libsdsprpc — all required), DSP skeleton directories (v75/v68 — verified non-empty), or test libraries (libcalculator/libhap_example/libmultithreading — all required) are absent
12+
- Domains without a `/dev/fastrpc-<label>` or `/dev/fastrpc-<label>-secure` endpoint are skipped at runtime; explicitly selected domains (--domain / --domain-name / single mode) with a missing endpoint produce FAIL with remoteproc diagnostics
1213
- For single-domain testing: set DOMAIN_MODE="single" and specify DOMAIN or DOMAIN_NAME
1314
os:
1415
- linux
@@ -24,7 +25,8 @@ params:
2425
PD_MODE: "both" # both|signed-only|unsigned-only (default: both - tests both PDs where supported)
2526
UNSIGNED_PD: "" # If set to non-zero, runs only unsigned PD mode (-U 1)
2627
REPEAT: 1 # Number of repetitions (default: 1)
27-
TIMEOUT: "" # Timeout for each run (no timeout if omitted)
28+
TIMEOUT: "120" # Per-invocation timeout in seconds (default 120); prevents a wedged DSP
29+
# from consuming the entire CI budget across multi-domain runs
2830

2931
run:
3032
steps:

‎Runner/suites/Multimedia/CDSP/fastrpc_test/run.sh‎

Lines changed: 76 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ fi
5252

5353
# Defaults
5454
REPEAT=1
55-
TIMEOUT=""
55+
TIMEOUT=120 # default per-invocation timeout in seconds; prevents a wedged DSP
56+
# from consuming the entire CI budget across multi-domain runs
5657
ARCH=""
5758
BIN_DIR="" # directory that CONTAINS fastrpc_test
5859
ASSETS_DIR="" # kept for compatibility/logging (not used by new layout)
@@ -83,7 +84,7 @@ Options:
8384
--pd-mode <both|signed-only|unsigned-only> Select PD mode(s) to run (default: both)
8485
--unsigned-pd Use '-U 1' (user/unsigned PD). Overrides --pd-mode for compatibility
8586
--repeat <N> Number of repetitions (default: 1)
86-
--timeout <sec> Timeout for each run (no timeout if omitted)
87+
--timeout <sec> Timeout for each run (default: 120)
8788
--verbose Extra logging for CI debugging
8889
--help Show this help
8990
@@ -185,7 +186,6 @@ log_info "-------------------Starting $TESTNAME Testcase------------------------
185186
log_info "Kernel: $(uname -a 2>/dev/null || echo N/A)"
186187
log_info "Date(UTC): $(date -u 2>/dev/null || echo N/A)"
187188
log_soc_info
188-
SOC_MACHINE="$(tr -s ' ' < /sys/devices/soc0/machine 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
189189

190190
# -------------------- Binary directory resolution -----------------
191191
if [ -n "$BIN_DIR" ]; then
@@ -216,6 +216,28 @@ fi
216216
# -------------------- Runtime layout discovery --------------------
217217
fastrpc_setup_runtime_layout
218218

219+
# Gate on artifacts being present: a domain appearing in remoteproc/DT does not
220+
# guarantee the FastRPC libraries, DSP skeletons, and test libraries are installed
221+
# and usable. Without them every invocation would fail rather than skip, which is
222+
# the wrong signal.
223+
if [ -z "${FASTRPC_RESOLVED_LIB_SYS_DIR:-}" ]; then
224+
log_skip "$TESTNAME SKIP - FastRPC system library not found (no libadsprpc/libcdsprpc/libsdsprpc)"
225+
echo "$TESTNAME : SKIP" >"$RESULT_FILE"
226+
exit 0
227+
fi
228+
229+
if [ -z "${FASTRPC_RESOLVED_SKEL_PATH:-}" ]; then
230+
log_skip "$TESTNAME SKIP - FastRPC DSP skeleton directory not found (no v75 or v68 under base)"
231+
echo "$TESTNAME : SKIP" >"$RESULT_FILE"
232+
exit 0
233+
fi
234+
235+
if [ -z "${FASTRPC_RESOLVED_LIB_TEST_DIR:-}" ]; then
236+
log_skip "$TESTNAME SKIP - FastRPC test libraries not found (no libcalculator/libhap_example/libmultithreading)"
237+
echo "$TESTNAME : SKIP" >"$RESULT_FILE"
238+
exit 0
239+
fi
240+
219241
log_info "Using binary: $RUN_BIN"
220242
log_info "Run dir: $RUN_DIR (launching ./fastrpc_test)"
221243
log_info "Binary details:"
@@ -237,48 +259,43 @@ if [ -z "$DOMAINS_TO_TEST" ]; then
237259
exit 0
238260
fi
239261

240-
# -------------------- SoC-specific domain blacklist --------------------
241-
# QRB2210: FastRPC not supported - skip entire test
242-
# QCS9075, QCS8275, QCS8300, QCS9100: GPDSP0 (domain 5) and GPDSP1 (domain 6) not supported currently
243-
# SM8850: libhap_example HAP_mem DMA not supported - treat as known skip per invocation
244-
#
245-
# Do not skip Glymur CRD by SoC name. Newer Glymur/Debian images expose
246-
# ADSP/CDSP remoteproc instances and FastRPC skeletons, so runtime discovery
247-
# should decide whether the test can run.
248-
soc_skip_all=0
249-
soc_skip_gpdsp=0
250-
251-
case "$SOC_MACHINE" in
252-
*QRB2210*|*"Glymur CRD"*)
253-
soc_skip_all=1
254-
;;
255-
*QCS9075*|*QCS8275*|*QCS8300*|*QCS9100*)
256-
soc_skip_gpdsp=1
257-
;;
258-
esac
262+
# -------------------- Validate FastRPC endpoint availability --------------------
263+
# Explicitly selected domains must have their endpoint present (FAIL if absent).
264+
# Auto-discovered domains without a usable endpoint are filtered out; if the
265+
# filtered set is empty the test SKIPs. No interface bypass: a system without
266+
# any /dev/fastrpc-* nodes is treated the same as any other — absent endpoints
267+
# produce the correct FAIL/SKIP signal rather than masking a broken image.
268+
domain_selection_explicit=0
269+
{ [ -n "$CLI_DOMAIN_NAME" ] || [ -n "$CLI_DOMAIN" ] || [ "$DOMAIN_MODE" = "single" ]; } \
270+
&& domain_selection_explicit=1
271+
272+
available_domains=""
273+
for d in $DOMAINS_TO_TEST; do
274+
dom_name="$(domain_to_name "$d")"
275+
_ep="$(domain_to_endpoint_label "$d")"
276+
if fastrpc_domain_endpoint_available "$d"; then
277+
available_domains="${available_domains:+$available_domains }$d"
278+
log_debug "Endpoint available: /dev/fastrpc-${_ep} (or /dev/fastrpc-${_ep}-secure)"
279+
else
280+
if [ "$domain_selection_explicit" -eq 1 ]; then
281+
log_fail "$dom_name: explicitly selected endpoint not present (checked /dev/fastrpc-${_ep} and /dev/fastrpc-${_ep}-secure)"
282+
log_dsp_remoteproc_status
283+
echo "$TESTNAME : FAIL" >"$RESULT_FILE"
284+
exit 0
285+
fi
286+
log_debug "$dom_name: endpoint not present (checked /dev/fastrpc-${_ep} and /dev/fastrpc-${_ep}-secure); skipping auto-discovered domain"
287+
fi
288+
unset _ep
289+
done
259290

260-
if [ "$soc_skip_all" -eq 1 ]; then
261-
log_skip "$TESTNAME SKIP - SoC $SOC_MACHINE does not support FastRPC"
291+
if [ -z "$available_domains" ]; then
292+
log_dsp_remoteproc_status
293+
log_skip "$TESTNAME SKIP - no FastRPC endpoint devices found"
262294
echo "$TESTNAME : SKIP" >"$RESULT_FILE"
263295
exit 0
264296
fi
265297

266-
if [ "$soc_skip_gpdsp" -eq 1 ]; then
267-
filtered=""
268-
for d in $DOMAINS_TO_TEST; do
269-
case "$d" in
270-
5|6) log_info "SoC $SOC_MACHINE: skipping $(domain_to_name "$d") (not supported)" ;;
271-
*) filtered="${filtered:+$filtered }$d" ;;
272-
esac
273-
done
274-
DOMAINS_TO_TEST="$filtered"
275-
fi
276-
277-
if [ -z "$DOMAINS_TO_TEST" ]; then
278-
log_skip "$TESTNAME SKIP - no supported domains remain after SoC filter ($SOC_MACHINE)"
279-
echo "$TESTNAME : SKIP" >"$RESULT_FILE"
280-
exit 0
281-
fi
298+
DOMAINS_TO_TEST="$available_domains"
282299

283300
log_info "Domain mode: $DOMAIN_MODE"
284301
log_info "Domains to test: $DOMAINS_TO_TEST"
@@ -297,6 +314,16 @@ done
297314

298315
log_info "PD mode: $PD_MODE"
299316

317+
# Log the invocation matrix so CI operators can set a realistic action timeout.
318+
_matrix_invs=0
319+
for _md in $DOMAINS_TO_TEST; do
320+
_md_pd_count=0
321+
for _mp in $(effective_pds_for_domain "$_md"); do _md_pd_count=$((_md_pd_count+1)); done
322+
_matrix_invs=$((_matrix_invs + _md_pd_count * REPEAT))
323+
done
324+
log_info "Invocation matrix: ${_matrix_invs} run(s) × ${TIMEOUT}s timeout → worst-case ~$((_matrix_invs * TIMEOUT))s"
325+
unset _md _md_pd_count _mp _matrix_invs
326+
300327
# -------------------- Buffering tool availability ---------------
301328
HAVE_STDBUF=0; command -v stdbuf >/dev/null 2>&1 && HAVE_STDBUF=1
302329
HAVE_SCRIPT=0; command -v script >/dev/null 2>&1 && HAVE_SCRIPT=1
@@ -328,6 +355,15 @@ RESULTS_TRACKER=""
328355

329356
for DOMAIN in $DOMAINS_TO_TEST; do
330357
dom_name="$(domain_to_name "$DOMAIN")"
358+
359+
# Defensive re-check; the pre-filter above should have caught this.
360+
if ! fastrpc_domain_endpoint_available "$DOMAIN"; then
361+
_ep_rc="$(domain_to_endpoint_label "$DOMAIN")"
362+
log_info "Skipping $dom_name: endpoint not present (checked /dev/fastrpc-${_ep_rc} and /dev/fastrpc-${_ep_rc}-secure)"
363+
unset _ep_rc
364+
continue
365+
fi
366+
331367
PD_VALUES="$(effective_pds_for_domain "$DOMAIN")"
332368

333369
if [ -z "$PD_VALUES" ]; then
@@ -433,15 +469,10 @@ for DOMAIN in $DOMAINS_TO_TEST; do
433469
fi
434470

435471
# Track invocation result immediately
436-
# SM8850: libhap_example HAP_mem DMA handle not supported - treat as known skip
437472
if [ "$rc" -eq 0 ] && [ -r "$iter_log" ] && grep -F -q -e "All tests completed successfully" -e "All applicable tests PASSED" "$iter_log"; then
438473
PASS_COUNT=$((PASS_COUNT+1))
439474
combo_pass=$((combo_pass+1))
440475
log_pass "$iter_tag: success"
441-
elif case "$SOC_MACHINE" in *SM8850*) true ;; *) false ;; esac && only_hap_example_failed "$iter_log"; then
442-
PASS_COUNT=$((PASS_COUNT+1))
443-
combo_pass=$((combo_pass+1))
444-
log_pass "$iter_tag: success (libhap_example.so HAP_mem skipped on $SOC_MACHINE - DMA handle not supported)"
445476
else
446477
combo_fail=$((combo_fail+1))
447478
log_warn "$iter_tag: success pattern not found"

0 commit comments

Comments
 (0)