Skip to content

Modularized adsp, cdsp, and wpss remoteproc tests using common helper functions #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sai-teja573
Copy link
Contributor

Refactored remoteproc test scripts for adsp, cdsp, and wpss to use modular helper functions from functestlib.sh.

Changes include:

  • Replaced hardcoded logic with reusable functions: get_remoteproc_path_by_firmware, get_remoteproc_state, stop_remoteproc, and start_remoteproc.
  • Improved readability, maintainability, and consistency across these subsystem tests.

This modularization lays the foundation for extending the same structure to other subsystems like gdsp and general remoteproc validation in future updates.

… functions.

Refactored adsp, cdsp, and wpss remoteproc tests.
Introduced modular helper usage and standardized logging.

Signed-off-by: Sai-teja573 <122cs0573@nitrkl.ac.in>
# Find the remoteproc path for a given firmware substring (e.g., "adsp", "cdsp", "gdsp").
get_remoteproc_path_by_firmware() {
name="$1"
local idx path
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace local with unscoped variable.

log_fail "$TESTNAME : Test Failed"
echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res"
rproc_path=$(get_remoteproc_path_by_firmware "adsp") || {
log_fail "$TESTNAME" "adsp remoteproc path not found"
Copy link
Contributor

Choose a reason for hiding this comment

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

It’s better to mark this as info and skip the test, rather than fail it. Since the node isn’t present, further validation isn’t needed. If any additional steps fail, then it would make sense to mark it as a failure.

state=$(get_remoteproc_state "$rproc_path")
[ "$state" = "running" ] || {
log_fail "$TESTNAME" "adsp remoteproc not running"
echo "$TESTNAME FAIL" > "$res_file"
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about adding logs or checks to confirm if the firmware loads when a particular subsystem isn’t running? This could help with debugging in CI.

Copy link
Contributor

@smuppand smuppand left a comment

Choose a reason for hiding this comment

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

A few changes are needed to make it more CI-friendly and easier to debug failures.

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.

2 participants