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 Apr 2, 2022
1 parent 33ae82a commit 81c6896
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 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['t']=1 OPT_VAL['t']="$TPLG"
OPT_NAME['P']='filter_string' OPT_DESC['P']='run this case on specified pipelines'
OPT_HAS_ARG['P']=1 OPT_VAL['P']='id:any'

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,11 @@ case $test_mode in
;;
esac

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

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


Expand Down Expand Up @@ -143,7 +151,7 @@ do
exit 1
}
# 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
puts "Finished suspend-resume test"
Expand Down

0 comments on commit 81c6896

Please sign in to comment.