Skip to content
Merged
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
3 changes: 3 additions & 0 deletions qubes/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ def __exit__(self, exc_type, exc_val, exc_tb):
return
ex = exc_val
while ex is not None:
if isinstance(ex, subprocess.CalledProcessError):
# include stderr in the log
print(f"CalledProcessError({ex.cmd}): stderr={ex.stderr!r}")
if isinstance(ex, qubes.exc.QubesVMError):
ex.vm = None
traceback.clear_frames(ex.__traceback__)
Expand Down
26 changes: 18 additions & 8 deletions qubes/tests/integ/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def wait_for_pulseaudio_startup(self, vm):
self.loop.run_until_complete(asyncio.sleep(1))

def prepare_audio_test(self, backend):
self.pwplay_opts = ""
self.loop.run_until_complete(self.testvm1.start())
pulseaudio_units = "pulseaudio.socket pulseaudio.service"
pipewire_units = "pipewire.socket wireplumber.service pipewire.service"
Expand All @@ -78,6 +79,15 @@ def prepare_audio_test(self, backend):
):
self.skipTest("PipeWire audio not supported in Debian 11")
self.testvm1.features["service.pipewire"] = True
try:
self.loop.run_until_complete(
self.testvm1.run_for_stdio(
"pw-play --help | grep -q -- --raw",
)
)
self.pwplay_opts = "--raw"
except subprocess.CalledProcessError:
pass
elif backend == "pulseaudio":
# Use PulseAudio if it is installed. If it is not installed,
# PipeWire will still run, and its PulseAudio emulation will
Expand Down Expand Up @@ -210,7 +220,10 @@ def common_audio_playback(self):
)
local_user = grp.getgrnam("qubes").gr_mem[0]
if self.testvm1.features["service.pipewire"]:
cmd = "timeout 20s pw-play --format=f32 --rate=44100 --channels=1 - < audio_in.snd"
cmd = (
f"timeout 20s pw-play {self.pwplay_opts} --format=f32 "
f"--rate=44100 --channels=1 - < audio_in.snd"
)
else:
cmd = (
"timeout 20s paplay --format=float32le --rate=44100 --channels=1 "
Expand Down Expand Up @@ -384,11 +397,10 @@ def common_audio_record_muted(self):
audio_in = b"\x20" * 4 * 44100
local_user = grp.getgrnam("qubes").gr_mem[0]
sudo = ["sudo", "-E", "-u", local_user]
# Need to use .snd extension so that pw-play (really libsndfile)
# recognizes the file as raw audio.
if self.testvm1.features["service.pipewire"]:
cmd = (
"pw-record --format=f32 --rate=44100 --channels=1 audio_rec.snd"
f"pw-record {self.pwplay_opts} --format=f32 --rate=44100 "
f"--channels=1 - > audio_rec.snd"
)
kill_cmd = "pkill --signal SIGINT pw-record"
else:
Expand Down Expand Up @@ -448,12 +460,10 @@ def common_audio_record_unmuted(self, attach_mic=True, detach_mic=True):
local_user = grp.getgrnam("qubes").gr_mem[0]
sudo = ["sudo", "-E", "-u", local_user]

# Need to use .snd extension so that pw-play (really libsndfile)
# recognizes the file as raw audio.
if self.testvm1.features["service.pipewire"]:
record_cmd = (
"pw-record --format=f32 --rate=44100 --channels=1 "
"audio_rec.snd"
f"pw-record {self.pwplay_opts} --format=f32 --rate=44100 "
"--channels=1 - > audio_rec.snd"
)
kill_cmd = "pkill --signal SIGINT pw-record"
else:
Expand Down
6 changes: 6 additions & 0 deletions qubes/tests/integ/vm_qrexec_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@ async def _test_300_bug_1028_gui_memory_pinning(self):
# prevent Whonix startup notifications from interfering
self.testvm1.features["service.whonix-tor-disable"] = True
await self.testvm1.start()
# avoid whonix wizard showing up
if "whonix" in self.template:
await self.testvm1.run_for_stdio(
"touch /var/lib/whonix/do_once/whonixsetup.done",
user="root",
)
await self.wait_for_session(self.testvm1)

# and allow large map count
Expand Down