[libvirt] [PATCH 1/3] Make sure that the vmx2xml test data files are shipped in the distribution.

Without these files the tests will fail when ESX support is enabled. --- tests/Makefile.am | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 63 insertions(+), 1 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 335b0e5..cf51162 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -47,6 +47,67 @@ qemuhelpdata = \ qemu-kvm-0.10.5 \ qemu-kvm-0.11.0-rc2 +vmx2xmldata = \ + vmx2xml-cdrom-ide-device.vmx \ + vmx2xml-cdrom-ide-device.xml \ + vmx2xml-cdrom-ide-file.vmx \ + vmx2xml-cdrom-ide-file.xml \ + vmx2xml-cdrom-scsi-device.vmx \ + vmx2xml-cdrom-scsi-device.xml \ + vmx2xml-cdrom-scsi-file.vmx \ + vmx2xml-cdrom-scsi-file.xml \ + vmx2xml-esx-in-the-wild-1.vmx \ + vmx2xml-esx-in-the-wild-1.xml \ + vmx2xml-esx-in-the-wild-2.vmx \ + vmx2xml-esx-in-the-wild-2.xml \ + vmx2xml-esx-in-the-wild-3.vmx \ + vmx2xml-esx-in-the-wild-3.xml \ + vmx2xml-esx-in-the-wild-4.vmx \ + vmx2xml-esx-in-the-wild-4.xml \ + vmx2xml-ethernet-bridged.vmx \ + vmx2xml-ethernet-bridged.xml \ + vmx2xml-ethernet-custom.vmx \ + vmx2xml-ethernet-custom.xml \ + vmx2xml-ethernet-e1000.vmx \ + vmx2xml-ethernet-e1000.xml \ + vmx2xml-floppy-device.vmx \ + vmx2xml-floppy-device.xml \ + vmx2xml-floppy-file.vmx \ + vmx2xml-floppy-file.xml \ + vmx2xml-gsx-in-the-wild-1.vmx \ + vmx2xml-gsx-in-the-wild-1.xml \ + vmx2xml-gsx-in-the-wild-2.vmx \ + vmx2xml-gsx-in-the-wild-2.xml \ + vmx2xml-gsx-in-the-wild-3.vmx \ + vmx2xml-gsx-in-the-wild-3.xml \ + vmx2xml-gsx-in-the-wild-4.vmx \ + vmx2xml-gsx-in-the-wild-4.xml \ + vmx2xml-harddisk-ide-file.vmx \ + vmx2xml-harddisk-ide-file.xml \ + vmx2xml-harddisk-scsi-file.vmx \ + vmx2xml-harddisk-scsi-file.xml \ + vmx2xml-minimal-64bit.vmx \ + vmx2xml-minimal-64bit.xml \ + vmx2xml-minimal.vmx \ + vmx2xml-minimal.xml \ + vmx2xml-parallel-device.vmx \ + vmx2xml-parallel-device.xml \ + vmx2xml-parallel-file.vmx \ + vmx2xml-parallel-file.xml \ + vmx2xml-scsi-buslogic.vmx \ + vmx2xml-scsi-buslogic.xml \ + vmx2xml-scsi-writethrough.vmx \ + vmx2xml-scsi-writethrough.xml \ + vmx2xml-serial-device.vmx \ + vmx2xml-serial-device.xml \ + vmx2xml-serial-file.vmx \ + vmx2xml-serial-file.xml \ + vmx2xml-serial-pipe-client-app.vmx \ + vmx2xml-serial-pipe-client-vm.vmx \ + vmx2xml-serial-pipe-server-app.vmx \ + vmx2xml-serial-pipe-server-vm.vmx \ + vmx2xml-serial-pipe.xml + EXTRA_DIST = \ oomtrace.pl \ test-lib.sh \ @@ -69,7 +130,8 @@ EXTRA_DIST = \ storagevolxml2xmlin \ nodedevschematest \ nodedevschemadata \ - $(patsubst %,qemuhelpdata/%,$(qemuhelpdata)) + $(patsubst %,qemuhelpdata/%,$(qemuhelpdata)) \ + $(patsubst %,vmx2xmldata/%,$(vmx2xmldata)) noinst_PROGRAMS = virshtest conftest \ nodeinfotest statstest qparamtest -- 1.6.6.rc4

Instead of adding a --with-html-dir option to the configure, require autoconf 2.61 or later that already provides the --htmldir option. --- configure.in | 12 +----------- docs/Makefile.am | 14 +++++++------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/configure.in b/configure.in index 3f2f8ff..848027a 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,6 @@ dnl Process this file with autoconf to produce a configure script. +AC_PREREQ([2.61]) AC_INIT([libvirt], [0.7.5]) AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) @@ -180,17 +181,6 @@ if test -n "$MODPROBE"; then [Location or name of the modprobe program]) fi -dnl Specific dir for HTML output ? -AC_ARG_WITH([html-dir], [AC_HELP_STRING([--with-html-dir=path], - [path to base html directory, default $datadir/doc/html])], - [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc']) - -AC_ARG_WITH([html-subdir], [AC_HELP_STRING([--with-html-subdir=path], - [directory used under html-dir, default $PACKAGE-$VERSION/html])], - [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"], - [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"]) -AC_SUBST([HTML_DIR]) - dnl if --prefix is /usr, don't use /usr/var for localstatedir dnl or /usr/etc for sysconfdir dnl as this makes a lot of things break in testing situations diff --git a/docs/Makefile.am b/docs/Makefile.am index d53f305..b14f651 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -142,21 +142,21 @@ maintainer-clean-local: clean-local rebuild: api all install-data-local: - $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) + $(mkinstalldirs) $(DESTDIR)$(htmldir) -@INSTALL@ -m 0644 $(srcdir)/FAQ.html \ - $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR) - $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html + $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(htmldir) + $(mkinstalldirs) $(DESTDIR)$(htmldir)/html for h in $(apihtml); do \ - $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done + $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(htmldir)/html; done for p in $(apipng); do \ - $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done + $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(htmldir)/html; done $(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR) for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \ @INSTALL@ -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \ done uninstall-local: - for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done - for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done + for h in $(apihtml); do rm $(DESTDIR)$(htmldir)/$$h; done + for p in $(apipng); do rm $(DESTDIR)$(htmldir)/$$p; done for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \ rm $(DESTDIR)$(DEVHELP_DIR)$$f ; done -- 1.6.6.rc4

With these variables present, the tests would fail because they are not expected. --- tests/qemuxml2argvtest.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3b0aa2b..b64dc6a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -188,6 +188,8 @@ mymain(int argc, char **argv) unsetenv("TMPDIR"); unsetenv("LD_PRELOAD"); unsetenv("LD_LIBRARY_PATH"); + unsetenv("SDL_AUDIODRIVER"); + unsetenv("SDL_VIDEODRIVER"); DO_TEST("minimal", QEMUD_CMD_FLAG_NAME); DO_TEST("machine-aliases1", 0); -- 1.6.6.rc4

2009/12/23 Diego Elio Pettenò <flameeyes@gmail.com>:
With these variables present, the tests would fail because they are not expected. --- tests/qemuxml2argvtest.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3b0aa2b..b64dc6a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -188,6 +188,8 @@ mymain(int argc, char **argv) unsetenv("TMPDIR"); unsetenv("LD_PRELOAD"); unsetenv("LD_LIBRARY_PATH"); + unsetenv("SDL_AUDIODRIVER"); + unsetenv("SDL_VIDEODRIVER");
DO_TEST("minimal", QEMUD_CMD_FLAG_NAME); DO_TEST("machine-aliases1", 0); -- 1.6.6.rc4
You're right, all envvars copied in qemudBuildCommandLine should be unset or set to known values in this testcase to make sure the test is not affected by the actual envvar values. But SDL_VIDEODRIVER is not copied in qemudBuildCommandLine and QEMU_AUDIO_DRV is copied but not unset in the test. I suggest the attached patch. Matthias

On Mon, Dec 28, 2009 at 04:35:56PM +0100, Matthias Bolte wrote:
2009/12/23 Diego Elio Pettenò <flameeyes@gmail.com>:
With these variables present, the tests would fail because they are not expected. --- tests/qemuxml2argvtest.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3b0aa2b..b64dc6a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -188,6 +188,8 @@ mymain(int argc, char **argv) unsetenv("TMPDIR"); unsetenv("LD_PRELOAD"); unsetenv("LD_LIBRARY_PATH"); + unsetenv("SDL_AUDIODRIVER"); + unsetenv("SDL_VIDEODRIVER");
DO_TEST("minimal", QEMUD_CMD_FLAG_NAME); DO_TEST("machine-aliases1", 0); -- 1.6.6.rc4
You're right, all envvars copied in qemudBuildCommandLine should be unset or set to known values in this testcase to make sure the test is not affected by the actual envvar values.
But SDL_VIDEODRIVER is not copied in qemudBuildCommandLine and QEMU_AUDIO_DRV is copied but not unset in the test.
I suggest the attached patch.
Matthias
From 891e786c4e0863668b3b5b2e1be4f1acfd2b0f97 Mon Sep 17 00:00:00 2001 From: Matthias Bolte <matthias.bolte@googlemail.com> Date: Mon, 28 Dec 2009 16:21:15 +0100 Subject: [PATCH] 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 --- src/qemu/qemu_conf.c | 2 ++ tests/qemuxml2argvtest.c | 5 +++++ 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index f53c1f7..1f22826 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -2034,6 +2034,8 @@ int qemudBuildCommandLine(virConnectPtr conn, qenv[qenvc++] = envval; \ } while (0)
+ /* Make sure to unset or set all envvars in qemuxml2argvtest.c that + * are copied here using this macro, otherwise the test may fail */ #define ADD_ENV_COPY(envname) \ do { \ char *val = getenv(envname); \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3b0aa2b..4e97294 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -181,6 +181,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); @@ -188,6 +191,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);
ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2010/1/18 Daniel Veillard <veillard@redhat.com>:
On Mon, Dec 28, 2009 at 04:35:56PM +0100, Matthias Bolte wrote:
2009/12/23 Diego Elio Pettenò <flameeyes@gmail.com>:
With these variables present, the tests would fail because they are not expected. --- tests/qemuxml2argvtest.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3b0aa2b..b64dc6a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -188,6 +188,8 @@ mymain(int argc, char **argv) unsetenv("TMPDIR"); unsetenv("LD_PRELOAD"); unsetenv("LD_LIBRARY_PATH"); + unsetenv("SDL_AUDIODRIVER"); + unsetenv("SDL_VIDEODRIVER");
DO_TEST("minimal", QEMUD_CMD_FLAG_NAME); DO_TEST("machine-aliases1", 0); -- 1.6.6.rc4
You're right, all envvars copied in qemudBuildCommandLine should be unset or set to known values in this testcase to make sure the test is not affected by the actual envvar values.
But SDL_VIDEODRIVER is not copied in qemudBuildCommandLine and QEMU_AUDIO_DRV is copied but not unset in the test.
I suggest the attached patch.
Matthias
From 891e786c4e0863668b3b5b2e1be4f1acfd2b0f97 Mon Sep 17 00:00:00 2001 From: Matthias Bolte <matthias.bolte@googlemail.com> Date: Mon, 28 Dec 2009 16:21:15 +0100 Subject: [PATCH] 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 --- src/qemu/qemu_conf.c | 2 ++ tests/qemuxml2argvtest.c | 5 +++++ 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index f53c1f7..1f22826 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -2034,6 +2034,8 @@ int qemudBuildCommandLine(virConnectPtr conn, qenv[qenvc++] = envval; \ } while (0)
+ /* Make sure to unset or set all envvars in qemuxml2argvtest.c that + * are copied here using this macro, otherwise the test may fail */ #define ADD_ENV_COPY(envname) \ do { \ char *val = getenv(envname); \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 3b0aa2b..4e97294 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -181,6 +181,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); @@ -188,6 +191,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);
ACK,
Daniel
Thanks, pushed. Matthias

2009/12/23 Diego Elio Pettenò <flameeyes@gmail.com>:
Without these files the tests will fail when ESX support is enabled. ---
Yes, that need's to be fixed, but I suggest a different approach and distribute xml2vmxdata also. diff --git a/tests/Makefile.am b/tests/Makefile.am index 335b0e5..a20d7ce 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -69,6 +69,8 @@ EXTRA_DIST = \ storagevolxml2xmlin \ nodedevschematest \ nodedevschemadata \ + vmx2xmldata \ + xml2vmxdata \ $(patsubst %,qemuhelpdata/%,$(qemuhelpdata)) noinst_PROGRAMS = virshtest conftest \ Matthias

On Thu, Dec 24, 2009 at 04:11:33AM +0100, Matthias Bolte wrote:
2009/12/23 Diego Elio Pettenò <flameeyes@gmail.com>:
Without these files the tests will fail when ESX support is enabled. ---
Yes, that need's to be fixed, but I suggest a different approach and distribute xml2vmxdata also.
diff --git a/tests/Makefile.am b/tests/Makefile.am index 335b0e5..a20d7ce 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -69,6 +69,8 @@ EXTRA_DIST = \ storagevolxml2xmlin \ nodedevschematest \ nodedevschemadata \ + vmx2xmldata \ + xml2vmxdata \ $(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
noinst_PROGRAMS = virshtest conftest \
ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2009/12/25 Daniel Veillard <veillard@redhat.com>:
On Thu, Dec 24, 2009 at 04:11:33AM +0100, Matthias Bolte wrote:
2009/12/23 Diego Elio Pettenň <flameeyes@gmail.com>:
Without these files the tests will fail when ESX support is enabled. ---
Yes, that need's to be fixed, but I suggest a different approach and distribute xml2vmxdata also.
diff --git a/tests/Makefile.am b/tests/Makefile.am index 335b0e5..a20d7ce 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -69,6 +69,8 @@ EXTRA_DIST = \ storagevolxml2xmlin \ nodedevschematest \ nodedevschemadata \ + vmx2xmldata \ + xml2vmxdata \ $(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
noinst_PROGRAMS = virshtest conftest \
ACK,
Daniel
Okay, pushed. Matthias
participants (3)
-
Daniel Veillard
-
Diego Elio Pettenò
-
Matthias Bolte