Skip to content

Commit 3c78764

Browse files
committed
Added minor timer script fix
Added minor fix to timer testcase to pdate the binary execution path and to print the complete output for easy debug Signed-off-by: Vamsee Narapareddi <[email protected]>
1 parent f52cb54 commit 3c78764

File tree

1 file changed

+28
-4
lines changed
  • Runner/suites/Kernel/Baseport/Timer

1 file changed

+28
-4
lines changed

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

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ fi
2929
# shellcheck disable=SC1090,SC1091
3030
. "$TOOLS/functestlib.sh"
3131

32+
# --- Parse CLI argument for custom binary path ---
33+
BINARY_PATH=""
34+
while [ $# -gt 0 ]; do
35+
case "$1" in
36+
--binary-path=*)
37+
BINARY_PATH="${1#*=}"
38+
;;
39+
*)
40+
;;
41+
esac
42+
shift
43+
done
44+
3245
TESTNAME="Timer"
3346
test_path=$(find_test_case_by_name "$TESTNAME")
3447
cd "$test_path" || exit 1
@@ -39,13 +52,24 @@ log_info "----------------------------------------------------------------------
3952
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
4053
log_info "=== Test Initialization ==="
4154

42-
chmod -R 777 /APT/timers
55+
# --- Determine binary to use ---
56+
if [ -n "$BINARY_PATH" ]; then
57+
BINARY="$BINARY_PATH"
58+
else
59+
BINARY="posix_timers"
60+
fi
4361

44-
# Path to the binary
45-
BINARY_PATH="/var/common/bins/timers/posix_timers"
62+
# --- Check if binary exists in PATH or at custom path ---
63+
check_dependencies "$BINARY"
64+
if [ $? -ne 0 ]; then
65+
log_skip "$TESTNAME : Binary '$BINARY' not found"
66+
echo "$TESTNAME SKIP" > "$res_file"
67+
exit 1
68+
fi
4669

4770
# Run the binary and capture the output
48-
OUTPUT=$($BINARY_PATH)
71+
OUTPUT=$($BINARY)
72+
echo $OUTPUT
4973

5074
# Check if "pass:7" is in the output
5175
if echo "${OUTPUT}" | grep "pass:7"; then

0 commit comments

Comments
 (0)