Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,24 @@ disable_kernel_check_point()
{
KERNEL_CHECKPOINT="disabled"
}

is_zephyr()
{
# check if jq is installed, will remove this part
# after all DUTs have jq installed.
type -p jq || sudo apt install jq -y

local manifest=/etc/sof/manifest.txt
test -e "$manifest" || return 1
jq '.version.firmwareType' "$manifest" | grep "zephyr"
}

logger_disabled()
{
# disable logger when firmware type is zephyr or -s is set to 0
if is_zephyr || [[ ${OPT_VAL['s']} -ne 1 ]]; then
return 0
else
return 1
fi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit/personal preference:

if is_zephyr || [[ ${OPT_VAL['s']} -ne 1 ]]; then
   return 0
fi

return 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concise and reasonable. Updated

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this can probably be just:

logger_disabled()
{
   is_zephyr || [[ ${OPT_VAL['s']} -ne 1 ]
}

}
2 changes: 1 addition & 1 deletion test-case/check-alsabat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ then
exit 2
fi

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

function __upload_wav_file
{
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-capture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ loop_cnt=${OPT_VAL['l']}
out_dir=${OPT_VAL['o']}
file_prefix=${OPT_VAL['f']}

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

setup_kernel_check_point
func_lib_check_sudo
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-fw-echo-reference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ loop_cnt=${OPT_VAL['l']}
frames=${OPT_VAL['n']}
frequency=${OPT_VAL['f']}

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

func_pipeline_export "$tplg" "echo:any"
setup_kernel_check_point
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-keyword-detection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ history_depth=${OPT_VAL['s']}
preamble_time=${OPT_VAL['p']}
duration=${OPT_VAL['d']}

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

func_pipeline_export "$tplg" "kpbm:any"

Expand Down
2 changes: 1 addition & 1 deletion test-case/check-pause-release-suspend-resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ esac
[[ -z $file_name ]] && file_name=$dummy_file


[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

setup_kernel_check_point

Expand Down
2 changes: 1 addition & 1 deletion test-case/check-pause-resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ case $test_mode in
;;
esac

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

[[ -z $file_name ]] && file_name=$dummy_file

Expand Down
2 changes: 1 addition & 1 deletion test-case/check-playback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ loop_cnt=${OPT_VAL['l']}
file=${OPT_VAL['f']}


[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

# checking if source file exists
if [[ -z $file ]]; then
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-runtime-pm-double-active.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ DEV_LST['playback']='/dev/zero'
APP_LST['capture']='arecord'
DEV_LST['capture']='/dev/null'

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect
func_pipeline_export "$tplg" "type:any"

for idx in $(seq 0 $(expr $PIPELINE_COUNT - 1))
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-runtime-pm-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ DEV_LST['playback']='/dev/zero'
APP_LST['capture']='arecord'
DEV_LST['capture']='/dev/null'

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect
func_pipeline_export "$tplg" "type:any"

for idx in $(seq 0 $(expr $PIPELINE_COUNT - 1))
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-signal-stop-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ count=${OPT_VAL['c']}
interval=${OPT_VAL['i']}
test_mode=${OPT_VAL['m']}

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

case $test_mode in
"playback")
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-smart-amplifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ duration=${OPT_VAL['d']}
loop_cnt=${OPT_VAL['l']}
tplg=${OPT_VAL['t']}

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

func_pipeline_export "$tplg" "smart_amp:any"
setup_kernel_check_point
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-suspend-resume-with-audio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ setup_kernel_check_point
func_lib_check_sudo

tplg=${OPT_VAL['t']}
[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

# overwrite the subscript: test-case LOG_ROOT environment
# so when load the test-case in current script
Expand Down
2 changes: 1 addition & 1 deletion test-case/check-xrun-injection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test_mode=${OPT_VAL['m']}
count=${OPT_VAL['c']}
interval=${OPT_VAL['i']}

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

setup_kernel_check_point
func_lib_check_sudo
Expand Down
2 changes: 1 addition & 1 deletion test-case/multiple-pause-resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ rnd_range=$[ $rnd_max - $rnd_min ]
tplg=${OPT_VAL['t']}
func_pipeline_export "$tplg" "type:any"

[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

declare -a pipeline_idx_lst
declare -a cmd_idx_lst
Expand Down
2 changes: 1 addition & 1 deletion test-case/multiple-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func_opt_parse_option "$@"
loop_cnt=${OPT_VAL['l']}
tplg=${OPT_VAL['t']}
f_arg=${OPT_VAL['f']}
[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

max_count=0
# this line will help to get $PIPELINE_COUNT
Expand Down
2 changes: 1 addition & 1 deletion test-case/simultaneous-playback-capture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ unset tmp_id_lst tplg_path
id_lst_str=${id_lst_str/,/} # remove 1st, which is not used
[[ ${#id_lst_str} -eq 0 ]] && dlogw "no pipeline with both playback and capture capabilities found in $tplg" && exit 2
func_pipeline_export "$tplg" "id:$id_lst_str"
[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

func_error_exit()
{
Expand Down
2 changes: 1 addition & 1 deletion test-case/test-speaker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ OPT_HAS_ARG['s']=0 OPT_VAL['s']=1

func_opt_parse_option "$@"
tplg=${OPT_VAL['t']}
[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

func_pipeline_export "$tplg" "type:playback"
tcnt=${OPT_VAL['l']}
Expand Down
2 changes: 1 addition & 1 deletion test-case/volume-basic-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func_error_exit()

[[ -z $tplg ]] && die "Missing tplg file needed to run"
func_pipeline_export "$tplg" "type:playback"
[[ ${OPT_VAL['s']} -eq 1 ]] && func_lib_start_log_collect
logger_disabled || func_lib_start_log_collect

[[ $PIPELINE_COUNT -eq 0 ]] && die "Missing playback pipeline for aplay to run"
channel=$(func_pipeline_parse_value 0 channel)
Expand Down