Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 46 additions & 22 deletions Runner/suites/Kernel/Baseport/IPA/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
# Test for IPA driver: skip if CONFIG_QCOM_IPA not enabled, then
# builtin vs module, verify /dev/ipa, functional sysfs & dmesg checks.

# Robustly find and source init_env
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
Expand Down Expand Up @@ -30,40 +33,61 @@ fi
TESTNAME="IPA"
test_path=$(find_test_case_by_name "$TESTNAME")
cd "$test_path" || exit 1
res_file="./$TESTNAME.res"
RES_FILE="./$TESTNAME.res"

log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
log_info "=== Test Initialization ==="

IPA_MODULE_PATH=$(find_kernel_module "ipa")

if [ -z "$IPA_MODULE_PATH" ]; then
log_error "ipa.ko module not found in filesystem."
echo "$TESTNAME FAIL" > "$res_file"
exit 1
# Kernel config gate
if ! check_kernel_config "CONFIG_QCOM_IPA"; then
log_skip "$TESTNAME SKIP - CONFIG_QCOM_IPA not enabled"
echo "$TESTNAME SKIP" >"$RES_FILE"
exit 0
fi

log_info "Found ipa.ko at: $IPA_MODULE_PATH"
MODNAME="ipa"
PRE_LOADED=0

if ! load_kernel_module "$IPA_MODULE_PATH"; then
echo "$TESTNAME FAIL" > "$res_file"
exit 1
# Ensure module is loaded
if is_module_loaded "$MODNAME"; then
PRE_LOADED=1
log_info "Module $MODNAME already loaded"
else
MODPATH=$(find_kernel_module "$MODNAME")
[ -n "$MODPATH" ] || log_fail "$MODNAME.ko not found in filesystem"
load_kernel_module "$MODPATH" || log_fail "Failed to load $MODNAME"
log_pass "$MODNAME module loaded"
fi

if is_module_loaded "ipa"; then
log_info "ipa module is loaded"
log_pass "$TESTNAME : Test Passed"
echo "$TESTNAME PASS" > "$res_file"
exit 0
# /dev node check (warn only, don't fail/skip)
log_info "Verifying /dev/ipa node"
if wait_for_path "/dev/ipa" 3; then
log_pass "/dev/ipa node is present"
else
log_error "ipa module not listed in lsmod"
log_fail "$TESTNAME : Test Failed"
echo "$TESTNAME FAIL" > "$res_file"
exit 1
log_warn "No /dev/ipa node found (platform/use-case may not expose it)"
fi

log_info "=== Cleanup ==="
unload_kernel_module "ipa" true
# dmesg scan: errors + success pattern
# scan_dmesg_errors(label, out_dir, extra_err, ok_kw)
scan_dmesg_errors "ipa" "." "handshake_complete.*error|stall|abort" "IPA Q6 handshake completed"
rc=$?
case "$rc" in
0) log_warn "IPA-related errors found in dmesg (see ipa_dmesg_errors.log)" ;;
1) log_info "No IPA-related errors in dmesg" ;;
2) log_warn "Success pattern 'IPA Q6 handshake completed' not found in dmesg" ;;
3) log_warn "scan_dmesg_errors misuse (label missing?)" ;;
esac

#Cleanup: unload only if we loaded it
if [ "$PRE_LOADED" -eq 0 ]; then
log_info "Unloading $MODNAME (loaded by this test)"
unload_kernel_module "$MODNAME" false || log_warn "Unload $MODNAME failed"
else
log_info "$MODNAME was pre-loaded; leaving it loaded"
fi

log_info "-------------------Completed $TESTNAME Testcase----------------------------"
log_pass "$TESTNAME PASS"
echo "$TESTNAME PASS" >"$RES_FILE"
exit 0
84 changes: 63 additions & 21 deletions Runner/suites/Kernel/Baseport/RMNET/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
# Test for RMNET driver: skip if CONFIG_RMNET not enabled, then
# builtin vs module, verify /dev/rmnet, functional sysfs & dmesg checks.

# Robustly find and source init_env
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
Expand Down Expand Up @@ -30,40 +33,79 @@ fi
TESTNAME="RMNET"
test_path=$(find_test_case_by_name "$TESTNAME")
cd "$test_path" || exit 1
res_file="./$TESTNAME.res"
RES_FILE="./$TESTNAME.res"

log_info "-----------------------------------------------------------------------------------------"
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
log_info "=== Test Initialization ==="

RMNET_MODULE_PATH=$(find_kernel_module "rmnet")

if [ -z "$RMNET_MODULE_PATH" ]; then
log_error "rmnet.ko module not found in filesystem."
echo "$TESTNAME FAIL" > "$res_file"
exit 1
# Kernel config gate
if ! check_kernel_config "CONFIG_RMNET"; then
log_skip "$TESTNAME SKIP - CONFIG_RMNET not enabled"
echo "$TESTNAME SKIP" >"$RES_FILE"
exit 0
fi

log_info "Found rmnet.ko at: $RMNET_MODULE_PATH"
# Load module if needed
MODNAME="rmnet"
PRE_LOADED=0
if is_module_loaded "$MODNAME"; then
PRE_LOADED=1
log_info "Module $MODNAME already loaded"
else
MODPATH=$(find_kernel_module "$MODNAME")
[ -n "$MODPATH" ] || log_fail "$MODNAME.ko not found in filesystem"
load_kernel_module "$MODPATH" || log_fail "Failed to load $MODNAME"
log_pass "$MODNAME module loaded"
fi

if ! load_kernel_module "$RMNET_MODULE_PATH"; then
echo "$TESTNAME FAIL" > "$res_file"
exit 1
# /dev/rmnet* nodes (authoritative), but do NOT FAIL if absent (common until modem data call)
log_info "Verifying /dev/rmnet* node(s)"
first_node=""
for n in /dev/rmnet*; do
case "$n" in
/dev/rmnet*) [ -e "$n" ] && { first_node="$n"; break; } ;;
esac
done

if [ -n "$first_node" ]; then
if wait_for_path "$first_node" 3; then
log_pass "rmnet node $first_node is present"
else
log_fail "rmnet node $first_node did not appear within timeout"
fi
else
log_warn "No /dev/rmnet* nodes found"
fi

if is_module_loaded "rmnet"; then
log_info "rmnet module is loaded"
log_pass "$TESTNAME : Test Passed"
echo "$TESTNAME PASS" > "$res_file"
exit 0
# dmesg scan for rmnet errors (no positive 'OK' pattern required here)
scan_dmesg_errors "rmnet" "." "panic|oops|fault|stall|abort" ""
if [ -s "./rmnet_dmesg_errors.log" ]; then
log_fail "rmnet-related errors found in dmesg"
else
log_error "rmnet module not listed in lsmod"
log_fail "$TESTNAME : Test Failed"
echo "$TESTNAME FAIL" > "$res_file"
exit 1
log_info "No rmnet-related errors in dmesg"
fi

# Optional informational check: ip link (do not fail if absent)
if command -v ip >/dev/null 2>&1; then
if ip -o link show | grep -qi rmnet; then
log_info "ip(8): rmnet interface(s) present"
else
log_info "ip(8): no rmnet interface yet (probably no data call)"
fi
fi

log_info "=== Cleanup ==="
unload_kernel_module "rmnet" true
# Cleanup if we loaded it
if [ "$PRE_LOADED" -eq 0 ]; then
log_info "Unloading $MODNAME (loaded by this test)"
unload_kernel_module "$MODNAME" false || log_warn "Unload $MODNAME failed"
else
log_info "$MODNAME was pre-loaded; leaving it loaded"
fi

log_info "-------------------Completed $TESTNAME Testcase----------------------------"
log_pass "$TESTNAME PASS"
echo "$TESTNAME PASS" >"$RES_FILE"
exit 0

Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Camera RDI Frame Capture Test

This test validates functional camera RDI (Raw Dump Interface) pipelines by:

- Dynamically detecting all camera pipelines using `media-ctl`
- Parsing valid RDI pipelines with a Python helper script
- Streaming frames using `yavta` from detected working pipelines
- Supporting manual override of video format and frame count

## 📁 Test Directory Structure

```
Camera_RDI_FrameCapture/
├── run.sh
├── parse_media_topology.py
└── init_env
```

## 🧠 How It Works

1. Detects media device node dynamically
2. Dumps the topology to a temporary file
3. Parses pipeline details using `parse_media_topology.py`
4. For each detected pipeline:
- Applies correct media-ctl `-V` and `-l` configuration
- Sets V4L2 controls pre-/post-streaming via `yavta`
- Attempts frame capture using `yavta`
5. Logs PASS/FAIL/SKIP per pipeline
6. Generates a `.res` file with final test result

## ⚙️ Dependencies

Make sure the following tools are available in the target filesystem:

- `media-ctl`
- `yavta`
- `v4l2-ctl`
- `python3`
- Kernel module: `qcom_camss`
- Required DT nodes for `camss`, `isp`, or `camera` compatible strings

## 🧪 Usage

```sh
./run.sh [--format <fourcc>] [--frames <count>]
```

### Examples:

- Auto-detect and capture 10 frames per working RDI pipeline:
```sh
./run.sh
```

- Force UYVY format and capture 5 frames:
```sh
./run.sh --format UYVY --frames 5
```

## 📦 Output

- Captured frame files: `frame-#.bin` in current directory
- Result summary: `Camera_RDI_FrameCapture.res`
- Detailed logs through `functestlib.sh`-based `log_info`, `log_pass`, etc.

## ✅ Pass Criteria

- At least one pipeline successfully captures frames
- Logs include `"Captured <n> frames"` for at least one working video node

## ❌ Fail/Skip Criteria

- If pipeline configuration fails or no frames captured, it is marked FAIL
- If no working pipelines are found or prerequisites are unmet, test is SKIPPED

## 🧼 Cleanup

Temporary files created:
- `/tmp/v4l2_camera_RDI_dump_topo.*`
- `/tmp/v4l2_camera_RDI_dump_pipelines.*`

They are auto-removed at the end of the test.

## 📝 Notes

- The test is dynamic and supports multiple pipelines per board
- Python script only outputs **valid** working pipelines (validated via `v4l2-ctl`)
- `run.sh` is robust, CI-ready, and skips flaky or unsupported configurations gracefully

---

© Qualcomm Technologies, Inc. – All rights reserved
Loading
Loading