File tree Expand file tree Collapse file tree 1 file changed +48
-4
lines changed
Runner/suites/Kernel/Baseport/Timer Expand file tree Collapse file tree 1 file changed +48
-4
lines changed Original file line number Diff line number Diff line change 2929# shellcheck disable=SC1090,SC1091
3030. " $TOOLS /functestlib.sh"
3131
32+ # --- Parse CLI argument for custom binary path ---
33+ show_help () {
34+ cat << EOF
35+ Usage: $0 [OPTIONS]
36+
37+ Options:
38+ --binary-path=PATH Specify a custom path to the posix_timers binary else run by default from /usr/bin.
39+ -h, --help Show this help message and exit.
40+
41+ Example:
42+ $0 --binary-path=/custom/path/posix_timers
43+ $0
44+
45+ EOF
46+ }
47+
48+
49+ BINARY_PATH=" "
50+ while [ $# -gt 0 ]; do
51+ case " $1 " in
52+ --binary-path=* )
53+ BINARY_PATH=" ${1#* =} "
54+ ;;
55+ -h|--help)
56+ show_help
57+ exit 0
58+ ;;
59+ * )
60+ ;;
61+ esac
62+ shift
63+ done
64+
3265TESTNAME=" Timer"
3366test_path=$( find_test_case_by_name " $TESTNAME " )
3467cd " $test_path " || exit 1
@@ -39,13 +72,24 @@ log_info "----------------------------------------------------------------------
3972log_info " -------------------Starting $TESTNAME Testcase----------------------------"
4073log_info " === Test Initialization ==="
4174
42- chmod -R 777 /APT/timers
75+ # --- Determine binary to use ---
76+ if [ -n " $BINARY_PATH " ]; then
77+ BINARY=" $BINARY_PATH "
78+ else
79+ BINARY=" posix_timers"
80+ fi
4381
44- # Path to the binary
45- BINARY_PATH=" /var/common/bins/timers/posix_timers"
82+ # --- Check if binary exists in PATH or at custom path ---
83+ check_dependencies " $BINARY "
84+ if [ $? -ne 0 ]; then
85+ log_skip " $TESTNAME : Binary '$BINARY ' not found"
86+ echo " $TESTNAME SKIP" > " $res_file "
87+ exit 0
88+ fi
4689
4790# Run the binary and capture the output
48- OUTPUT=$( $BINARY_PATH )
91+ OUTPUT=$( $BINARY )
92+ echo $OUTPUT
4993
5094# Check if "pass:7" is in the output
5195if echo " ${OUTPUT} " | grep " pass:7" ; then
You can’t perform that action at this time.
0 commit comments