Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tools/test/qa/tests/stability_test/sim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
aplay -Dhw:0,1 -f dat -c 2 /dev/zero &

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each test will need comments at the top describing what it does and any arguments it takes. Also SPDX style comment stating BSD licence. The file name here is not very meaningful either, this test does a duplex stream on 0,1 and a playback on 0,0 e.g. "test-duplex-plus-playback.sh" is probably a better name.

# Get its PID
PID_1=$!

arecord -Dhw:0,1 -f dat -c 2 /dev/null &

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The duplex PCM should be passed as an arg and so should playback PCM.

# 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep time should be an arg (it can be fractional)

# 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
12 changes: 12 additions & 0 deletions tools/test/qa/tests/stability_test/stress_sim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
i=0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs comments, licence etc. Better name is "test-iterate.sh"

MAXLOOPS=1000

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argument

while [ $i -lt $MAXLOOPS ]; do
echo "iterate $i ..."
./sim.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test we run should be argument.

if [ $? -eq 0 ]; then
let i+=1
else
exit 1
fi
sleep 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep should also be argument.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and by default I would make it 0.1 seconds.

done