Skip to content

Conversation

smuppand
Copy link
Contributor

@smuppand smuppand commented Sep 1, 2025

The fastrpc_test wrapper was flaky in CI because the binary/assets paths depended on CWD and PATH.
This PR makes path resolution deterministic, defaults assets to /usr/bin/linux (matching our package layout),
adds resilient stdout buffering fallback, and guarantees a .res file for LAVA/CI consumption.

Changes

  • Binary discovery (no hardcoding):
    • prefer --bin-dir
    • else command -v fastrpc_test
    • else fallbacks: /usr/bin/fastrpc_test, /opt/qcom/bin/fastrpc_test
    • validate with -x and log binary details (ls/file)
  • Assets resolution (default to $BINDIR/linux):
    • prefer --assets-dir / FASTRPC_ASSETS_DIR
    • then $BINDIR (so /usr/bin/linux in our layout)
    • then $SCRIPT_DIR
    • then FHS-ish fallbacks: /usr/share|/usr/lib/fastrpc_test/linux
    • log the chosen assets dir
  • Buffering/timeout execution fallback:
    • try stdbuf -oL -eL → else script -q → else plain exec
    • optional --timeout integrated via existing run_with_timeout
  • CLI polish & safety:
    • --repeat, --timeout, --arch, --bin-dir, --assets-dir, --verbose
    • strict validation for numeric args
    • clear log lines for repeats, buffering, paths
  • CI/LAVA robustness:
    • always writes <testname>.res (PASS/FAIL) on every exit path
    • creates per-iteration logs and RC files in ./logs_fastrpc_test_<ts>/

@smuppand smuppand requested a review from abbajaj806 September 1, 2025 16:06
…o /usr/bin/linux

- Add resilient binary discovery:
  * prefer --bin-dir
  * else PATH via command -v
  * else fallbacks (/usr/bin/fastrpc_test, /opt/qcom/bin/fastrpc_test)
- Resolve assets directory with clear priority:
  * --assets-dir / FASTRPC_ASSETS_DIR
  *  (so /usr/bin → /usr/bin/linux by default)
  * SCRIPT_DIR
  * FHS-ish fallbacks (/usr/share|/usr/lib/fastrpc_test)
- Prefer /linux as default to match install layout (/usr/bin/linux)
- Buffering execution fallback: stdbuf → script → plain, with optional timeout
- Improve logs (binary path/details, run dir, repeats, timeout, buffering)
- Guarantee .res creation on all exit paths for CI/LAVA consumption

Signed-off-by: Srikanth Muppandam <[email protected]>
Copy link
Contributor

@abbajaj806 abbajaj806 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@abbajaj806 abbajaj806 merged commit 51e033b into qualcomm-linux:main Sep 2, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants