Skip to content

Commit ce845a5

Browse files
fredoh9marc-hb
authored andcommitted
check-signal-stop-start.sh: report failure when process terminated early
When aplay or arecord process is terminated during the test, while loop condition catches the error first then just return the function. In this case it ends up with a false pass. Removed the process check from while loop. sof-process-state.sh will do it anyway. issue link: #988 Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
1 parent 368408f commit ce845a5

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

test-case/check-signal-stop-start.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
## no errors for aplay/arecord
1717
##
1818

19+
set -e
20+
1921
# shellcheck source=case-lib/lib.sh
2022
source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh
2123

@@ -62,15 +64,14 @@ setup_kernel_check_point
6264
func_stop_start_pipeline()
6365
{
6466
local i=1
65-
while ( [ $i -le $count ] && [ "$(ps -p $pid --no-header)" ] )
67+
while [ $i -le $count ]
6668
do
6769
# check aplay/arecord process state
68-
sof-process-state.sh $cmd >/dev/null
69-
if [ $? -ne 0 ]; then
70-
"$cmd process is in an abnormal status"
71-
kill -9 "$pid" && wait "$pid" 2>/dev/null
70+
sof-process-state.sh "$pid" >/dev/null || {
71+
dloge "$cmd($pid) process is in an abnormal status"
72+
kill -9 "$pid"
7273
exit 1
73-
fi
74+
}
7475
dlogi "Stop/start count: $i"
7576
# stop the pipeline
7677
kill -SIGSTOP "$pid"
@@ -112,9 +113,10 @@ do
112113

113114
# do stop/start test
114115
func_stop_start_pipeline
116+
115117
# kill aplay/arecord process
116118
dlogc "kill process: kill -9 $pid"
117-
kill -9 "$pid" && wait "$pid" 2>/dev/null
119+
kill -9 "$pid"
118120
done
119121

120122
sof-kernel-log-check.sh "$KERNEL_CHECKPOINT"

0 commit comments

Comments
 (0)