Skip to content

Commit

Permalink
check-pause-resume: handle volume MAX output in expect
Browse files Browse the repository at this point in the history
When volume is MAX, expect need to match the case differently.
MAX case is same as playing case.

This is example of output from aplay or arecord.
1. Playing
2. Pause
=== PAUSE ===
3. Exception case with MAX+

Signed-off-by: Fred Oh <[email protected]>
  • Loading branch information
fredoh9 committed Jul 13, 2022
1 parent e0af412 commit e2e2620
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test-case/check-pause-resume.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -e
#set -e

##
## Case Name: check-pause-resume
Expand Down Expand Up @@ -116,18 +116,27 @@ expect {
if { \$i > $repeat_count } { exit 0 }
exp_continue
}
"*#*+*MAX" {
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
}
}
exit 1
END
ret=$?
#flush the output
echo
if [ $ret -ne 0 ]; then
echo "Expect block return $ret"
func_lib_lsof_error_dump "$snd"
sof-process-kill.sh ||
dlogw "Kill process catch error"
exit $ret
fi
# check kernel log for each iteration to catch issues
sof-kernel-log-check.sh "$KERNEL_CHECKPOINT" || die "Caught error in kernel log"
ps aux | grep arecord
done

0 comments on commit e2e2620

Please sign in to comment.