Added tests for dmabuf validations#296
Conversation
Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/dmabuf_heap_kselftest.yaml
Show resolved
Hide resolved
fb87ffd to
90efb69
Compare
Added the tests to check DMA configs, Device Tree Validation and upstream kselftests Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
|
This one should be split into 3 commits, unlike the simple one commit and one-testcase PR. It currently combines:
|
| fi | ||
|
|
||
| # Only source if not already loaded (idempotent) | ||
| if [ -z "$__INIT_ENV_LOADED" ]; then |
There was a problem hiding this comment.
Please use the unset-safe form here:
if [ -z "${__INIT_ENV_LOADED:-}" ]; then
Expanding "$__INIT_ENV_LOADED" directly is less robust when the variable is unset.
| log_info "============ Starting $TESTNAME Testcase =======================================" | ||
| log_info "================================================================================" | ||
|
|
||
| check_dependencies "find grep basename" |
There was a problem hiding this comment.
check_dependencies is called here, but its return code is not used. Can we gate this properly and SKIP early if required tools are missing, following the standard testkit dependency-check pattern?
| for region in /proc/device-tree/reserved-memory/*; do | ||
| if [ -d "$region" ]; then | ||
| region_name=$(basename "$region") | ||
| log_info " Region: $region_name" |
There was a problem hiding this comment.
This reserved-memory enumeration is useful as info, but it is not really DMA-BUF-specific validation yet. Can we either narrow this to relevant DMA-BUF/heap-related nodes or clearly keep it informational in the README/log wording?
| skip_count=${skip_count:-0} | ||
| error_count=${error_count:-0} | ||
| else | ||
| pass_count=$(grep -c "^ok " "$output_file" || echo 0) |
There was a problem hiding this comment.
In fallback mode, pass_count=$(grep -c "^ok " ...) still counts skipped tests as passes because TAP skip lines are ok ... # SKIP. Can we split this into:
skip_count=$(grep -c "^ok .*# SKIP" ...)
pass_count=(all ok) - skip_count so the fallback summary is accurate?
| pass=false | ||
| elif [ "$pass_count" -eq 0 ]; then | ||
| log_fail "No tests passed - possible execution issue" | ||
| pass=false |
There was a problem hiding this comment.
The pass/fail priority still treats a non-zero exit code as FAIL even when TAP totals might already say fail:0 error:0. Can we trust TAP totals first when they are present, and only fall back to exit-code-based judgment when totals are absent?
| pass=true | ||
|
|
||
| DEFAULT_BINARY_PATH="/kselftest/dmabuf-heaps/dmabuf-heap" | ||
| BINARY_PATH="$DEFAULT_BINARY_PATH" |
There was a problem hiding this comment.
Can we add explicit dependency checks near startup for the tools used in this script (grep, awk, cut, basename, etc.) and SKIP if they are unavailable? That would align with the standard dependency-gating pattern used elsewhere.
| ```bash | ||
| cd /path/to/Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest | ||
| ./run.sh /custom/path/to/dmabuf-heap | ||
| ``` |
There was a problem hiding this comment.
README still documents the positional path form:
./run.sh /custom/path/to/dmabuf-heap
but the current script ignores positional args. Please align README with the actual CLI behavior, or update the script to support positional path input.
|
|
||
| ### Mandatory: | ||
| ``` | ||
| CONFIG_DMA_SHARED_BUFFER=y |
There was a problem hiding this comment.
The mandatory kernel-config section here still says:
CONFIG_DMA_SHARED_BUFFER=y
CONFIG_DMA_HEAP=y
but elsewhere in the PR the terminology/config expectations are centered around CONFIG_DMABUF_HEAPS / heap devices / the selftest binary. Please double-check that the documented mandatory config names match the actual test expectations.
This should still be split into 3 commits. Also address the structural commensts. The PR is 1 commit / 7 files / 3 logical chunks |
Added the tests to check DMA configs, Device Tree Validation and upstream kselftests