aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Bolte <matthias.bolte@googlemail.com>2009-12-28 16:21:15 +0100
committerMatthias Bolte <matthias.bolte@googlemail.com>2010-01-20 23:22:15 +0100
commit1671b6470271d2c2e9ed20455e1fdd871f785b2d (patch)
tree410660cc9afd49743de9340a0fa8c762854bbbf2 /tests
parentqemu: Don't allocate zero bytes (diff)
downloadlibvirt-1671b6470271d2c2e9ed20455e1fdd871f785b2d.tar.gz
libvirt-1671b6470271d2c2e9ed20455e1fdd871f785b2d.tar.bz2
libvirt-1671b6470271d2c2e9ed20455e1fdd871f785b2d.zip
Unset copied environment variables in qemuxml2argvtest
The test expected all environment variables copied in qemudBuildCommandLine to have known values. So all of them have to be either set to a known value or be unset. SDL_VIDEODRIVER and QEMU_AUDIO_DRV are not handled at all but should be handled. Unset both, otherwise the test will fail if they are set in the testing environment. * src/qemu/qemu_conf.c: add a comment about copied environment variables and qemuxml2argvtest * tests/qemuxml2argvtest.c: unset SDL_VIDEODRIVER and QEMU_AUDIO_DRV
Diffstat (limited to 'tests')
-rw-r--r--tests/qemuxml2argvtest.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 41e5749fb..fc237c212 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -184,6 +184,9 @@ mymain(int argc, char **argv)
#define DO_TEST(name, extraFlags) \
DO_TEST_FULL(name, extraFlags, NULL)
+ /* Unset or set all envvars here that are copied in qemudBuildCommandLine
+ * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected
+ * values for these envvars */
setenv("PATH", "/bin", 1);
setenv("USER", "test", 1);
setenv("LOGNAME", "test", 1);
@@ -191,6 +194,8 @@ mymain(int argc, char **argv)
unsetenv("TMPDIR");
unsetenv("LD_PRELOAD");
unsetenv("LD_LIBRARY_PATH");
+ unsetenv("QEMU_AUDIO_DRV");
+ unsetenv("SDL_AUDIODRIVER");
DO_TEST("minimal", QEMUD_CMD_FLAG_NAME);
DO_TEST("machine-aliases1", 0);