Skip to content

Commit

Permalink
check-pause-resume.sh: switch to new apause.exp script
Browse files Browse the repository at this point in the history
See long commit message in previous commit adding apause.exp

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Jul 15, 2024
1 parent a5e2ae6 commit c809fff
Showing 1 changed file with 10 additions and 31 deletions.
41 changes: 10 additions & 31 deletions test-case/check-pause-resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,40 +93,19 @@ do
dev=$(func_pipeline_parse_value "$idx" dev)
snd=$(func_pipeline_parse_value "$idx" snd)

# expect is tcl language script
# expr rand(): produces random numbers between 0 and 1
# after ms: Ms must be an integer giving a time in milliseconds.
# The command sleeps for ms milliseconds and then returns.
dlogi "Entering expect script with:
$cmd $SOF_ALSA_OPTS $cmd_opts -D $dev -r $rate -c $channel -f $fmt -vv -i $file_name -q"

expect <<END
spawn $cmd $SOF_ALSA_OPTS $cmd_opts -D $dev -r $rate -c $channel -f $fmt -vv -i $file_name -q
set i 1
expect {
"*#*+*\%" {
set sleep_t [expr int([expr rand() * $rnd_range]) + $rnd_min ]
puts "\r(\$i/$repeat_count) Wait for \$sleep_t ms before pause"
send " "
after \$sleep_t
exp_continue
}
"*PAUSE*" {
set sleep_t [expr int([expr rand() * $rnd_range]) + $rnd_min ]
puts "\r(\$i/$repeat_count) Wait for \$sleep_t ms before resume"
send " "
after \$sleep_t
incr i
if { \$i > $repeat_count } { exit 0 }
exp_continue
}
}
exit 1
END
ret=$?
ret=0
(set -x
# The 4 expect arguments first, then $cmd + $cmd arguments
# shellcheck disable=SC2086
"$TOPDIR"/case-lib/apause.exp "$cmd" "$repeat_count" "$rnd_min" "$rnd_range" \
"$cmd" $SOF_ALSA_OPTS $cmd_opts -D "$dev" -r "$rate" -c "$channel" -f "$fmt" \
-vv -i "$file_name"
) || ret=$?

#flush the output
echo
if [ $ret -ne 0 ]; then
echo "apause.exp returned: $ret"
func_lib_lsof_error_dump "$snd"
sof-process-kill.sh ||
dlogw "Kill process catch error"
Expand Down

0 comments on commit c809fff

Please sign in to comment.