-
Notifications
You must be signed in to change notification settings - Fork 54
[test_build] meta-iotqa: add qa tests for audio #288
base: master
Are you sure you want to change the base?
Changes from 8 commits
ee35c6a
ba989de
72909e5
74b8466
f3cb878
1bd2116
ece48a9
53affe5
134497d
7fbd082
8762eae
ba87342
7abe1a8
0a6829a
19012f8
0c00a39
b674d54
88274cf
dddd753
aafa191
65fbca2
a250627
298ea9d
299419f
443ec36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import time | ||
| from oeqa.oetest import oeRuntimeTest | ||
|
|
||
|
|
||
| class PulseaudioTest(oeRuntimeTest): | ||
| def test_rec_play(self): | ||
| # Start pulseaudio daemon | ||
| (status, output) = self.target.run("pulseaudio -D") | ||
| self.assertEqual(status, 0, msg="Error pulseaudio not started: %s" % output) | ||
| # Recording audio | ||
| (status, output) = self.target.run("parecord -r /tmp/rec.wav &") | ||
| time.sleep(3) | ||
| self.assertEqual(status, 0, msg="Error not recorded: %s" % output) | ||
| # Stop pulseaudio daemon | ||
| (status, output) = self.target.run("pulseaudio -k") | ||
| self.assertEqual(status, 0, msg="Error pulseaudio not stop: %s" % output) | ||
| # start pulseaudio daemon | ||
| (status, output) = self.target.run("pulseaudio -D") | ||
| self.assertEqual(status, 0, msg="Error pulseaudio not started: %s" % output) | ||
| # Checking recorded file present | ||
| (status, output) = self.target.run("ls /tmp/ |grep 'rec.wav'") | ||
|
||
| self.assertEqual(status, 0, msg="Error file not found: %s" % output) | ||
| # Playing audio | ||
| (status, output) = self.target.run("paplay /tmp/rec.wav &") | ||
|
||
| self.assertEqual(status, 0, msg="Error not played: %s" % output) | ||
| # Audio running states checking | ||
| (status, output) = self.target.run("cat /proc/asound/card1/pcm3p/sub0/status |grep 'state: RUNNING'") | ||
| self.assertEqual(status, 0, msg="Error not running: %s" % output) | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that parecord doesn't have time parameter to stop the recording, but maybe you could dig out or save the previously started parecord process id and kill thaq (instead of killing pulseaudio server)