Skip to content

Commit 63c26e8

Browse files
committed
tests: Mark as SKIP if dependencies are missing
- Updated check_dependencies to SKIP tests with missing tools - CI/LAVA now reports SKIP (not FAIL) when commands are absent Signed-off-by: Srikanth Muppandam <[email protected]>
1 parent cb65b42 commit 63c26e8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Runner/utils/functestlib.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,21 @@ unload_kernel_module() {
132132
# --- Dependency check ---
133133
check_dependencies() {
134134
missing=0
135+
missing_cmds=""
135136
for cmd in "$@"; do
136137
if ! command -v "$cmd" >/dev/null 2>&1; then
137-
log_error "Required command '$cmd' not found in PATH."
138+
log_warn "Required command '$cmd' not found in PATH."
138139
missing=1
140+
missing_cmds="$missing_cmds $cmd"
139141
fi
140142
done
141-
[ "$missing" -ne 0 ] && exit 1
143+
if [ "$missing" -ne 0 ]; then
144+
# Use existing TESTNAME variable if present, fallback if not
145+
testname="${TESTNAME:-UnknownTest}"
146+
log_skip "$testname SKIP: missing dependencies:$missing_cmds"
147+
echo "$testname SKIP" > "./$testname.res"
148+
exit 0
149+
fi
142150
}
143151

144152
# --- Test case directory lookup ---

0 commit comments

Comments
 (0)