File tree Expand file tree Collapse file tree 10 files changed +42
-26
lines changed
Kernel/FunctionalArea/baseport Expand file tree Collapse file tree 10 files changed +42
-26
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " --------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12+ log_info " Checking if dependency binary is available"
13+ check_dependencies bw_mem
14+
1215log_info " Fetching te interconnect summary"
1316extract_votes () {
1417 cat /sys/kernel/debug/interconnect/interconnect_summary | grep -i pmu | awk ' {print $NF}'
@@ -21,7 +24,7 @@ log_info "$initial_votes"
2124log_info " $initial_votes "
2225
2326log_info " Running bw_mem tool..."
24- /var/common/bins/ bw_mem 4000000000 frd &
27+ bw_mem 4000000000 frd &
2528
2629sleep 2
2730
Original file line number Diff line number Diff line change @@ -9,8 +9,11 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " -----------------------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12+ log_info " Checking if dependency binary is available"
13+ check_dependencies i2c-msm-test
14+
1215log_info " running i2c binary"
13- output=$( /var/common/bins/buses/ i2c-msm-test -v -D /dev/i2c-0 -l | grep " ret:1" )
16+ output=$( i2c-msm-test -v -D /dev/i2c-0 -l | grep " ret:1" )
1417
1518
1619if echo " $output " | grep -q " Reading" ; then
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ test_bin_path=$(find_test_case_bin_by_name "lat_mem_rd")
99log_info " -----------------------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12+ log_info " Checking if dependency binary is available"
13+ check_dependencies lat_mem_rd
1214
1315extract_votes () {
1416 cat /sys/kernel/debug/interconnect/interconnect_summary | grep -i cpu | awk ' {print $NF}'
Original file line number Diff line number Diff line change @@ -9,11 +9,10 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " -----------------------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12- cp -r /kcapi/kcapi-convience /usr/bin/
12+ log_info " Checking if dependency binary is available"
13+ check_dependencies kcapi-convience
1314
14- chmod 777 /usr/bin/kcapi-convience
15-
16- /usr/bin/kcapi-convience
15+ kcapi-convience
1716
1817echo $?
1918
Original file line number Diff line number Diff line change @@ -9,16 +9,16 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " -----------------------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12- chmod -R 777 /rngtest
13-
14- cd /rngtest
12+ log_info " Checking if dependency binary is available"
13+ check_dependencies rngtest
1514
1615cat /dev/random | rngtest -c 1000 > /tmp/rngtest_output.txt
1716
1817grep ' count of bits' /tmp/rngtest_output.txt | awk ' {print $NF}' > /tmp/rngtest_value.txt
1918
2019value=$( cat /tmp/rngtest_value.txt)
2120
21+
2222if [ " $value " -lt 10 ]; then
2323 log_pass " $TESTNAME : Test Passed"
2424 echo " $TESTNAME : Test Passed" > $test_path /$TESTNAME .res
Original file line number Diff line number Diff line change @@ -9,13 +9,10 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " --------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12- # Make the test executable
13- chmod -R 777 /DSP_audioPD
12+ log_info " Checking if dependency binary is available "
13+ check_dependencies adsprpcd
1414
15- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH :/DSP_audioPD/libs/
16-
17- cd /DSP_audioPD/bins/
18- ./adsprpcd &
15+ adsprpcd &
1916PID = $!
2017
2118if [ -z " $PID " ]; then
Original file line number Diff line number Diff line change @@ -9,11 +9,8 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " -----------------------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12- cd /Graphics
13-
14- cp -r a660_sqe.fw /lib/firmware/
15- cp -r a660_zap.mbn /lib/firmware/qcom/qcs6490/
16- cp -r a660_gmu.bin /lib/firmware/
12+ log_info " Checking if dependency binary is available"
13+ check_dependencies a660_sqe.fw a660_zap.mbn a660_gmu.bin
1714
1815# Clear dmesg logs
1916dmesg -c
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " -----------------------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12- # Make the test executable
13- chmod -R 777 /Video
12+ log_info " Checking if dependency binary is available "
13+ check_dependencies iris_v4l2_test
1414
1515# Run the first test
16- /Video/ iris_v4l2_test --config /Video/DEC_AVC_NV12_BASIC_CFG.json --loglevel 15 >> video_dec.txt
16+ iris_v4l2_test --config /Video/DEC_AVC_NV12_BASIC_CFG.json --loglevel 15 >> video_dec.txt
1717
1818if grep -q " Test Passed" " video_dec.txt" ; then
1919 log_pass " $TESTNAME : Test Passed"
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ test_path=$(find_test_case_by_name "$TESTNAME")
99log_info " -----------------------------------------------------------------------------------------"
1010log_info " -------------------Starting $TESTNAME Testcase----------------------------"
1111
12- # Make the test executable
13- chmod -R 777 /Video
12+ log_info " Checking if dependency binary is available "
13+ check_dependencies iris_v4l2_test
1414
1515# Run the first test
16- /Video/ iris_v4l2_test --config /Video/ENC_AVC_NV12_BASIC_CFG.json --loglevel 15 >> video_enc.txt
16+ iris_v4l2_test --config /Video/ENC_AVC_NV12_BASIC_CFG.json --loglevel 15 >> video_enc.txt
1717
1818if grep -q " Test Passed" " video_enc.txt" ; then
1919 log_pass " $TESTNAME : Test Passed"
Original file line number Diff line number Diff line change @@ -32,6 +32,21 @@ find_test_case_script_by_name() {
3232 find $__RUNNER_UTILS_BIN_DIR -type d -iname " $test_name " 2> /dev/null
3333}
3434
35+ check_dependencies () {
36+ local missing=0
37+ for cmd in " $@ " ; do
38+ if ! command -v " $cmd " & > /dev/null; then
39+ log_error " ERROR: Required command '$cmd ' not found in PATH."
40+ missing=1
41+ fi
42+ done
43+ if [ " $missing " -ne 0 ]; then
44+ log_error " Exiting due to missing dependencies."
45+ exit 1
46+ else
47+ log_pass " Test related dependencies are present."
48+ fi
49+ }
3550
3651# Logging levels
3752log_info () { log " INFO" " $@ " ; }
You can’t perform that action at this time.
0 commit comments