diff options
author | Matthias Bolte <matthias.bolte@googlemail.com> | 2010-12-21 22:39:55 +0100 |
---|---|---|
committer | Matthias Bolte <matthias.bolte@googlemail.com> | 2010-12-21 22:40:17 +0100 |
commit | 42b2f35d36a9e33f03e973130267c19cff910f2e (patch) | |
tree | 72518bffade5c174aff4b9b069d6a8a40e0fa167 /tests/vmx2xmltest.c | |
parent | esx: Fix cluster resource lookup when connecting to a vCenter (diff) | |
download | libvirt-42b2f35d36a9e33f03e973130267c19cff910f2e.tar.gz libvirt-42b2f35d36a9e33f03e973130267c19cff910f2e.tar.bz2 libvirt-42b2f35d36a9e33f03e973130267c19cff910f2e.zip |
esx: Move VMX handling code out of the driver directory
Now the VMware driver doesn't depend on the ESX driver anymore.
Add a WITH_VMX option that depends on WITH_ESX and WITH_VMWARE.
Also add a libvirt_vmx.syms file.
Move some escaping functions from esx_util.c to vmx.c.
Adapt the test suite, ESX and VMware driver to the new code layout.
Diffstat (limited to 'tests/vmx2xmltest.c')
-rw-r--r-- | tests/vmx2xmltest.c | 108 |
1 files changed, 53 insertions, 55 deletions
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index ba50034d2..9378db300 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -1,6 +1,6 @@ #include <config.h> -#ifdef WITH_ESX +#ifdef WITH_VMX # include <stdio.h> # include <string.h> @@ -9,12 +9,12 @@ # include "internal.h" # include "memory.h" # include "testutils.h" -# include "esx/esx_vmx.h" +# include "vmx/vmx.h" static char *progname = NULL; static char *abs_srcdir = NULL; static virCapsPtr caps = NULL; -static esxVMX_Context ctx; +static virVMXContext ctx; # define MAX_FILE 4096 @@ -68,8 +68,7 @@ testCapsInit(void) } static int -testCompareFiles(const char *vmx, const char *xml, - esxVI_ProductVersion productVersion) +testCompareFiles(const char *vmx, const char *xml) { int result = -1; char vmxData[MAX_FILE]; @@ -88,7 +87,7 @@ testCompareFiles(const char *vmx, const char *xml, goto failure; } - def = esxVMX_ParseConfig(&ctx, caps, vmxData, productVersion); + def = virVMXParseConfig(&ctx, caps, vmxData); if (def == NULL) { err = virGetLastError(); @@ -121,7 +120,6 @@ testCompareFiles(const char *vmx, const char *xml, struct testInfo { const char *input; const char *output; - esxVI_ProductVersion version; }; static int @@ -136,7 +134,7 @@ testCompareHelper(const void *data) snprintf(xml, PATH_MAX, "%s/vmx2xmldata/vmx2xml-%s.xml", abs_srcdir, info->output); - return testCompareFiles(vmx, xml, info->version); + return testCompareFiles(vmx, xml); } static char * @@ -206,9 +204,9 @@ mymain(int argc, char **argv) return EXIT_FAILURE; } -# define DO_TEST(_in, _out, _version) \ +# define DO_TEST(_in, _out) \ do { \ - struct testInfo info = { _in, _out, _version }; \ + struct testInfo info = { _in, _out }; \ virResetLastError(); \ if (virtTestRun("VMware VMX-2-XML "_in" -> "_out, 1, \ testCompareHelper, &info) < 0) { \ @@ -227,65 +225,65 @@ mymain(int argc, char **argv) ctx.formatFileName = NULL; ctx.autodetectSCSIControllerModel = NULL; - DO_TEST("case-insensitive-1", "case-insensitive-1", esxVI_ProductVersion_ESX35); - DO_TEST("case-insensitive-2", "case-insensitive-2", esxVI_ProductVersion_ESX35); + DO_TEST("case-insensitive-1", "case-insensitive-1"); + DO_TEST("case-insensitive-2", "case-insensitive-2"); - DO_TEST("minimal", "minimal", esxVI_ProductVersion_ESX35); - DO_TEST("minimal-64bit", "minimal-64bit", esxVI_ProductVersion_ESX35); + DO_TEST("minimal", "minimal"); + DO_TEST("minimal-64bit", "minimal-64bit"); - DO_TEST("graphics-vnc", "graphics-vnc", esxVI_ProductVersion_ESX35); + DO_TEST("graphics-vnc", "graphics-vnc"); - DO_TEST("scsi-driver", "scsi-driver", esxVI_ProductVersion_ESX35); - DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_ProductVersion_ESX35); + DO_TEST("scsi-driver", "scsi-driver"); + DO_TEST("scsi-writethrough", "scsi-writethrough"); - DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_ProductVersion_ESX35); - DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_ProductVersion_ESX35); + DO_TEST("harddisk-scsi-file", "harddisk-scsi-file"); + DO_TEST("harddisk-ide-file", "harddisk-ide-file"); - DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_ProductVersion_ESX35); - DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_ProductVersion_ESX35); - DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_ProductVersion_ESX35); - DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_ProductVersion_ESX35); + DO_TEST("cdrom-scsi-file", "cdrom-scsi-file"); + DO_TEST("cdrom-scsi-device", "cdrom-scsi-device"); + DO_TEST("cdrom-ide-file", "cdrom-ide-file"); + DO_TEST("cdrom-ide-device", "cdrom-ide-device"); - DO_TEST("floppy-file", "floppy-file", esxVI_ProductVersion_ESX35); - DO_TEST("floppy-device", "floppy-device", esxVI_ProductVersion_ESX35); + DO_TEST("floppy-file", "floppy-file"); + DO_TEST("floppy-device", "floppy-device"); - DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_ProductVersion_ESX35); - DO_TEST("ethernet-vmxnet2", "ethernet-vmxnet2", esxVI_ProductVersion_ESX35); + DO_TEST("ethernet-e1000", "ethernet-e1000"); + DO_TEST("ethernet-vmxnet2", "ethernet-vmxnet2"); - DO_TEST("ethernet-custom", "ethernet-custom", esxVI_ProductVersion_ESX35); - DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_ProductVersion_ESX35); + DO_TEST("ethernet-custom", "ethernet-custom"); + DO_TEST("ethernet-bridged", "ethernet-bridged"); - DO_TEST("ethernet-generated", "ethernet-generated", esxVI_ProductVersion_ESX35); - DO_TEST("ethernet-static", "ethernet-static", esxVI_ProductVersion_ESX35); - DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_ProductVersion_ESX35); - DO_TEST("ethernet-other", "ethernet-other", esxVI_ProductVersion_ESX35); + DO_TEST("ethernet-generated", "ethernet-generated"); + DO_TEST("ethernet-static", "ethernet-static"); + DO_TEST("ethernet-vpx", "ethernet-vpx"); + DO_TEST("ethernet-other", "ethernet-other"); - DO_TEST("serial-file", "serial-file", esxVI_ProductVersion_ESX35); - DO_TEST("serial-device", "serial-device", esxVI_ProductVersion_ESX35); - DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_ProductVersion_ESX35); - DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35); - DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_ProductVersion_ESX35); - DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35); - DO_TEST("serial-network-server", "serial-network-server", esxVI_ProductVersion_ESX41); - DO_TEST("serial-network-client", "serial-network-client", esxVI_ProductVersion_ESX41); + DO_TEST("serial-file", "serial-file"); + DO_TEST("serial-device", "serial-device"); + DO_TEST("serial-pipe-client-app", "serial-pipe"); + DO_TEST("serial-pipe-server-vm", "serial-pipe"); + DO_TEST("serial-pipe-client-app", "serial-pipe"); + DO_TEST("serial-pipe-server-vm", "serial-pipe"); + DO_TEST("serial-network-server", "serial-network-server"); + DO_TEST("serial-network-client", "serial-network-client"); - DO_TEST("parallel-file", "parallel-file", esxVI_ProductVersion_ESX35); - DO_TEST("parallel-device", "parallel-device", esxVI_ProductVersion_ESX35); + DO_TEST("parallel-file", "parallel-file"); + DO_TEST("parallel-device", "parallel-device"); - DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_ProductVersion_ESX35); - DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_ProductVersion_ESX35); - DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_ProductVersion_ESX35); - DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_ProductVersion_ESX35); - DO_TEST("esx-in-the-wild-5", "esx-in-the-wild-5", esxVI_ProductVersion_ESX40); + DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1"); + DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2"); + DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3"); + DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4"); + DO_TEST("esx-in-the-wild-5", "esx-in-the-wild-5"); - DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_ProductVersion_ESX35); - DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_ProductVersion_ESX35); - DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_ProductVersion_ESX35); - DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_ProductVersion_ESX35); + DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1"); + DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2"); + DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3"); + DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4"); - DO_TEST("annotation", "annotation", esxVI_ProductVersion_ESX35); + DO_TEST("annotation", "annotation"); - DO_TEST("smbios", "smbios", esxVI_ProductVersion_ESX35); + DO_TEST("smbios", "smbios"); virCapabilitiesFree(caps); @@ -301,4 +299,4 @@ int main (void) return 77; /* means 'test skipped' for automake */ } -#endif /* WITH_ESX */ +#endif /* WITH_VMX */ |