Skip to content

Commit

Permalink
check-pause-release-suspend-resume: add a -T option to specify
Browse files Browse the repository at this point in the history
the sleep type for suspend/resuse

There are 2 sleep types designed in /sys/power/mem_sleep
add a -T option to specify which one you want to test.

Signed-off-by: Keqiao Zhang <[email protected]>
  • Loading branch information
keqiaozhang committed Mar 25, 2022
1 parent 33e4d0e commit d127aa0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test-case/check-pause-release-suspend-resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ OPT_HAS_ARG['i']=1 OPT_VAL['i']='500'
OPT_NAME['s']='sof-logger' OPT_DESC['s']="Open sof-logger trace the data will store at $LOG_ROOT"
OPT_HAS_ARG['s']=0 OPT_VAL['s']=1

OPT_NAME['T']='type' OPT_DESC['T']="specify the sleep type for suspend/resume:s2idle/deep"
OPT_HAS_ARG['T']=1 OPT_VAL['T']=""

func_opt_parse_option "$@"

repeat_count=${OPT_VAL['l']}
Expand All @@ -99,6 +102,14 @@ case $test_mode in
;;
esac

# only run suspend/resume once for each loop.
# Use system default value if no sleep type is specified
if [ -n "${OPT_VAL['T']}" ]; then
sleep_opts="-l 1 -T ${OPT_VAL['T']}"
else
sleep_opts="-l 1"
fi

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


Expand Down Expand Up @@ -146,7 +157,7 @@ do
}
# enter suspend-resume cycle once per pause instance
set retval [catch { exec bash $CASEDIR/check-suspend-resume.sh -l 1 } msg]
set retval [catch { exec bash $CASEDIR/check-suspend-resume.sh $sleep_opts } msg]
# prints logs from suspend-resume test
puts \$msg
Expand Down

0 comments on commit d127aa0

Please sign in to comment.