Skip to content
Merged
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
17 changes: 13 additions & 4 deletions qubes/tests/integ/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def create_audio_vm(self, backend, start=True):
admin.vm.property.Get +xid {vm} @tag:audiovm-{vm} allow target=dom0
admin.vm.property.Get +stubdom_xid {vm} @tag:audiovm-{vm} allow target=dom0
admin.vm.property.Get +virt_mode {vm} @tag:audiovm-{vm} allow target=dom0
admin.vm.property.Get +is_preload {vm} @tag:audiovm-{vm} allow target=dom0
admin.vm.feature.CheckWithTemplate +audio {vm} @tag:audiovm-{vm} allow target=dom0
admin.vm.feature.CheckWithTemplate +audio-model {vm} @tag:audiovm-{vm} allow target=dom0
""".format(
Expand Down Expand Up @@ -418,10 +419,14 @@ def common_audio_record_muted(self):
f"pw-record {self.pwplay_opts} --format=f32 --rate=44100 "
f"--channels=1 - > audio_rec.snd"
)
kill_cmd = "pkill --signal SIGINT pw-record"
kill_cmd = (
"kill -SIGINT $(grep -l pw-record /proc/*/comm | cut -f 3 -d /)"
)
else:
cmd = "parecord --raw audio_rec.snd"
kill_cmd = "pkill --signal SIGINT parecord"
kill_cmd = (
"kill -SIGINT $(grep -l parecord /proc/*/comm | cut -f 3 -d /)"
)
record = self.loop.run_until_complete(
self.testvm1.run(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
Expand Down Expand Up @@ -481,13 +486,17 @@ def common_audio_record_unmuted(self, attach_mic=True, detach_mic=True):
f"pw-record {self.pwplay_opts} --format=f32 --rate=44100 "
"--channels=1 - > audio_rec.snd"
)
kill_cmd = "pkill --signal SIGINT pw-record"
kill_cmd = (
"kill -SIGINT $(grep -l pw-record /proc/*/comm | cut -f 3 -d /)"
)
else:
record_cmd = (
"parecord --raw --format=float32le --rate=44100 "
"--channels=1 audio_rec.snd"
)
kill_cmd = "pkill --signal SIGINT parecord"
kill_cmd = (
"kill -SIGINT $(grep -l parecord /proc/*/comm | cut -f 3 -d /)"
)
record = self.loop.run_until_complete(self.testvm1.run(record_cmd))
# give it time to start recording
self.loop.run_until_complete(asyncio.sleep(2))
Expand Down