Skip to content

Commit a9e2df5

Browse files
committed
fastrpc_test: default to /usr/bin; add --domain/--user-pd; tougher CI logging
- Always cd to /usr/bin and launch ./fastrpc_test so bundled assets (/usr/bin/linux) are discovered reliably. - Add domain selection: * --domain <0|1|2|3> or --domain-name <adsp|mdsp|sdsp|cdsp> * ENV overrides: FASTRPC_DOMAIN / FASTRPC_DOMAIN_NAME * Auto-pick if unset: CDSP(3) if present, else ADSP(0), else SDSP(2), else 3 - PD mode: default -U 0; opt-in user PD via --user-pd or FASTRPC_USER_PD=1 - Refuse /bin by default (seen to fail on some ramdisks); allow with ALLOW_BIN_FASTRPC=1 or explicit --bin-dir=/bin - Stronger CI diagnostics: * log SoC info (machine/soc_id/platform_version) * enumerate *dsp remoteprocs via existing helpers * per-iteration .env/.cmd/.out/.rc (and dmesg on error) * show exact command with safe quoting - Safer argv construction and quoting; no reliance on shell word-splitting - Result file always produced (PASS/FAIL) Examples: ./run.sh # auto domain (likely CDSP), -U 0 ./run.sh --domain 0 # ADSP ./run.sh --domain-name cdsp # CDSP FASTRPC_USER_PD=1 ./run.sh # run with -U 1 ./run.sh --bin-dir /usr/bin # explicit path if needed Signed-off-by: Srikanth Muppandam <[email protected]>
1 parent c1396e3 commit a9e2df5

File tree

2 files changed

+279
-109
lines changed

2 files changed

+279
-109
lines changed

Runner/suites/Multimedia/CDSP/fastrpc_test/fastrpc_test_README.md

Lines changed: 67 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,20 @@ Runner/
4949
Usage: run.sh [OPTIONS]
5050
5151
Options:
52-
--arch <name> Architecture (auto-detected from SoC if omitted)
53-
--bin-dir <path> Directory that contains the 'fastrpc_test' binary
54-
--assets-dir <path> Directory that CONTAINS 'linux/' (libs/assets parent)
55-
--repeat <N> Number of iterations (default: 1)
56-
--timeout <sec> Timeout per run (no timeout if omitted)
57-
--verbose Extra logging for CI debugging
58-
--help Show this help
59-
60-
Binary & assets resolution (in order):
61-
Binary: 1) --bin-dir 2) $PATH (command -v fastrpc_test)
62-
Assets: 1) --assets-dir
63-
2) <bin-dir> (if provided)
64-
3) directory of resolved binary
65-
4) directory of this run.sh
66-
5) common locations: /usr/share/bin, /usr/share/fastrpc, /opt/fastrpc
52+
--arch <name> Architecture (only if explicitly provided)
53+
--bin-dir <path> Directory containing 'fastrpc_test' (default: /usr/bin)
54+
--assets-dir <path> Directory that CONTAINS 'linux/' (info only; we run from the binary dir)
55+
--user-pd Use '-U 1' (user/unsigned PD). Default is '-U 0'.
56+
--repeat <N> Number of repetitions (default: 1)
57+
--timeout <sec> Timeout for each run (no timeout if omitted)
58+
--verbose Extra logging for CI debugging
59+
--help Show this help
60+
61+
Env:
62+
FASTRPC_USER_PD=0|1 Sets PD (-U value). CLI --user-pd overrides to 1.
63+
FASTRPC_EXTRA_FLAGS Extra flags appended to the command.
64+
ALLOW_BIN_FASTRPC=1 Permit using /bin/fastrpc_test (otherwise refused).
65+
6766
The test executes FROM the assets directory so 'fastrpc_test' can find deps.
6867
```
6968

@@ -77,36 +76,70 @@ The test executes FROM the assets directory so 'fastrpc_test' can find deps.
7776
### Common scenarios
7877

7978
```bash
80-
# 1) Binary in a custom folder; assets are alongside it (i.e., that folder has linux/)
81-
./run.sh --bin-dir /opt/qcom/fastrpc --repeat 5
82-
83-
# 2) Binary in PATH; assets somewhere else
84-
./run.sh --assets-dir /opt/qcom/fastrpc_assets --timeout 45
79+
# Default expects /usr/bin/fastrpc_test and /usr/bin/linux
80+
./run.sh
81+
82+
Common scenarios
83+
84+
# 1) Use a custom binary directory (we will cd there and run ./fastrpc_test)
85+
./run.sh --bin-dir /tmp/stage/usr/bin
86+
87+
# 2) Opt into user/unsigned PD (-U 1)
88+
./run.sh --user-pd
89+
# or via env
90+
FASTRPC_USER_PD=1 ./run.sh
91+
92+
# 3) Add extra flags (kept intact; -U is appended last as '-U 0/1')
93+
FASTRPC_EXTRA_FLAGS="-d 3" ./run.sh
94+
95+
# 4) Allow /bin explicitly (generally discouraged unless required)
96+
ALLOW_BIN_FASTRPC=1 ./run.sh --bin-dir /bin
97+
98+
# 5) Run multiple iterations with a timeout and verbose logs
99+
./run.sh --repeat 3 --timeout 120 --verbose
100+
101+
Force CDSP explicitly:
102+
103+
# 6) ./run.sh --domain 3
104+
# or
105+
# 6) ./run.sh --domain-name cdsp
106+
107+
Use ADSP and user PD:
108+
109+
# 7) ./run.sh --domain-name adsp --user-pd
110+
111+
From env (CI):
112+
113+
FASTRPC_DOMAIN=2 FASTRPC_USER_PD=1 ./run.sh
114+
# => SDSP with -U 1
115+
```
85116

86-
# 3) Both explicitly provided (most deterministic)
87-
./run.sh --bin-dir /opt/qcom/fastrpc/bin --assets-dir /opt/qcom/fastrpc --arch v75 --repeat 10 --timeout 30 --verbose
117+
### LAVA integration example
88118

89-
# 4) Force architecture (skip SoC autodetect)
90-
./run.sh --arch v68
119+
```
120+
- $PWD/suites/Multimedia/CDSP/fastrpc_test/run.sh --bin-dir /usr/bin || true
121+
- $PWD/utils/send-to-lava.sh $PWD/suites/Multimedia/CDSP/fastrpc_test/fastrpc_test.res || true
91122
```
92123

93124
### Sample output (trimmed)
94125

95126
```
96-
[INFO] 2025-08-13 09:12:01 - -------------------Starting fastrpc_test Testcase----------------------------
97-
[INFO] 2025-08-13 09:12:01 - Buffering: stdbuf -oL -eL | Timeout: 60 sec | Arch: v68
98-
[INFO] 2025-08-13 09:12:01 - Resolved binary: /usr/bin/fastrpc_test
99-
[INFO] 2025-08-13 09:12:01 - Assets dir: /usr/bin (linux/ expected here)
100-
[INFO] 2025-08-13 09:12:01 - Running iter1/3 | start: 2025-08-13T09:12:01Z | cmd: fastrpc_test -d 3 -U 1 -t linux -a v68
127+
[INFO] 2025-09-02 10:44:46 - -------------------Starting fastrpc_test Testcase----------------------------
128+
[INFO] 2025-09-02 10:44:46 - Using binary: /usr/bin/fastrpc_test
129+
[INFO] 2025-09-02 10:44:46 - PD setting: -U 0 (use --user-pd to set -U 1)
130+
[INFO] 2025-09-02 10:44:46 - Run dir: /usr/bin (launching ./fastrpc_test)
131+
[INFO] 2025-09-02 10:44:46 - Executing: ./fastrpc_test -d 3 -t linux -U 0
132+
----- iter1 output begin -----
101133
... fastrpc_test output ...
102-
[PASS] 2025-08-13 09:12:05 - iter1: pattern matched
103-
[INFO] 2025-08-13 09:12:05 - Running iter2/3 | start: ...
104-
...
105-
[FAIL] 2025-08-13 09:12:15 - fastrpc_test : Test Failed (2/3) | logs: ./logs_fastrpc_test_20250813-091201
134+
----- iter1 output end -----
135+
[PASS] 2025-09-02 10:44:50 - iter1: success
136+
[PASS] 2025-09-02 10:44:50 - fastrpc_test : Test Passed (1/1)
106137
```
107138

108139
## CI debugging aids
109-
140+
- Binary resolved to /bin/fastrpc_test: By default this is blocked to avoid loader/ramdisk mismatches. Set ALLOW_BIN_FASTRPC=1 and/or --bin-dir /bin if you intentionally need it.
141+
- Error resolving path .../linux: Ensure linux/ is next to the binary (e.g., /usr/bin/linux). The script runs from the binary dir specifically to make this work.
142+
- Session create errors with -U 1: If you opt into user/unsigned PD and see 0x80000416, confirm your image includes unsigned shells/policies (or revert to the default -U 0).
110143
- Per-iteration logs: `logs_fastrpc_test_<timestamp>/iterN.out` (+ `iterN.rc`)
111144
- Summary result file: `fastrpc_test.res` (`PASS` / `FAIL`)
112145
- Verbose mode: adds environment, resolutions, and timing details

0 commit comments

Comments
 (0)