]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Fix qemuxml2xmltest with audio driver defined in env
authorJim Fehlig <jfehlig@suse.com>
Thu, 1 Apr 2021 16:57:36 +0000 (10:57 -0600)
committerJim Fehlig <jfehlig@suse.com>
Thu, 1 Apr 2021 19:49:13 +0000 (13:49 -0600)
If QEMU_AUDIO_DRV is defined in the build host environment, several tests
in qemuxml2xmltest fail.

$ env | grep -i audio
AUDIODRIVER=pulseaudio
QEMU_AUDIO_DRV=pa
SDL_AUDIODRIVER=pulse

An example test failure with the above environment

907) QEMU XML-2-XML-active video-virtio-gpu-sdl-gl
In 'libvirt/tests/qemuxml2xmloutdata/video-virtio-gpu-sdl-gl.xml':
Offset 1244
Expect [v]
Actual [audio id='1' type='pulseaudio'/>
    <v]

Scrub QEMU_AUDIO_DRV from the environment before executing the tests in
qemuxml2xmltest. SDL_AUDIODRIVER also needs scrubbed since it will be
examined if QEMU_AUDIO_DRV=sdl.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
tests/qemuxml2xmltest.c

index 137f1871afc4004ac6bd87066ca5d0d3deb62517..823dd40f5004e81c5ba268f584b5318d636bc330 100644 (file)
@@ -198,6 +198,8 @@ mymain(void)
      * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected
      * values for these envvars */
     g_setenv("PATH", "/bin", TRUE);
+    g_unsetenv("QEMU_AUDIO_DRV");
+    g_unsetenv("SDL_AUDIODRIVER");
 
     DO_TEST("minimal", NONE);
     DO_TEST_CAPS_LATEST("genid");