Skip to content

Commit 4d79fbb

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

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ 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: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
## no error in dmesg
1818
##
1919

20-
source $(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh
20+
source "$(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh"
2121

2222
OPT_NAME['t']='tplg' OPT_DESC['t']='tplg file, default value is env TPLG: $TPLG'
2323
OPT_HAS_ARG['t']=1 OPT_VAL['t']="$TPLG"
@@ -28,7 +28,9 @@ OPT_HAS_ARG['l']=1 OPT_VAL['l']=3
2828
OPT_NAME['d']='delay' OPT_DESC['d']='max delay time for state convert'
2929
OPT_HAS_ARG['d']=1 OPT_VAL['d']=15
3030

31+
# shellcheck disable=SC2034
3132
OPT_NAME['s']='sof-logger' OPT_DESC['s']="Open sof-logger trace the data will store at $LOG_ROOT"
33+
# shellcheck disable=SC2034
3234
OPT_HAS_ARG['s']=0 OPT_VAL['s']=1
3335

3436
# param: $1 -> max delay time for dsp pm status switch
@@ -70,15 +72,16 @@ DEV_LST['capture']='/dev/null'
7072
logger_disabled || func_lib_start_log_collect
7173
func_pipeline_export "$tplg" "type:any"
7274

73-
for idx in $(seq 0 $(expr $PIPELINE_COUNT - 1))
75+
# shellcheck disable=SC2046
76+
for idx in $(seq 0 $(expr "$PIPELINE_COUNT" - 1))
7477
do
75-
channel=$(func_pipeline_parse_value $idx channel)
76-
rate=$(func_pipeline_parse_value $idx rate)
77-
fmt=$(func_pipeline_parse_value $idx fmt)
78-
dev=$(func_pipeline_parse_value $idx dev)
79-
pcm=$(func_pipeline_parse_value $idx pcm)
80-
type=$(func_pipeline_parse_value $idx type)
81-
snd=$(func_pipeline_parse_value $idx snd)
78+
channel=$(func_pipeline_parse_value "$idx" channel)
79+
rate=$(func_pipeline_parse_value "$idx" rate)
80+
fmt=$(func_pipeline_parse_value "$idx" fmt)
81+
dev=$(func_pipeline_parse_value "$idx" dev)
82+
pcm=$(func_pipeline_parse_value "$idx" pcm)
83+
type=$(func_pipeline_parse_value "$idx" type)
84+
snd=$(func_pipeline_parse_value "$idx" snd)
8285

8386
cmd="${APP_LST[$type]}"
8487
dummy_file="${DEV_LST[$type]}"

0 commit comments

Comments
 (0)