diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index d0d1dc35d..48b48da42 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -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__) diff --git a/qubes/tests/integ/audio.py b/qubes/tests/integ/audio.py index 4c1fcbf39..ab650380d 100644 --- a/qubes/tests/integ/audio.py +++ b/qubes/tests/integ/audio.py @@ -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" @@ -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 @@ -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 " @@ -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: @@ -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: diff --git a/qubes/tests/integ/vm_qrexec_gui.py b/qubes/tests/integ/vm_qrexec_gui.py index febf825e1..1c133ca32 100644 --- a/qubes/tests/integ/vm_qrexec_gui.py +++ b/qubes/tests/integ/vm_qrexec_gui.py @@ -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