diff --git a/Runner/suites/Multimedia/CDSP/fastrpc_test/run.sh b/Runner/suites/Multimedia/CDSP/fastrpc_test/run.sh index d3978995..f5e47fc3 100755 --- a/Runner/suites/Multimedia/CDSP/fastrpc_test/run.sh +++ b/Runner/suites/Multimedia/CDSP/fastrpc_test/run.sh @@ -216,6 +216,22 @@ fi # -------------------- Runtime layout discovery -------------------- fastrpc_setup_runtime_layout +# Gate on artifacts being present: a domain appearing in remoteproc/DT does not +# guarantee the FastRPC libraries, DSP skeletons, and endpoint device nodes are +# usable. Without them every invocation would fail rather than skip, which is +# the wrong signal. +if [ -z "${FASTRPC_RESOLVED_LIB_SYS_DIR:-}" ]; then + log_skip "$TESTNAME SKIP - FastRPC system library directory not found" + echo "$TESTNAME : SKIP" >"$RESULT_FILE" + exit 0 +fi + +if [ -z "${FASTRPC_RESOLVED_SKEL_BASE:-}" ]; then + log_skip "$TESTNAME SKIP - FastRPC DSP skeleton base directory not found" + echo "$TESTNAME : SKIP" >"$RESULT_FILE" + exit 0 +fi + log_info "Using binary: $RUN_BIN" log_info "Run dir: $RUN_DIR (launching ./fastrpc_test)" log_info "Binary details:" @@ -237,48 +253,28 @@ if [ -z "$DOMAINS_TO_TEST" ]; then exit 0 fi -# -------------------- SoC-specific domain blacklist -------------------- -# QRB2210: FastRPC not supported - skip entire test -# QCS9075, QCS8275, QCS8300, QCS9100: GPDSP0 (domain 5) and GPDSP1 (domain 6) not supported currently -# SM8850: libhap_example HAP_mem DMA not supported - treat as known skip per invocation -# -# Do not skip Glymur CRD by SoC name. Newer Glymur/Debian images expose -# ADSP/CDSP remoteproc instances and FastRPC skeletons, so runtime discovery -# should decide whether the test can run. -soc_skip_all=0 -soc_skip_gpdsp=0 - -case "$SOC_MACHINE" in - *QRB2210*|*"Glymur CRD"*) - soc_skip_all=1 - ;; - *QCS9075*|*QCS8275*|*QCS8300*|*QCS9100*) - soc_skip_gpdsp=1 - ;; -esac +# -------------------- Validate FastRPC endpoint availability -------------------- +# Early validation: check if discovered domains have endpoint devices available. +# Skip test if none are accessible, rather than failing during execution. +available_domains="" +for d in $DOMAINS_TO_TEST; do + dom_name="$(domain_to_name "$d")" + fastrpc_dev="/dev/fastrpc-$(printf '%s' "$dom_name" | tr '[:upper:]' '[:lower:]')" + if [ -c "$fastrpc_dev" ]; then + available_domains="${available_domains:+$available_domains }$d" + log_debug "Endpoint available: $fastrpc_dev" + else + log_debug "Endpoint not available: $fastrpc_dev" + fi +done -if [ "$soc_skip_all" -eq 1 ]; then - log_skip "$TESTNAME SKIP - SoC $SOC_MACHINE does not support FastRPC" +if [ -z "$available_domains" ]; then + log_skip "$TESTNAME SKIP - no FastRPC endpoint devices found" echo "$TESTNAME : SKIP" >"$RESULT_FILE" exit 0 fi -if [ "$soc_skip_gpdsp" -eq 1 ]; then - filtered="" - for d in $DOMAINS_TO_TEST; do - case "$d" in - 5|6) log_info "SoC $SOC_MACHINE: skipping $(domain_to_name "$d") (not supported)" ;; - *) filtered="${filtered:+$filtered }$d" ;; - esac - done - DOMAINS_TO_TEST="$filtered" -fi - -if [ -z "$DOMAINS_TO_TEST" ]; then - log_skip "$TESTNAME SKIP - no supported domains remain after SoC filter ($SOC_MACHINE)" - echo "$TESTNAME : SKIP" >"$RESULT_FILE" - exit 0 -fi +DOMAINS_TO_TEST="$available_domains" log_info "Domain mode: $DOMAIN_MODE" log_info "Domains to test: $DOMAINS_TO_TEST" @@ -328,6 +324,15 @@ RESULTS_TRACKER="" for DOMAIN in $DOMAINS_TO_TEST; do dom_name="$(domain_to_name "$DOMAIN")" + + # Check that the FastRPC endpoint device node for this domain exists. + # remoteproc/DT presence does not guarantee the driver has created the node. + fastrpc_dev="/dev/fastrpc-$(printf '%s' "$dom_name" | tr '[:upper:]' '[:lower:]')" + if [ ! -c "$fastrpc_dev" ]; then + log_info "Skipping $dom_name: endpoint $fastrpc_dev not present" + continue + fi + PD_VALUES="$(effective_pds_for_domain "$DOMAIN")" if [ -z "$PD_VALUES" ]; then @@ -433,15 +438,10 @@ for DOMAIN in $DOMAINS_TO_TEST; do fi # Track invocation result immediately - # SM8850: libhap_example HAP_mem DMA handle not supported - treat as known skip if [ "$rc" -eq 0 ] && [ -r "$iter_log" ] && grep -F -q -e "All tests completed successfully" -e "All applicable tests PASSED" "$iter_log"; then PASS_COUNT=$((PASS_COUNT+1)) combo_pass=$((combo_pass+1)) log_pass "$iter_tag: success" - elif case "$SOC_MACHINE" in *SM8850*) true ;; *) false ;; esac && only_hap_example_failed "$iter_log"; then - PASS_COUNT=$((PASS_COUNT+1)) - combo_pass=$((combo_pass+1)) - log_pass "$iter_tag: success (libhap_example.so HAP_mem skipped on $SOC_MACHINE - DMA handle not supported)" else combo_fail=$((combo_fail+1)) log_warn "$iter_tag: success pattern not found" diff --git a/Runner/utils/lib_fastrpc.sh b/Runner/utils/lib_fastrpc.sh index dc470019..ee2aa885 100755 --- a/Runner/utils/lib_fastrpc.sh +++ b/Runner/utils/lib_fastrpc.sh @@ -262,16 +262,6 @@ extract_test_summary_counts() { printf '%s:%s:%s:%s\n' "$total" "$passed" "$failed" "$skipped" } -# Returns true if the only failing subtest is libhap_example.so. -# Used to treat HAP_mem DMA failures as known-skip on affected SoCs. -only_hap_example_failed() { - log_file="$1" - - [ -r "$log_file" ] || return 1 - grep -F -q "[FAIL]" "$log_file" || return 1 - ! grep -F "[FAIL]" "$log_file" | grep -q -v "libhap_example.so" -} - log_dsp_remoteproc_status() { fw_list="adsp mdsp sdsp cdsp cdsp0 cdsp1 gdsp0 gdsp1 gpdsp0 gpdsp1" any=0