Skip to content

Commit 8a6f5f4

Browse files
committed
shellcheck fixes
Signed-off-by: Emilia Kurdybelska <emiliax.kurdybelska@intel.com>
1 parent 688118d commit 8a6f5f4

14 files changed

+31
-25
lines changed

test-case/check-fw-echo-reference.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ do
6565
fi
6666
done
6767

68-
for i in $(seq 1 $loop_cnt)
68+
for i in $(seq 1 "$loop_cnt")
6969
do
7070
for fmt in $fmts
7171
do

test-case/check-ipc-flood.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ sof-kernel-dump.sh | grep sof-audio | grep -q "Firmware debug" ||
4646
func_lib_check_sudo
4747

4848
dlogi "Check $ipc_flood_dfs"
49-
sudo test -e $ipc_flood_dfs ||
49+
sudo test -e "$ipc_flood_dfs" ||
5050
skip_test "${BASH_SOURCE[0]} need $ipc_flood_dfs to run the test case"
5151

5252
dlogi "Running ipc flood test!"
5353

54-
for i in $(seq 1 $loop_cnt)
54+
for i in $(seq 1 "$loop_cnt")
5555
do
5656
# TODO: use journalctl to replace dmesg
5757
# cleanup dmesg buffer for each iteration

test-case/check-keyword-detection.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ _restore_default_wov_config_bolb()
106106
# update the blob
107107
_update_blob(){
108108
new_blob=$test_dir"/new_blob"
109-
[ $preamble_time -ge $history_depth ] || {
109+
[ "$preamble_time" -ge "$history_depth" ] || {
110110
die "Warning: invalid arguments, preamble_time must be greater than or equal to history_depth"
111111
}
112112
awk -F, -v OFS=, '{if ( $4 == '"$def_pt"' && $7 == '"$def_hd"' ) $4='"$preamble_time"'; $7='"$history_depth"'}1' \

test-case/check-kmod-load-unload.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ loop_cnt=${OPT_VAL['l']}
4444
PATH="${PATH%%:*}/kmod:$PATH"
4545
func_lib_check_sudo 'unloading modules'
4646

47-
if [ ${OPT_VAL['p']} -eq 1 ];then
47+
if [ "${OPT_VAL['p']}" -eq 1 ];then
4848
func_lib_disable_pulseaudio
4949
fi
5050

51-
for idx in $(seq 1 $loop_cnt)
51+
for idx in $(seq 1 "$loop_cnt")
5252
do
5353
dlogi "===== Starting iteration $idx of $loop_cnt ====="
5454
## - 1: remove module section

test-case/check-pause-release-suspend-resume.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ esac
115115

116116
logger_disabled || func_lib_start_log_collect
117117

118+
setup_kernel_check_point
119+
118120
dlogi "Entering audio stream expect script with: $cmd -D $pcm -r $rate -c $channel -f $fmt -vv -i $dummy_file -q"
119121
dlogi "Will enter suspend-resume cycle during paused period of audio stream process"
120122

test-case/check-runtime-pm-status.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func_check_dsp_status()
5050
}
5151

5252
func_opt_parse_option "$@"
53+
setup_kernel_check_point
5354

5455
tplg=${OPT_VAL['t']}
5556
loop_count=${OPT_VAL['l']}

test-case/check-signal-stop-start.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ esac
6363
func_stop_start_pipeline()
6464
{
6565
local i=1
66-
while [ $i -le $count ]
66+
while [ $i -le "$count" ]
6767
do
6868
# check aplay/arecord process state
6969
sof-process-state.sh "$pid" >/dev/null || {
@@ -74,10 +74,10 @@ func_stop_start_pipeline()
7474
dlogi "Stop/start count: $i"
7575
# stop the pipeline
7676
kill -SIGSTOP "$pid"
77-
sleep $interval
77+
sleep "$interval"
7878
# start the pipeline
7979
kill -SIGCONT "$pid"
80-
sleep $interval
80+
sleep "$interval"
8181
(( i++ ))
8282
done
8383
}

test-case/check-smart-amplifier.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ do
8080
done
8181

8282
fmts="$cp_fmt"
83-
if [ ${OPT_VAL['F']} = '1' ]; then
83+
if [ "${OPT_VAL['F']}" = '1' ]; then
8484
fmts="$cp_fmts"
8585
fi
8686

87-
for i in $(seq 1 $loop_cnt)
87+
for i in $(seq 1 "$loop_cnt")
8888
do
8989
for fmt in $fmts
9090
do

test-case/check-suspend-resume-with-audio.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ opt_arr=(-l "${OPT_VAL['l']}")
8585
if [ "${OPT_VAL['T']}" ]; then
8686
opt_arr+=(-T "${OPT_VAL['T']}")
8787
fi
88-
if [ ${OPT_VAL['r']} -eq 0 ]; then
88+
if [ "${OPT_VAL['r']}" -eq 0 ]; then
8989
opt_arr+=(-S "${OPT_VAL['S']}" -w "${OPT_VAL['w']}")
9090
else
9191
opt_arr+=(-r)
@@ -102,6 +102,7 @@ do
102102
fmt=$(func_pipeline_parse_value "$idx" fmt)
103103
dev=$(func_pipeline_parse_value "$idx" dev)
104104
snd=$(func_pipeline_parse_value "$idx" snd)
105+
# shellcheck disable=SC2153
105106
dlogi "Run $TYPE command for the background"
106107
cmd_args="$cmd -D$dev -r $rate -c $channel -f $fmt $file_name -q"
107108
dlogc "$cmd_args"

test-case/check-userspace-paplay.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ channel=${OPT_VAL['C']}
5959
# go through all the sinks
6060
# get all the sinks name
6161
sinkkeys=$(pactlinfo.py --showsinks)
62-
for round in $(seq 1 $round_cnt); do
62+
for round in $(seq 1 "$round_cnt"); do
6363
for i in $sinkkeys; do
6464
sinkcard=$(pactlinfo.py --getsinkcardname "$i") || {
6565
dlogw "failed to get sink $i card_name"
@@ -93,10 +93,11 @@ for round in $(seq 1 $round_cnt); do
9393
sinkname=$(eval echo "$sinkname")
9494
dlogi "===== Testing: (Round: $round/$round_cnt) (sink: $sinkname.$actport) ====="
9595
dlogc "paplay -v --device=$sinkname --raw --rate=$rate --format=$format --channels=$channel $file"
96-
paplay -v --device="$sinkname" --raw --rate=$rate --format=$format --channels=$channel $file &
96+
paplay -v --device="$sinkname" --raw --rate="$rate" --format="$format" --channels="$channel" "$file" &
9797
pid=$!
98-
sleep $duration
98+
sleep "$duration"
9999
# check whether process is still running
100+
# shellcheck disable=SC2009
100101
count=$(ps -A| grep -c $pid) || true
101102
if [[ $count -eq 0 ]]; then
102103
if wait $pid; then #checks if process executed successfully or not

0 commit comments

Comments
 (0)