Skip to content

Commit 8da2378

Browse files
committed
Enhanced watchdog test
This commit is to enhance the watchdog test and to skip for QCS6490 Added soc_id function in functestlib.sh Signed-off-by: Vamsee Narapareddi <[email protected]>
1 parent 6dac19b commit 8da2378

File tree

2 files changed

+48
-7
lines changed

2 files changed

+48
-7
lines changed

Runner/suites/Kernel/Baseport/watchdog/run.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,35 @@ log_info "----------------------------------------------------------------------
3939
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
4040
log_info "=== Test Initialization ==="
4141

42+
soc_id=$(getsocId)
43+
44+
if [ $? -eq 0 ]; then
45+
log_info "SOC ID is: $soc_id"
46+
else
47+
log_skip "Failed to retrieve SOC ID"
48+
echo "$TESTNAME SKIP" > "$res_file"
49+
exit 0
50+
fi
51+
52+
53+
if [ $soc_id = "498" ]; then
54+
log_skip "Testcase not applicable to this target"
55+
echo "$TESTNAME SKIP" > "$res_file"
56+
exit 0
57+
fi
58+
4259
if [ -e /dev/watchdog ]; then
4360
log_pass "/dev/watchdog node is present."
61+
CONFIGS="CONFIG_WATCHDOG CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED"
62+
for cfg in $CONFIGS; do
63+
if ! check_kernel_config "$cfg" 2>/dev/null; then
64+
log_fail "$cfg is not enabled"
65+
exit 1
66+
fi
67+
done
4468
log_pass "$TESTNAME : Test Passed"
4569
echo "$TESTNAME PASS" > "$res_file"
46-
exit 0
47-
else
48-
log_fail "/dev/watchdog node is not present."
49-
log_fail "$TESTNAME : Test Failed"
50-
echo "$TESTNAME FAIL" > "$res_file"
51-
exit 1
70+
exit 0
5271
fi
53-
log_info "-------------------Completed $TESTNAME Testcase---------------------------"
72+
echo "$TESTNAME FAIL" > "$res_file"
73+
log_info "-------------------Completed $TESTNAME Testcase---------------------------"

Runner/utils/functestlib.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,3 +1475,24 @@ scan_dmesg_errors() {
14751475
log_info "No $label-related errors found in recent dmesg logs."
14761476
fi
14771477
}
1478+
1479+
getsocId() {
1480+
for path in /sys/devices/soc0/soc_id /sys/devices/system/soc/soc0/id; do
1481+
if [ -r "$path" ]; then
1482+
read -r soc_id < "$path"
1483+
case "$soc_id" in
1484+
''|*[!0-9]*)
1485+
log_error "Invalid soc_id" >&2
1486+
return 1
1487+
;;
1488+
*)
1489+
echo "$soc_id"
1490+
return 0
1491+
;;
1492+
esac
1493+
fi
1494+
done
1495+
1496+
log_error "soc_id file not found or not readable" >&2
1497+
return 1
1498+
}

0 commit comments

Comments
 (0)