fix: update shmbridge testcase#446
Conversation
smuppand
left a comment
There was a problem hiding this comment.
The direction is good: this expands shmbridge from a simple qcom_scm presence/log check into stronger runtime validation for sysfs, DT, platform driver registration, binding, attributes, and uevent information.
A few changes are needed
| scm_uevent_found=0 | ||
| for dev_link in /sys/bus/platform/drivers/qcom_scm/*; do | ||
| [ -L "$dev_link" ] || continue | ||
| dev_path=$(readlink -f "$dev_link" 2>/dev/null) |
There was a problem hiding this comment.
readlink is used but not checked. Also, readlink -f can vary on minimal BusyBox systems. The uevent/modalias check can silently degrade.
There was a problem hiding this comment.
Added check for readlink
There was a problem hiding this comment.
Added check for readlink
If readlink -f fails, dev_path becomes empty and the script silently checks /uevent.
This test validates the presence, registration, and correct runtime state of the qcom_scm driver on the target device Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
|
|
||
| # shellcheck disable=SC1090 | ||
| . "$INIT_ENV" | ||
| if [ "${__INIT_ENV_LOADED:-}" ]; then |
There was a problem hiding this comment.
The guard is inverted. This sources init_env only when __INIT_ENV_LOADED is already set. On a normal first-time run, init_env will not be sourced, but the script still immediately sources "$TOOLS/functestlib.sh"
should be
if [ -z "${__INIT_ENV_LOADED:-}" ]; then
# shellcheck disable=SC1090
. "$INIT_ENV"
fi
| if ! check_kernel_config "CONFIG_QCOM_SCM"; then | ||
| log_skip "$TESTNAME : CONFIG_QCOM_SCM not enabled, test Skipped" | ||
| echo "$TESTNAME SKIP" > "$res_file" | ||
| log_fail "$TESTNAME : CONFIG_QCOM_SCM not enabled, test Skipped" |
There was a problem hiding this comment.
The log says “Skipped”, but the result file writes FAIL.
| scm_uevent_found=0 | ||
| for dev_link in /sys/bus/platform/drivers/qcom_scm/*; do | ||
| [ -L "$dev_link" ] || continue | ||
| dev_path=$(readlink -f "$dev_link" 2>/dev/null) |
There was a problem hiding this comment.
Added check for readlink
If readlink -f fails, dev_path becomes empty and the script silently checks /uevent.
This test validates the presence, registration, and correct runtime state of the qcom_scm driver on the target device