Skip to content

Commit 449ba39

Browse files
authored
Merge pull request qualcomm-linux#170 from smuppand/fastrpc-test
fastrpc_test: export ASSETS_DIR for back-compat, silence ShellCheck SC2034
2 parents f4a7965 + 78e2929 commit 449ba39

File tree

2 files changed

+45
-12
lines changed

2 files changed

+45
-12
lines changed

Runner/plans/fastrpc-premerge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ metadata:
1414
run:
1515
steps:
1616
- cd Runner
17-
- $PWD/suites/Multimedia/CDSP/fastrpc_test/run.sh --bin-dir /usr/local/bin || true
17+
- $PWD/suites/Multimedia/CDSP/fastrpc_test/run.sh || true
1818
- $PWD/utils/send-to-lava.sh $PWD/suites/Multimedia/CDSP/fastrpc_test/fastrpc_test.res || true
1919
- $PWD/utils/result_parse.sh

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

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ REPEAT=1
3636
TIMEOUT=""
3737
ARCH=""
3838
BIN_DIR="" # directory that CONTAINS fastrpc_test
39-
ASSETS_DIR="" # informational; assets should be alongside binary (…/linux)
39+
ASSETS_DIR="" # kept for compatibility/logging (not used by new layout)
4040
VERBOSE=0
4141
USER_PD_FLAG=0 # default: -U 0 (system/signed PD)
4242
CLI_DOMAIN=""
@@ -49,7 +49,7 @@ Usage: $0 [OPTIONS]
4949
Options:
5050
--arch <name> Architecture (only if explicitly provided)
5151
--bin-dir <path> Directory containing 'fastrpc_test' (default: /usr/local/bin)
52-
--assets-dir <path> Directory that CONTAINS 'linux/' (info only)
52+
--assets-dir <path> (compat) previously used when assets lived under 'linux/'
5353
--domain <0|1|2|3> DSP domain: 0=ADSP, 1=MDSP, 2=SDSP, 3=CDSP
5454
--domain-name <name> DSP domain by name: adsp|mdsp|sdsp|cdsp
5555
--user-pd Use '-U 1' (user/unsigned PD). Default is '-U 0'
@@ -66,9 +66,14 @@ Env:
6666
ALLOW_BIN_FASTRPC=1 Permit using /bin/fastrpc_test when --bin-dir=/bin.
6767
6868
Notes:
69-
- Script *cd*s into the binary's directory and launches ./fastrpc_test so
70-
'linux/' next to the binary (e.g. /usr/local/bin/linux) is discovered reliably.
71-
- If domain not provided, we auto-pick: CDSP if present; else ADSP; else SDSP; else 3.
69+
- Script *cd*s into the binary directory and launches ./fastrpc_test.
70+
- Libraries are resolved via:
71+
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/fastrpc_test[:\$LD_LIBRARY_PATH]
72+
- DSP skeletons are resolved via (if present):
73+
ADSP_LIBRARY_PATH=/usr/local/share/fastrpc_test/v75[:v68]
74+
CDSP_LIBRARY_PATH=/usr/local/share/fastrpc_test/v75[:v68]
75+
SDSP_LIBRARY_PATH=/usr/local/share/fastrpc_test/v75[:v68]
76+
- If domain not provided, auto-pick: CDSP if present; else ADSP; else SDSP; else 3.
7277
EOF
7378
}
7479

@@ -89,6 +94,13 @@ while [ $# -gt 0 ]; do
8994
esac
9095
done
9196

97+
# ---- Back-compat: accept --assets-dir but ignore in the new /usr/local layout.
98+
# Export so external tooling (or legacy wrappers) can still read it.
99+
if [ -n "${ASSETS_DIR:-}" ]; then
100+
export ASSETS_DIR
101+
log_info "(compat) --assets-dir provided: $ASSETS_DIR (ignored with /usr/local layout)"
102+
fi
103+
92104
# ---------- Validation ----------
93105
case "$REPEAT" in *[!0-9]*|"") log_error "Invalid --repeat: $REPEAT"; echo "$TESTNAME : FAIL" >"$RESULT_FILE"; exit 1 ;; esac
94106
if [ -n "$TIMEOUT" ]; then
@@ -214,20 +226,38 @@ if [ ! -x "$RUN_BIN" ]; then
214226
exit 1
215227
fi
216228

217-
if [ -n "$ASSETS_DIR" ]; then
218-
[ -d "$ASSETS_DIR/linux" ] || log_warn "--assets-dir provided but no 'linux/' inside: $ASSETS_DIR"
219-
fi
220-
[ -d "$RUN_DIR/linux" ] || log_warn "No 'linux/' under $RUN_DIR; the sample libs may be missing"
229+
# New layout checks (replace legacy 'linux/' checks)
230+
LIB_SYS_DIR="/usr/local/lib"
231+
LIB_TEST_DIR="/usr/local/lib/fastrpc_test"
232+
SKEL_BASE="/usr/local/share/fastrpc_test"
233+
234+
SKEL_PATH=""
235+
[ -d "$SKEL_BASE/v75" ] && SKEL_PATH="${SKEL_PATH:+$SKEL_PATH:}$SKEL_BASE/v75"
236+
[ -d "$SKEL_BASE/v68" ] && SKEL_PATH="${SKEL_PATH:+$SKEL_PATH:}$SKEL_BASE/v68"
237+
238+
[ -d "$LIB_SYS_DIR" ] || log_warn "Missing system libs dir: $LIB_SYS_DIR (lib{adsp,cdsp,sdsp}rpc*.so expected)"
239+
[ -d "$LIB_TEST_DIR" ] || log_warn "Missing test libs dir: $LIB_TEST_DIR (libcalculator.so, etc.)"
240+
[ -n "$SKEL_PATH" ] || log_warn "No DSP skeleton dirs found under: $SKEL_BASE (expected v75/ v68/)"
221241

222242
log_info "Using binary: $RUN_BIN"
223243
log_info "Run dir: $RUN_DIR (launching ./fastrpc_test)"
224244
log_info "Binary details:"
225245
log_info " ls -l: $(ls -l "$RUN_BIN" 2>/dev/null || echo 'N/A')"
226246
log_info " file : $(file "$RUN_BIN" 2>/dev/null || echo 'N/A')"
227247

228-
# >>>>>>>>>>>>>>>>>>>>>> Added per your request <<<<<<<<<<<<<<<<<<<<<<
229-
export LD_LIBRARY_PATH="/usr/local/lib/fastrpc_test${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
248+
# >>>>>>>>>>>>>>>>>>>>>> ENV for your initramfs layout <<<<<<<<<<<<<<<<<<<<<<
249+
# Libraries: system + test payloads
250+
export LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib/fastrpc_test${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
251+
# Skeletons: export if present (don’t clobber if user already set)
252+
[ -n "$SKEL_PATH" ] && {
253+
: "${ADSP_LIBRARY_PATH:=$SKEL_PATH}"; export ADSP_LIBRARY_PATH
254+
: "${CDSP_LIBRARY_PATH:=$SKEL_PATH}"; export CDSP_LIBRARY_PATH
255+
: "${SDSP_LIBRARY_PATH:=$SKEL_PATH}"; export SDSP_LIBRARY_PATH
256+
}
230257
log_info "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
258+
[ -n "$ADSP_LIBRARY_PATH" ] && log_info "ADSP_LIBRARY_PATH=${ADSP_LIBRARY_PATH}"
259+
[ -n "$CDSP_LIBRARY_PATH" ] && log_info "CDSP_LIBRARY_PATH=${CDSP_LIBRARY_PATH}"
260+
[ -n "$SDSP_LIBRARY_PATH" ] && log_info "SDSP_LIBRARY_PATH=${SDSP_LIBRARY_PATH}"
231261
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
232262

233263
# Log *dsp remoteproc statuses via existing helpers
@@ -328,6 +358,9 @@ while [ "$i" -le "$REPEAT" ]; do
328358
echo "RUN_BIN=$RUN_BIN"
329359
echo "PATH=$PATH"
330360
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}"
361+
echo "ADSP_LIBRARY_PATH=${ADSP_LIBRARY_PATH:-}"
362+
echo "CDSP_LIBRARY_PATH=${CDSP_LIBRARY_PATH:-}"
363+
echo "SDSP_LIBRARY_PATH=${SDSP_LIBRARY_PATH:-}"
331364
echo "ARCH=${ARCH:-}"
332365
echo "PD_VAL=$PD_VAL"
333366
echo "DOMAIN=$DOMAIN ($dom_name)"

0 commit comments

Comments
 (0)