Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

[test_build] meta-iotqa: add qa tests for audio #288

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ee35c6a
Audio recording and playing test
nvelux Aug 11, 2017
ba989de
audio testing for record and playing
nvelux Aug 11, 2017
72909e5
Audio recoding and playback test
nvelux Aug 12, 2017
74b8466
Audio recording and playback test
nvelux Aug 12, 2017
f3cb878
Audio record and playback
nvelux Aug 14, 2017
1bd2116
audio test for record and playback
nvelux Aug 14, 2017
ece48a9
Pulseaudio recording and playback test
nvelux Aug 15, 2017
53affe5
Pulseaudio recoeding and playback testing
nvelux Aug 15, 2017
134497d
pulaeaudio recording and playback testing
nvelux Aug 15, 2017
7fbd082
Pulseaudio recording and playback testing
nvelux Aug 16, 2017
8762eae
Pulseaudio recording and playback testing
nvelux Aug 16, 2017
ba87342
Pulseaudio testing for record and playback
nvelux Aug 16, 2017
7abe1a8
Pulseaudio recording and playback testing
nvelux Aug 17, 2017
0a6829a
pulseaudio debugging for running
nvelux Aug 17, 2017
19012f8
pulse audio testing
nvelux Aug 17, 2017
0c00a39
Pulseaudio test for record and playback
nvelux Aug 18, 2017
b674d54
Pulseaudio testing
nvelux Aug 18, 2017
88274cf
Pulse audio playing debugging
nvelux Aug 21, 2017
dddd753
Pulseaudio recording and playing
nvelux Aug 21, 2017
aafa191
Pulseaudio recording and playing test
nvelux Aug 24, 2017
65fbca2
Pulseaudio recoding and playing testing
nvelux Aug 28, 2017
a250627
Pulseaudio recording and playback testing
nvelux Aug 29, 2017
298ea9d
Pulseaudio record and play back test
nvelux Aug 29, 2017
299419f
pulseaudio recording and playback testing
nvelux Aug 29, 2017
443ec36
Pulseaudio recording and playback testing
nvelux Aug 30, 2017
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: 25 additions & 5 deletions meta-iotqa/lib/oeqa/runtime/multimedia/audio/pulseaudio.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import time
from oeqa.oetest import oeRuntimeTest

class PulseaudioTest(oeRuntimeTest):

class PulseaudioTest(oeRuntimeTest):
'''Check pulseaudio existence'''
def test_pulseaudio_exists(self):

def test_pulseaudio_exists(self):
(status, output) = self.target.run('ls /usr/bin/pulseaudio')

self.assertEqual(output, "/usr/bin/pulseaudio", msg="Error messages: pulseaudio not found")
Expand All @@ -19,16 +20,35 @@ def test_modules_loaded(self):
(status, output) = self.target.run("unset XDG_RUNTIME_DIR; su testuser -c \"pactl list\"")

self.assertIn("module-bluetooth-policy", output,
msg=("module-bluetooth-policy not found, pactl output:\n" + output))
msg=("module-bluetooth-policy not found, pactl output:\n" + output))

self.assertIn("module-bluetooth-discover", output,
msg=("module-bluetooth-discover not found, pactl output:\n" + output))
msg=("module-bluetooth-discover not found, pactl output:\n" + output))

self.assertIn("module-bluez5-discover", output,
msg=("module-bluez5-discover not found, pactl output:\n" + output))
msg=("module-bluez5-discover not found, pactl output:\n" + output))

self.target.run("su testuser -c \"pulseaudio --kill\"")
self.target.run("userdel testuser")
self.target.run("rm -rf /home/testuser")
self.target.run("su testuser -c \"pulseaudio --start\"")
self.target.run("XDG_RUNTIME_DIR=" + xdg_runtime_dir)

def test_rec_play(self):
# Start pulseaudio daemon
(status, output) = self.target.run("pulseaudio --start")
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(10)
self.assertEqual(status, 0, msg="Error not recorded: %s" % output)
# Stop pulseaudio daemon
(status, output) = self.target.run("killall -9 parecord")
self.assertEqual(status, 0, msg="Error pulse record not stop: %s" % output)
# Playing audio
(status, output) = self.target.run("paplay /tmp/rec.wav &")
self.assertEqual(status, 0, msg="Error in playing: %s" % output)
time.sleep(3)
# RUNNING state checking
(status, output) = self.target.run("pactl list sinks | grep RUNNING")
self.assertEqual(status, 0, msg="Error in state: %s" % output)