From c2388ea158dc3bd39658244269029fb04a057ddc Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Tue, 18 Dec 2018 15:42:52 +0800 Subject: [PATCH] qa: add simultaneous playback/capture stress test scripts This will be helpful for simultaneous high stress test to find concurrent and high workload stability issues. Signed-off-by: Keyon Jie --- tools/test/qa/tests/stability_test/sim.sh | 30 +++++++++++++++++++ .../qa/tests/stability_test/stress_sim.sh | 12 ++++++++ 2 files changed, 42 insertions(+) create mode 100755 tools/test/qa/tests/stability_test/sim.sh create mode 100755 tools/test/qa/tests/stability_test/stress_sim.sh diff --git a/tools/test/qa/tests/stability_test/sim.sh b/tools/test/qa/tests/stability_test/sim.sh new file mode 100755 index 000000000000..284af36e569b --- /dev/null +++ b/tools/test/qa/tests/stability_test/sim.sh @@ -0,0 +1,30 @@ +aplay -Dhw:0,1 -f dat -c 2 /dev/zero & +# Get its PID +PID_1=$! + +arecord -Dhw:0,1 -f dat -c 2 /dev/null & +# Get its PID +PID_2=$! + +aplay -Dhw:0,0 -f dat -c 2 /dev/zero & +# Get its PID +PID_3=$! + +# Wait for 5 seconds +sleep 5 +# Kill them +kill $PID_1 +RET_1=$? +kill $PID_2 +RET_2=$? +kill $PID_3 +RET_3=$? + +if [ $RET_1 -ne 0 ] || [ $RET_2 -ne 0 ] || [ $RET_3 -ne 0 ] +#if [ $RET_1 -ne 0 ] || [ $RET_2 -ne 0 ] +then + echo "stopping failed!" + exit -1 +else + exit 0 +fi diff --git a/tools/test/qa/tests/stability_test/stress_sim.sh b/tools/test/qa/tests/stability_test/stress_sim.sh new file mode 100755 index 000000000000..46da9b6fcb7e --- /dev/null +++ b/tools/test/qa/tests/stability_test/stress_sim.sh @@ -0,0 +1,12 @@ +i=0 +MAXLOOPS=1000 +while [ $i -lt $MAXLOOPS ]; do + echo "iterate $i ..." + ./sim.sh + if [ $? -eq 0 ]; then + let i+=1 + else + exit 1 + fi + sleep 1 +done