Skip to content

fastrpc: Support a per-invocation result name - #634

Open
Anil (qcom-anilyada) wants to merge 1 commit into
qualcomm-linux:mainfrom
qcom-anilyada:add-lava-testcase-id-support
Open

Anil (qcom-anilyada) wants to merge 1 commit into
qualcomm-linux:mainfrom
qcom-anilyada:add-lava-testcase-id-support

Conversation

@qcom-anilyada

@qcom-anilyada Anil (qcom-anilyada) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Accept --res-suffix and --lava-testcase-id so one invocation does not overwrite the result file of another and so the reported testcase id can name what was tested. Both default to the current behaviour.

A plan that runs this test once per DSP domain otherwise reports every run as fastrpc_test, and a consumer keyed on the testcase name keeps only the result written last.

Passed job: https://lava.infra.foundries.io/scheduler/job/519341

Signed-off-by: Anil Yadav anilyada@qti.qualcomm.com

RES_FILE="$SCRIPT_DIR/${TESTNAME}${RES_SUFFIX:+_${RES_SUFFIX}}.res"
RESULT_FILE="$RES_FILE"
test_result_init "$TESTNAME" "$RESULT_FILE"
test_result_init "$RESULT_TESTNAME" "$RESULT_FILE"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Validate the result ID and suffix before calling test_result_init. An empty ID loses the reported testcase, a newline in the ID can emit an extra result, and a suffix such as missing/variant leaves no result file while the script exits zero. Add shared validation in functestlib.sh that rejects invalid names rather than silently sanitizing them, and check the return from test_result_init before continuing.

TESTNAME="fastrpc_test"
RES_FILE="$SCRIPT_DIR/${TESTNAME}.res"
RESULT_TESTNAME="$TESTNAME"
RES_SUFFIX="" # Optional suffix for unique result files (e.g., "adsp")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The agreed --res-suffix behavior in #626 also separates per-execution logs, but this currently changes only the .res filename. Logs still use logs_fastrpc_test_<timestamp>, so invocations started within the same second in one checkout can share artifacts despite different suffixes. Please include the suffix in artifact paths and use a unique run directory, or explicitly defer this part of #626. audio_create_run_directory() in audio_common.sh already provides unique retained directories and could be moved into a common helper for reuse.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new LOG_ROOT separates the workload artifacts, but init_env starts stdout capture before these options are parsed. Two runs started in the same second still append to the same fastrpc_test_stdout_.log, mixing their output even with different suffixes. Set a unique RUN_STDOUT_FILE before the first init_env source, or enhance its existing capture setup to allocate a separate stdout file per invocation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is resolved now, now only condition where the two runs can still share a file name would be, if they have same suffix which is not expected, other cases are handled regarding file name collision, please have a look

REPEAT: 1 # Number of repetitions (default: 1)
TIMEOUT: 120 # Required positive timeout for each fastrpc_test invocation
HEALTHCHECK_TIMEOUT: 15 # Required positive timeout for fastrpc-healthcheck
RES_SUFFIX: "" # Suffix for a unique result file (e.g., "adsp" generates fastrpc_test_adsp.res), default: unset

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update fastrpc_test_README.md with examples for these options, the accepted name characters, the result filename to publish, and the matching LAVA expected ID. Explain that RES_SUFFIX changes the filename while LAVA_TESTCASE_ID changes the reported ID, so setting only the suffix does not give LAVA a unique testcase ID.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new README says an empty suffix is rejected, but the runner accepts it and the YAML defaults RES_SUFFIX to an empty string. Please document that the suffix is optional and may be empty, while LAVA_TESTCASE_ID must be nonempty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

@qcom-anilyada
Anil (qcom-anilyada) force-pushed the add-lava-testcase-id-support branch from 1cde542 to 1fc271d Compare October 29, 2026 08:15
- ./run.sh --arch "${ARCH}" --bin-dir "${BIN_DIR}" --domain-mode "${DOMAIN_MODE}" --domain "${DOMAIN}" --domain-name "${DOMAIN_NAME}" --pd-mode "${PD_MODE}" --repeat "${REPEAT}" --timeout "${TIMEOUT}" --healthcheck-timeout "${HEALTHCHECK_TIMEOUT}" $UNSIGNED_PD_PARAM || true
- $REPO_PATH/Runner/utils/send-to-lava.sh fastrpc_test.res || true
- ./run.sh --arch "${ARCH}" --bin-dir "${BIN_DIR}" --domain-mode "${DOMAIN_MODE}" --domain "${DOMAIN}" --domain-name "${DOMAIN_NAME}" --pd-mode "${PD_MODE}" --repeat "${REPEAT}" --timeout "${TIMEOUT}" --healthcheck-timeout "${HEALTHCHECK_TIMEOUT}" --res-suffix "${RES_SUFFIX}" --lava-testcase-id "${LAVA_TESTCASE_ID}" $UNSIGNED_PD_PARAM || true
- $REPO_PATH/Runner/utils/send-to-lava.sh fastrpc_test${RES_SUFFIX:+_${RES_SUFFIX}}.res || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If fastrpc_test.res contains an earlier PASS, running with an invalid --lava-testcase-id exits before test_result_init removes that file. The preceding step ignores the nonzero exit and this step publishes the old PASS. Gate send-to-lava.sh on successful completion of this invocation instead of using an unconditional publisher. test_result_finish already returns zero for current FAIL and SKIP results, so those can still be published.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

Accept --res-suffix and --lava-testcase-id so one invocation does not
overwrite the result, evidence or reported name of another. Both default
to the current behaviour, and the suffix may be empty.

Without this, a plan that runs the test once per DSP domain reports every
run as fastrpc_test and a consumer keyed on that name keeps only the last.

Reject an invalid testcase id or suffix instead of sanitizing it, and name
the evidence directory and the stdout capture after the suffix so separate
invocations keep separate artifacts.

Publish only when the runner wrote its own result, otherwise a rejected
invocation would republish the previous run's result.

Signed-off-by: Anil Yadav <anilyada@qti.qualcomm.com>
@qcom-anilyada
Anil (qcom-anilyada) force-pushed the add-lava-testcase-id-support branch from 1fc271d to f6168bb Compare October 30, 2026 09:55
test_result_finish "FAIL" "$TESTNAME FAIL - cannot create log directory below: $LOG_BASE"
fi

log_info "Evidence directory: $test_path/$LOG_ROOT"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test_create_run_directory() returns an absolute path, so prefixing it with $test_path/ prints a duplicated path that does not exist. Log $LOG_ROOT directly so users can locate the saved evidence.

This branch has not been deployed

No deployments
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