From af4c893eb77e030eb9ed0bb4ddc769275078c62c Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Wed, 23 Sep 2009 14:25:52 +0200 Subject: [PATCH] ESX add tests for the VMX to/from domain XML mapping * tests/.gitignore: ignore new test binaries * tests/Makefile.am: add new tests * tests/esxutilstest.c: test esxVMX_IndexToDiskName() * tests/vmx2xmldata/*: config files for the VMX to domain XML test * tests/vmx2xmltest.c: test the VMX to domain XML mapping * tests/xml2vmxdata/*: config files for the domain XML to VMX test * tests/xml2vmxtest.c: test the domain XML to VMX mapping --- tests/.gitignore | 3 + tests/Makefile.am | 27 +++ tests/esxutilstest.c | 99 ++++++++ .../vmx2xmldata/vmx2xml-cdrom-ide-device.vmx | 6 + .../vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 19 ++ tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx | 5 + tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 19 ++ .../vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx | 6 + .../vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 19 ++ tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx | 6 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 19 ++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-1.vmx | 52 ++++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml | 25 ++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-2.vmx | 99 ++++++++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml | 47 ++++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-3.vmx | 70 ++++++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml | 33 +++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-4.vmx | 65 +++++ .../vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml | 41 ++++ .../vmx2xmldata/vmx2xml-ethernet-bridged.vmx | 7 + .../vmx2xmldata/vmx2xml-ethernet-bridged.xml | 19 ++ tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx | 8 + tests/vmx2xmldata/vmx2xml-ethernet-custom.xml | 20 ++ tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx | 8 + tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml | 20 ++ tests/vmx2xmldata/vmx2xml-floppy-device.vmx | 5 + tests/vmx2xmldata/vmx2xml-floppy-device.xml | 19 ++ tests/vmx2xmldata/vmx2xml-floppy-file.vmx | 5 + tests/vmx2xmldata/vmx2xml-floppy-file.xml | 19 ++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-1.vmx | 54 +++++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml | 25 ++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-2.vmx | 52 ++++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml | 25 ++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-3.vmx | 59 +++++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml | 30 +++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-4.vmx | 54 +++++ .../vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml | 25 ++ .../vmx2xmldata/vmx2xml-harddisk-ide-file.vmx | 5 + .../vmx2xmldata/vmx2xml-harddisk-ide-file.xml | 19 ++ .../vmx2xml-harddisk-scsi-file.vmx | 6 + .../vmx2xml-harddisk-scsi-file.xml | 19 ++ tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx | 3 + tests/vmx2xmldata/vmx2xml-minimal-64bit.xml | 15 ++ tests/vmx2xmldata/vmx2xml-minimal.vmx | 2 + tests/vmx2xmldata/vmx2xml-minimal.xml | 15 ++ tests/vmx2xmldata/vmx2xml-parallel-device.vmx | 5 + tests/vmx2xmldata/vmx2xml-parallel-device.xml | 19 ++ tests/vmx2xmldata/vmx2xml-parallel-file.vmx | 5 + tests/vmx2xmldata/vmx2xml-parallel-file.xml | 19 ++ tests/vmx2xmldata/vmx2xml-scsi-buslogic.vmx | 7 + tests/vmx2xmldata/vmx2xml-scsi-buslogic.xml | 20 ++ .../vmx2xmldata/vmx2xml-scsi-writethrough.vmx | 8 + .../vmx2xmldata/vmx2xml-scsi-writethrough.xml | 20 ++ tests/vmx2xmldata/vmx2xml-serial-device.vmx | 5 + tests/vmx2xmldata/vmx2xml-serial-device.xml | 23 ++ tests/vmx2xmldata/vmx2xml-serial-file.vmx | 5 + tests/vmx2xmldata/vmx2xml-serial-file.xml | 23 ++ .../vmx2xml-serial-pipe-client-app.vmx | 7 + .../vmx2xml-serial-pipe-client-vm.vmx | 6 + .../vmx2xml-serial-pipe-server-app.vmx | 7 + .../vmx2xml-serial-pipe-server-vm.vmx | 6 + tests/vmx2xmldata/vmx2xml-serial-pipe.xml | 23 ++ tests/vmx2xmltest.c | 173 ++++++++++++++ .../xml2vmxdata/xml2vmx-cdrom-ide-device.vmx | 10 + .../xml2vmxdata/xml2vmx-cdrom-ide-device.xml | 14 ++ tests/xml2vmxdata/xml2vmx-cdrom-ide-file.vmx | 10 + tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml | 14 ++ .../xml2vmxdata/xml2vmx-cdrom-scsi-device.vmx | 11 + .../xml2vmxdata/xml2vmx-cdrom-scsi-device.xml | 14 ++ tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.vmx | 11 + tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml | 14 ++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx | 17 ++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml | 25 ++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx | 38 +++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml | 47 ++++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx | 24 ++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml | 33 +++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx | 29 +++ .../xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml | 41 ++++ .../xml2vmxdata/xml2vmx-ethernet-bridged.vmx | 12 + .../xml2vmxdata/xml2vmx-ethernet-bridged.xml | 14 ++ tests/xml2vmxdata/xml2vmx-ethernet-custom.vmx | 13 + tests/xml2vmxdata/xml2vmx-ethernet-custom.xml | 15 ++ tests/xml2vmxdata/xml2vmx-ethernet-e1000.vmx | 13 + tests/xml2vmxdata/xml2vmx-ethernet-e1000.xml | 15 ++ tests/xml2vmxdata/xml2vmx-floppy-device.vmx | 10 + tests/xml2vmxdata/xml2vmx-floppy-device.xml | 14 ++ tests/xml2vmxdata/xml2vmx-floppy-file.vmx | 10 + tests/xml2vmxdata/xml2vmx-floppy-file.xml | 14 ++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx | 16 ++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml | 25 ++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx | 16 ++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml | 25 ++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx | 22 ++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml | 30 +++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx | 16 ++ .../xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml | 25 ++ .../xml2vmxdata/xml2vmx-harddisk-ide-file.vmx | 10 + .../xml2vmxdata/xml2vmx-harddisk-ide-file.xml | 14 ++ .../xml2vmx-harddisk-scsi-file.vmx | 11 + .../xml2vmx-harddisk-scsi-file.xml | 14 ++ tests/xml2vmxdata/xml2vmx-minimal-64bit.vmx | 7 + tests/xml2vmxdata/xml2vmx-minimal-64bit.xml | 8 + tests/xml2vmxdata/xml2vmx-minimal.vmx | 7 + tests/xml2vmxdata/xml2vmx-minimal.xml | 8 + tests/xml2vmxdata/xml2vmx-parallel-device.vmx | 10 + tests/xml2vmxdata/xml2vmx-parallel-device.xml | 14 ++ tests/xml2vmxdata/xml2vmx-parallel-file.vmx | 10 + tests/xml2vmxdata/xml2vmx-parallel-file.xml | 14 ++ tests/xml2vmxdata/xml2vmx-scsi-buslogic.vmx | 12 + tests/xml2vmxdata/xml2vmx-scsi-buslogic.xml | 15 ++ .../xml2vmxdata/xml2vmx-scsi-writethrough.vmx | 13 + .../xml2vmxdata/xml2vmx-scsi-writethrough.xml | 15 ++ tests/xml2vmxdata/xml2vmx-serial-device.vmx | 11 + tests/xml2vmxdata/xml2vmx-serial-device.xml | 14 ++ tests/xml2vmxdata/xml2vmx-serial-file.vmx | 11 + tests/xml2vmxdata/xml2vmx-serial-file.xml | 14 ++ tests/xml2vmxdata/xml2vmx-serial-pipe.vmx | 13 + tests/xml2vmxdata/xml2vmx-serial-pipe.xml | 14 ++ tests/xml2vmxtest.c | 226 ++++++++++++++++++ 120 files changed, 2721 insertions(+) create mode 100644 tests/esxutilstest.c create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml create mode 100644 tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml create mode 100644 tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-ethernet-custom.xml create mode 100644 tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml create mode 100644 tests/vmx2xmldata/vmx2xml-floppy-device.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-floppy-device.xml create mode 100644 tests/vmx2xmldata/vmx2xml-floppy-file.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-floppy-file.xml create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml create mode 100644 tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml create mode 100644 tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml create mode 100644 tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-minimal-64bit.xml create mode 100644 tests/vmx2xmldata/vmx2xml-minimal.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-minimal.xml create mode 100644 tests/vmx2xmldata/vmx2xml-parallel-device.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-parallel-device.xml create mode 100644 tests/vmx2xmldata/vmx2xml-parallel-file.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-parallel-file.xml create mode 100644 tests/vmx2xmldata/vmx2xml-scsi-buslogic.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-scsi-buslogic.xml create mode 100644 tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml create mode 100644 tests/vmx2xmldata/vmx2xml-serial-device.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-serial-device.xml create mode 100644 tests/vmx2xmldata/vmx2xml-serial-file.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-serial-file.xml create mode 100644 tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-serial-pipe.xml create mode 100644 tests/vmx2xmltest.c create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-ide-device.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-ide-device.xml create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-ide-file.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.xml create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml create mode 100644 tests/xml2vmxdata/xml2vmx-ethernet-bridged.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-ethernet-bridged.xml create mode 100644 tests/xml2vmxdata/xml2vmx-ethernet-custom.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-ethernet-custom.xml create mode 100644 tests/xml2vmxdata/xml2vmx-ethernet-e1000.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-ethernet-e1000.xml create mode 100644 tests/xml2vmxdata/xml2vmx-floppy-device.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-floppy-device.xml create mode 100644 tests/xml2vmxdata/xml2vmx-floppy-file.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-floppy-file.xml create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml create mode 100644 tests/xml2vmxdata/xml2vmx-harddisk-ide-file.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-harddisk-ide-file.xml create mode 100644 tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.xml create mode 100644 tests/xml2vmxdata/xml2vmx-minimal-64bit.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-minimal-64bit.xml create mode 100644 tests/xml2vmxdata/xml2vmx-minimal.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-minimal.xml create mode 100644 tests/xml2vmxdata/xml2vmx-parallel-device.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-parallel-device.xml create mode 100644 tests/xml2vmxdata/xml2vmx-parallel-file.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-parallel-file.xml create mode 100644 tests/xml2vmxdata/xml2vmx-scsi-buslogic.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-scsi-buslogic.xml create mode 100644 tests/xml2vmxdata/xml2vmx-scsi-writethrough.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-scsi-writethrough.xml create mode 100644 tests/xml2vmxdata/xml2vmx-serial-device.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-serial-device.xml create mode 100644 tests/xml2vmxdata/xml2vmx-serial-file.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-serial-file.xml create mode 100644 tests/xml2vmxdata/xml2vmx-serial-pipe.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-serial-pipe.xml create mode 100644 tests/xml2vmxtest.c diff --git a/tests/.gitignore b/tests/.gitignore index 466ec1352b..6d67c2adab 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -27,3 +27,6 @@ object-locking object-locking.cmi object-locking.cmx object-locking-files.txt +esxutilstest +vmx2xmltest +xml2vmxtest diff --git a/tests/Makefile.am b/tests/Makefile.am index abda4ad790..97bdf551ee 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -76,6 +76,10 @@ if WITH_QEMU noinst_PROGRAMS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest endif +if WITH_ESX +noinst_PROGRAMS += esxutilstest vmx2xmltest xml2vmxtest +endif + if WITH_SECDRIVER_SELINUX noinst_PROGRAMS += seclabeltest endif @@ -137,6 +141,10 @@ if WITH_QEMU TESTS += qemuxml2argvtest qemuxml2xmltest qemuargv2xmltest qemuhelptest endif +if WITH_ESX +TESTS += esxutilstest vmx2xmltest xml2vmxtest +endif + if WITH_SECDRIVER_SELINUX TESTS += seclabeltest endif @@ -223,6 +231,25 @@ else EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c qemuhelptest.c testutilsqemu.c testutilsqemu.h endif +if WITH_ESX +esxutilstest_SOURCES = \ + esxutilstest.c \ + testutils.c testutils.h +esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS) + +vmx2xmltest_SOURCES = \ + vmx2xmltest.c \ + testutils.c testutils.h +vmx2xmltest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS) + +xml2vmxtest_SOURCES = \ + xml2vmxtest.c \ + testutils.c testutils.h +xml2vmxtest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS) +else +EXTRA_DIST += esxutilstest.c vmx2xmltest.c xml2vmxtest.c +endif + nodedevxml2xmltest_SOURCES = \ nodedevxml2xmltest.c \ testutils.c testutils.h diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c new file mode 100644 index 0000000000..7eca1befb0 --- /dev/null +++ b/tests/esxutilstest.c @@ -0,0 +1,99 @@ +#include + +#ifdef WITH_ESX + +#include +#include +#include + +#include "internal.h" +#include "memory.h" +#include "testutils.h" +#include "esx/esx_vmx.h" + +static char *progname; + +struct testInfo { + const char *input; + const char *output; + esxVI_APIVersion version; +}; + +static const char* names[] = { + "sda", "sdb", "sdc", "sdd", "sde", "sdf", "sdg", "sdh", "sdi", "sdj", "sdk", "sdl", "sdm", "sdn", "sdo", "sdp", "sdq", "sdr", "sds", "sdt", "sdu", "sdv", "sdw", "sdx", "sdy", "sdz", + "sdaa", "sdab", "sdac", "sdad", "sdae", "sdaf", "sdag", "sdah", "sdai", "sdaj", "sdak", "sdal", "sdam", "sdan", "sdao", "sdap", "sdaq", "sdar", "sdas", "sdat", "sdau", "sdav", "sdaw", "sdax", "sday", "sdaz", + "sdba", "sdbb", "sdbc", "sdbd", "sdbe", "sdbf", "sdbg", "sdbh", "sdbi", "sdbj", "sdbk", "sdbl", "sdbm", "sdbn", "sdbo", "sdbp", "sdbq", "sdbr", "sdbs", "sdbt", "sdbu", "sdbv", "sdbw", "sdbx", "sdby", "sdbz", + "sdca", "sdcb", "sdcc", "sdcd", "sdce", "sdcf", "sdcg", "sdch", "sdci", "sdcj", "sdck", "sdcl", "sdcm", "sdcn", "sdco", "sdcp", "sdcq", "sdcr", "sdcs", "sdct", "sdcu", "sdcv", "sdcw", "sdcx", "sdcy", "sdcz", + "sdda", "sddb", "sddc", "sddd", "sdde", "sddf", "sddg", "sddh", "sddi", "sddj", "sddk", "sddl", "sddm", "sddn", "sddo", "sddp", "sddq", "sddr", "sdds", "sddt", "sddu", "sddv", "sddw", "sddx", "sddy", "sddz", + "sdea", "sdeb", "sdec", "sded", "sdee", "sdef", "sdeg", "sdeh", "sdei", "sdej", "sdek", "sdel", "sdem", "sden", "sdeo", "sdep", "sdeq", "sder", "sdes", "sdet", "sdeu", "sdev", "sdew", "sdex", "sdey", "sdez", + "sdfa", "sdfb", "sdfc", "sdfd", "sdfe", "sdff", "sdfg", "sdfh", "sdfi", "sdfj", "sdfk", "sdfl", "sdfm", "sdfn", "sdfo", "sdfp", "sdfq", "sdfr", "sdfs", "sdft", "sdfu", "sdfv", "sdfw", "sdfx", "sdfy", "sdfz", + "sdga", "sdgb", "sdgc", "sdgd", "sdge", "sdgf", "sdgg", "sdgh", "sdgi", "sdgj", "sdgk", "sdgl", "sdgm", "sdgn", "sdgo", "sdgp", "sdgq", "sdgr", "sdgs", "sdgt", "sdgu", "sdgv", "sdgw", "sdgx", "sdgy", "sdgz", + "sdha", "sdhb", "sdhc", "sdhd", "sdhe", "sdhf", "sdhg", "sdhh", "sdhi", "sdhj", "sdhk", "sdhl", "sdhm", "sdhn", "sdho", "sdhp", "sdhq", "sdhr", "sdhs", "sdht", "sdhu", "sdhv", "sdhw", "sdhx", "sdhy", "sdhz", + "sdia", "sdib", "sdic", "sdid", "sdie", "sdif", "sdig", "sdih", "sdii", "sdij", "sdik", "sdil", "sdim", "sdin", "sdio", "sdip", "sdiq", "sdir", "sdis", "sdit", "sdiu", "sdiv", "sdiw", "sdix", "sdiy", "sdiz" +}; + +static int +testIndexToDiskName(const void *data ATTRIBUTE_UNUSED) +{ + int i; + char *name = NULL; + + for (i = 0; i < ARRAY_CARDINALITY(names); ++i) { + VIR_FREE(name); + + name = esxVMX_IndexToDiskName(NULL, i, "sd"); + + if (STRNEQ(names[i], name)) { + virtTestDifference(stderr, names[i], name); + VIR_FREE(name); + + return -1; + } + + if (virDiskNameToIndex(name) != i) { + VIR_FREE(name); + + return -1; + } + } + + VIR_FREE(name); + + return 0; +} + +static int +mymain(int argc, char **argv) +{ + int result = 0; + + progname = argv[0]; + + if (argc > 1) { + fprintf(stderr, "Usage: %s\n", progname); + return EXIT_FAILURE; + } + + if (argc > 1) { + fprintf(stderr, "Usage: %s\n", progname); + return EXIT_FAILURE; + } + + if (virtTestRun("VMware IndexToDiskName", 1, testIndexToDiskName, + NULL) < 0) { + result = -1; + } + + return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE; +} + +VIRT_TEST_MAIN(mymain) + +#else + +int main (void) +{ + return 77; /* means 'test skipped' for automake */ +} + +#endif /* WITH_ESX */ diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx new file mode 100644 index 0000000000..dc789d257e --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx @@ -0,0 +1,6 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +ide0:0.present = "true" +ide0:0.deviceType = "atapi-cdrom" +ide0:0.fileName = "/dev/scd0" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml new file mode 100644 index 0000000000..12c431e42b --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx new file mode 100644 index 0000000000..edd3999d0e --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +ide0:0.present = "true" +ide0:0.deviceType = "cdrom-image" +ide0:0.fileName = "cdrom.iso" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml new file mode 100644 index 0000000000..37451481d8 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx new file mode 100644 index 0000000000..721068aded --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx @@ -0,0 +1,6 @@ +config.version = "8" +virtualHW.version = "4" +scsi0.present = "true" +scsi0:0.present = "true" +scsi0:0.deviceType = "atapi-cdrom" +scsi0:0.fileName = "/dev/scd0" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml new file mode 100644 index 0000000000..55ea5e22ea --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx new file mode 100644 index 0000000000..3422e0b6d9 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx @@ -0,0 +1,6 @@ +config.version = "8" +virtualHW.version = "4" +scsi0.present = "true" +scsi0:0.present = "true" +scsi0:0.deviceType = "cdrom-image" +scsi0:0.fileName = "cdrom.iso" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml new file mode 100644 index 0000000000..2d37bdec45 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.vmx b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.vmx new file mode 100644 index 0000000000..4392062fbc --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.vmx @@ -0,0 +1,52 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" +floppy0.present = "false" +nvram = "Fedora11.nvram" +deploymentPlatform = "windows" +virtualHW.productCompatibility = "hosted" +tools.upgrade.policy = "useGlobal" +powerType.powerOff = "default" +powerType.powerOn = "default" +powerType.suspend = "default" +powerType.reset = "default" + +displayName = "Fedora11" +extendedConfigFile = "Fedora11.vmxf" + +scsi0.present = "true" +scsi0.sharedBus = "none" +scsi0.virtualDev = "lsilogic" +memsize = "1024" +scsi0:0.present = "true" +scsi0:0.fileName = "Fedora11.vmdk" +scsi0:0.deviceType = "scsi-hardDisk" +ide0:0.present = "true" +ide0:0.clientDevice = "true" +ide0:0.deviceType = "cdrom-raw" +ide0:0.startConnected = "false" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.addressType = "vpx" +ethernet0.generatedAddress = "00:50:56:91:48:c7" +chipset.onlineStandby = "false" +guestOSAltName = "Red Hat Enterprise Linux 5 (32-Bit)" +guestOS = "rhel5" +uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10" +snapshot.action = "keep" +sched.cpu.min = "0" +sched.cpu.units = "mhz" +sched.cpu.shares = "normal" +sched.mem.minsize = "0" +sched.mem.shares = "normal" +toolScripts.afterPowerOn = "true" +toolScripts.afterResume = "true" +toolScripts.beforeSuspend = "true" +toolScripts.beforePowerOff = "true" + +scsi0:0.redo = "" +tools.syncTime = "FALSE" +uuid.location = "56 4d b5 06 a2 bd fb eb-ae 86 f7 d8 49 27 d0 c4" +sched.cpu.max = "unlimited" +sched.swap.derivedName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Fedora11/Fedora11-7de040d8.vswp" +tools.remindInstall = "TRUE" diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml new file mode 100644 index 0000000000..8a004747b7 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml @@ -0,0 +1,25 @@ + + Fedora11 + 50115e16-9bdc-49d7-f171-53c4d7f91710 + 1048576 + 1048576 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.vmx b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.vmx new file mode 100644 index 0000000000..19e7afc785 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.vmx @@ -0,0 +1,99 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" +nvram = "Debian1.nvram" +deploymentPlatform = "windows" +virtualHW.productCompatibility = "hosted" +tools.upgrade.policy = "useGlobal" +powerType.powerOff = "default" +powerType.powerOn = "default" +powerType.suspend = "default" +powerType.reset = "default" + +displayName = "virtDebian1" +extendedConfigFile = "Debian1.vmxf" + +memsize = "1000" + +scsi0.present = "true" +scsi0.virtualDev = "lsilogic" +scsi0.sharedBus = "none" + +scsi1.present = "true" +scsi1.virtualDev = "buslogic" + +scsi0:0.redo = "" +scsi0:0.present = "true" +scsi0:0.fileName = "Debian1.vmdk" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.writeThrough = "true" + +scsi1:0.present = "true" +scsi1:0.fileName = "Debian1-cdrom.iso" +scsi1:0.deviceType = "cdrom-image" + +ide0:0.present = "true" +ide0:0.startConnected = "FALSE" +ide0:0.clientDevice = "FALSE" +ide0:0.deviceType = "cdrom-image" +ide0:0.fileName = "/vmimages/tools-isoimages/linux.iso" + +ide0:1.present = "true" +ide0:1.clientDevice = "FALSE" +ide0:1.deviceType = "atapi-cdrom" +ide0:1.startConnected = "true" +ide0:1.fileName = "/dev/scd0" + +ide1:1.present = "true" +ide1:1.startConnected = "true" +ide1:1.deviceType = "ata-hardDisk" +ide1:1.fileName = "Debian1-IDE.vmdk" + +floppy1.present = "true" +floppy1.startConnected = "false" +floppy1.clientDevice = "true" +floppy1.fileName = "/dev/fd0" + +floppy0.present = "true" +floppy0.startConnected = "false" +floppy0.clientDevice = "false" +floppy0.fileType = "device" +floppy0.fileName = "/dev/fd0" + +ethernet0.present = "true" +ethernet0.virtualDev = "vlance" +ethernet0.networkName = "VM Network" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0c:29:3c:98:3e" +ethernet0.generatedAddressOffset = "0" + +guestOSAltName = "Ubuntu Linux (64-bit)" +guestOS = "ubuntu-64" + +uuid.location = "56 4d cd 37 36 85 88 89-35 ea 71 9f c9 3c 98 3e" +uuid.bios = "56 4d cd 37 36 85 88 89-35 ea 71 9f c9 3c 98 3e" + +toolScripts.afterPowerOn = "true" +toolScripts.afterResume = "true" +toolScripts.beforeSuspend = "true" +toolScripts.beforePowerOff = "true" + + + +sched.swap.derivedName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Debian1/Debian1-04db0c59.vswp" + +tools.syncTime = "FALSE" +tools.remindInstall = "TRUE" + +checkpoint.vmState = "" + +numvcpus = "4" + +sched.cpu.max = "1104" +sched.cpu.units = "mhz" + +sched.cpu.min = "368" + +sched.cpu.affinity = "0,1,2,5,6,7" + +sched.mem.max = "118" diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml new file mode 100644 index 0000000000..62e8bb4ab4 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml @@ -0,0 +1,47 @@ + + virtDebian1 + 564dcd37-3685-8889-35ea-719fc93c983e + 1024000 + 120832 + 4 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.vmx b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.vmx new file mode 100644 index 0000000000..8727950a77 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.vmx @@ -0,0 +1,70 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" +floppy0.present = "true" +nvram = "Debian2.nvram" +deploymentPlatform = "windows" +virtualHW.productCompatibility = "hosted" +tools.upgrade.policy = "useGlobal" +powerType.powerOff = "default" +powerType.powerOn = "default" +powerType.suspend = "default" +powerType.reset = "default" + +displayName = "virtDebian2" +extendedConfigFile = "Debian2.vmxf" + +numvcpus = "2" +scsi0.present = "true" +scsi0.sharedBus = "none" +scsi0.virtualDev = "lsilogic" + +memsize = "1024" + +scsi0:0.present = "true" +scsi0:0.fileName = "Debian2.vmdk" +scsi0:0.deviceType = "scsi-hardDisk" + +ide0:0.present = "true" +ide0:0.clientDevice = "FALSE" +ide0:0.deviceType = "cdrom-image" +ide0:0.startConnected = "true" + +floppy0.startConnected = "false" +floppy0.clientDevice = "true" + +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.addressType = "generated" + +guestOSAltName = "Ubuntu Linux (64-bit)" +guestOS = "ubuntu-64" + +uuid.location = "56 4d b7 68 f3 32 42 ee-62 01 06 97 3c f5 c3 0c" +uuid.bios = "56 4d b7 68 f3 32 42 ee-62 01 06 97 3c f5 c3 0c" + +toolScripts.afterPowerOn = "true" +toolScripts.afterResume = "true" +toolScripts.beforeSuspend = "true" +toolScripts.beforePowerOff = "true" + +floppy0.fileName = "/dev/fd0" + +ide0:0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Isos/debian-testing-amd64-netinst.iso" + +scsi0:0.redo = "" +ethernet0.generatedAddress = "00:0c:29:f5:c3:0c" +tools.syncTime = "false" +sched.swap.derivedName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Debian2/Debian2-04db0c5a.vswp" +ethernet0.generatedAddressOffset = "0" +tools.remindInstall = "TRUE" + +sched.cpu.min = "0" +sched.cpu.units = "mhz" + +sched.cpu.affinity = "5,4,3,0" + +floppy1.present = "true" +floppy1.fileType = "file" +floppy1.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Debian2/dummy.flp" +floppy1.clientDevice = "FALSE" diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml new file mode 100644 index 0000000000..3f85cb429b --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml @@ -0,0 +1,33 @@ + + virtDebian2 + 564db768-f332-42ee-6201-06973cf5c30c + 1048576 + 1048576 + 2 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.vmx b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.vmx new file mode 100644 index 0000000000..6558fd3dfa --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.vmx @@ -0,0 +1,65 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" +floppy0.present = "false" +nvram = "virtMonServ1.nvram" +deploymentPlatform = "windows" +virtualHW.productCompatibility = "hosted" +tools.upgrade.policy = "useGlobal" +powerType.powerOff = "default" +powerType.powerOn = "default" +powerType.suspend = "default" +powerType.reset = "default" + +displayName = "virtMonServ1" +extendedConfigFile = "virtMonServ1.vmxf" + +scsi0.present = "true" +scsi0.sharedBus = "none" +scsi0.virtualDev = "lsilogic" +memsize = "512" +scsi0:0.present = "true" +scsi0:0.fileName = "virtMonServ1.vmdk" +scsi0:0.deviceType = "scsi-hardDisk" +ide0:0.present = "true" +ide0:0.clientDevice = "true" +ide0:0.deviceType = "cdrom-raw" +ide0:0.startConnected = "false" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.addressType = "vpx" +chipset.onlineStandby = "false" +guestOSAltName = "Ubuntu Linux (32-bit)" +guestOS = "ubuntu" +uuid.location = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +snapshot.action = "keep" +sched.cpu.min = "17666" +sched.cpu.max = "18034" +sched.cpu.units = "mhz" +sched.cpu.shares = "normal" +sched.mem.minsize = "0" +sched.mem.shares = "normal" +toolScripts.afterPowerOn = "true" +toolScripts.afterResume = "true" +toolScripts.beforeSuspend = "true" +toolScripts.beforePowerOff = "true" + +scsi0:0.redo = "" +ethernet0.generatedAddress = "00:50:56:91:66:d4" +tools.syncTime = "false" +sched.swap.derivedName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/virtMonServ1/virtMonServ1-66723d05.vswp" +ethernet0.generatedAddressOffset = "0" +tools.remindInstall = "TRUE" + +ethernet1.present = "true" +ethernet1.networkName = "VM Switch 2" +ethernet1.addressType = "vpx" +ethernet1.generatedAddress = "00:50:56:91:0c:51" +serial0.present = "true" +serial0.yieldOnMsrRead = "true" +serial0.fileType = "file" +serial0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/virtMonServ1/serial1.file" +parallel0.present = "true" +parallel0.fileType = "file" +parallel0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/virtMonServ1/parallel1.file" diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml new file mode 100644 index 0000000000..f539dced98 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml @@ -0,0 +1,41 @@ + + virtMonServ1 + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 524288 + 524288 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx new file mode 100644 index 0000000000..8b7a5b3bf3 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx @@ -0,0 +1,7 @@ +config.version = "8" +virtualHW.version = "4" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:11:22:33" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml new file mode 100644 index 0000000000..7ef2d3ded2 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx new file mode 100644 index 0000000000..bab8aa1784 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx @@ -0,0 +1,8 @@ +config.version = "8" +virtualHW.version = "4" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "custom" +ethernet0.vnet = "vmnet7" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:11:22:33" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-custom.xml b/tests/vmx2xmldata/vmx2xml-ethernet-custom.xml new file mode 100644 index 0000000000..e08a450c33 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-ethernet-custom.xml @@ -0,0 +1,20 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx new file mode 100644 index 0000000000..eb7c4844db --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx @@ -0,0 +1,8 @@ +config.version = "8" +virtualHW.version = "4" +ethernet0.present = "true" +ethernet0.virtualDev = "e1000" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:11:22:33" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml new file mode 100644 index 0000000000..1e64c52c5c --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml @@ -0,0 +1,20 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-floppy-device.vmx b/tests/vmx2xmldata/vmx2xml-floppy-device.vmx new file mode 100644 index 0000000000..6c6358d468 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-floppy-device.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +floppy0.present = "true" +floppy0.fileType = "device" +floppy0.fileName = "/dev/fd0" diff --git a/tests/vmx2xmldata/vmx2xml-floppy-device.xml b/tests/vmx2xmldata/vmx2xml-floppy-device.xml new file mode 100644 index 0000000000..3991f735c2 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-floppy-device.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-floppy-file.vmx b/tests/vmx2xmldata/vmx2xml-floppy-file.vmx new file mode 100644 index 0000000000..b9ee81baf4 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-floppy-file.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +floppy0.present = "true" +floppy0.fileType = "file" +floppy0.fileName = "floppy.flp" diff --git a/tests/vmx2xmldata/vmx2xml-floppy-file.xml b/tests/vmx2xmldata/vmx2xml-floppy-file.xml new file mode 100644 index 0000000000..03c782411c --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-floppy-file.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.vmx b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.vmx new file mode 100644 index 0000000000..cee137b8fd --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.vmx @@ -0,0 +1,54 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" + +displayName = "Server1" +guestOS = "other26xlinux" +nvram = "Debian-System1.nvram" +memsize = "32" +MemAllowAutoScaleDown = "FALSE" + + +scsi0.present = "TRUE" +scsi0.virtualDev = "lsilogic" + +ide0:0.redo = "" +ide0:0.present = "TRUE" +ide0:0.fileName = "Debian-System1-0-cl2.vmdk" +ide0:0.writeThrough = "FALSE" +ide0:0.mode = "independent-persistent" + +ide1:0.present = "FALSE" +ide1:0.fileName = "/dev/hda" +ide1:0.deviceType = "cdrom-raw" + +floppy0.fileName = "/dev/fd0" +floppy0.startConnected = "FALSE" +floppy0.present = "FALSE" + +ethernet0.present = "TRUE" +ethernet0.connectionType = "custom" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0c:29:d6:2b:d3" +ethernet0.generatedAddressOffset = "0" +ethernet0.startConnected = "TRUE" +ethernet0.pvnID = "52 f6 0b f2 77 27 eb 7b-a5 a0 16 7e a3 f0 57 aa" +ethernet0.vnet = "/dev/vmnet1" +ethernet0.networkName = "net1" + +usb.present = "TRUE" + +sound.startConnected = "FALSE" +sound.present = "FALSE" +sound.virtualDev = "es1371" + +uuid.action = "create" +uuid.location = "56 4d 12 23 f8 35 c4 b1-bb f6 e3 23 90 d6 2b d3" +uuid.bios = "56 4d 12 23 f8 35 c4 b1-bb f6 e3 23 90 d6 2b d3" + +tools.remindInstall = "TRUE" + + +checkpoint.vmState = "" + +workingDir = "" diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml new file mode 100644 index 0000000000..c1c2e05c7a --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml @@ -0,0 +1,25 @@ + + Server1 + 564d1223-f835-c4b1-bbf6-e32390d62bd3 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.vmx b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.vmx new file mode 100644 index 0000000000..111ed3062b --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.vmx @@ -0,0 +1,52 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" +scsi0.present = "TRUE" +scsi0.virtualDev = "lsilogic" +memsize = "32" +MemAllowAutoScaleDown = "FALSE" +ide0:0.present = "TRUE" +ide0:0.fileName = "Debian-System1-0-cl3.vmdk" +ide0:0.writeThrough = "FALSE" +ide1:0.present = "FALSE" +ide1:0.fileName = "/dev/hda" +ide1:0.deviceType = "cdrom-raw" +floppy0.fileName = "/dev/fd0" +ethernet0.present = "TRUE" +ethernet0.connectionType = "custom" +usb.present = "TRUE" +sound.present = "FALSE" +sound.virtualDev = "es1371" +displayName = "Server2" +guestOS = "other26xlinux" +nvram = "Server2.nvram" + +ide0:0.redo = "" +ethernet0.addressType = "generated" +uuid.location = "56 4d 33 01 26 7f a0 ef-8b 7d d4 5e 98 d6 cb a4" +uuid.bios = "56 4d 33 01 26 7f a0 ef-8b 7d d4 5e 98 d6 cb a4" +ethernet0.generatedAddress = "00:0c:29:d6:cb:a4" +ethernet0.generatedAddressOffset = "0" + +tools.remindInstall = "TRUE" + +ethernet0.startConnected = "TRUE" + +ethernet0.pvnID = "52 f6 0b f2 77 27 eb 7b-a5 a0 16 7e a3 f0 57 aa" + +floppy0.startConnected = "FALSE" + +ide0:0.mode = "independent-persistent" + +uuid.action = "create" + +sound.startConnected = "FALSE" + +checkpoint.vmState = "" +ethernet0.networkName = "net1" + +ethernet0.vnet = "/dev/vmnet1" + +floppy0.present = "FALSE" + +workingDir = "" diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml new file mode 100644 index 0000000000..d71dc16e5c --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml @@ -0,0 +1,25 @@ + + Server2 + 564d3301-267f-a0ef-8b7d-d45e98d6cba4 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.vmx b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.vmx new file mode 100644 index 0000000000..f7475ee7b6 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.vmx @@ -0,0 +1,59 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" +scsi0.present = "TRUE" +scsi0.virtualDev = "lsilogic" +memsize = "32" +MemAllowAutoScaleDown = "FALSE" +ide0:0.present = "TRUE" +ide0:0.fileName = "Debian-System1-0-cl1.vmdk" +ide0:0.writeThrough = "FALSE" +ide1:0.present = "FALSE" +ide1:0.fileName = "/dev/hda" +ide1:0.deviceType = "cdrom-raw" +floppy0.fileName = "/dev/fd0" +ethernet0.present = "TRUE" +ethernet0.connectionType = "custom" +usb.present = "TRUE" +sound.present = "FALSE" +sound.virtualDev = "es1371" +displayName = "Router" +guestOS = "other26xlinux" +nvram = "Debian-System3.nvram" + +ide0:0.redo = "" +ethernet0.addressType = "generated" +uuid.location = "56 4d de be e8 6f d5 86-08 54 a0 87 9c c4 be 5a" +uuid.bios = "56 4d de be e8 6f d5 86-08 54 a0 87 9c c4 be 5a" +ethernet0.generatedAddress = "00:0c:29:c4:be:5a" +ethernet0.generatedAddressOffset = "0" + +tools.remindInstall = "TRUE" + +ethernet0.pvnID = "52 f6 0b f2 77 27 eb 7b-a5 a0 16 7e a3 f0 57 aa" + +floppy0.startConnected = "FALSE" + +ethernet1.present = "TRUE" +ethernet1.connectionType = "custom" +ethernet1.pvnID = "52 e3 67 11 22 b9 90 a3-df 09 e3 9c c3 64 b1 22" + +ethernet1.addressType = "generated" +ethernet1.generatedAddress = "00:0c:29:c4:be:64" +ethernet1.generatedAddressOffset = "10" + +ide0:0.mode = "independent-persistent" + +sound.startConnected = "FALSE" + +ethernet0.networkName = "net1" +ethernet0.vnet = "/dev/vmnet1" + +ethernet1.vnet = "/dev/vmnet2" +ethernet1.networkName = "net2" + +checkpoint.vmState = "" + +floppy0.present = "FALSE" + +uuid.action = "create" diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml new file mode 100644 index 0000000000..370dd57fc1 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml @@ -0,0 +1,30 @@ + + Router + 564ddebe-e86f-d586-0854-a0879cc4be5a + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.vmx b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.vmx new file mode 100644 index 0000000000..5eae7151bc --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.vmx @@ -0,0 +1,54 @@ +#!/usr/bin/vmware +config.version = "8" +virtualHW.version = "4" +scsi0.present = "TRUE" +scsi0.virtualDev = "lsilogic" +memsize = "264" +MemAllowAutoScaleDown = "FALSE" +ide0:0.present = "TRUE" +ide0:0.fileName = "Debian-System1-0-cl2.vmdk" +ide0:0.writeThrough = "FALSE" +ide1:0.present = "FALSE" +ide1:0.fileName = "/dev/hda" +ide1:0.deviceType = "cdrom-raw" +floppy0.fileName = "/dev/fd0" +ethernet0.present = "TRUE" +ethernet0.connectionType = "custom" +usb.present = "TRUE" +sound.present = "FALSE" +sound.virtualDev = "es1371" +displayName = "Client" +guestOS = "other26xlinux" +nvram = "Debian-System4.nvram" + +ide0:0.redo = "" +ethernet0.addressType = "generated" +uuid.location = "56 4d ad 58 06 29 d3 e6-ec fe 8f f8 39 c5 e3 5d" +uuid.bios = "56 4d ad 58 06 29 d3 e6-ec fe 8f f8 39 c5 e3 5d" +ethernet0.generatedAddress = "00:0c:29:c5:e3:5d" +ethernet0.generatedAddressOffset = "0" + +tools.remindInstall = "TRUE" + +extendedConfigFile = "Debian-System4.vmxf" + +inVMTeam = "FALSE" + +ethernet0.startConnected = "TRUE" + +ethernet0.pvnID = "52 f9 2a ec 52 26 01 54-fe ab 09 d1 48 32 95 c5" + +floppy0.startConnected = "FALSE" + +ide0:0.mode = "independent-persistent" + +sound.startConnected = "FALSE" + +ethernet0.vnet = "/dev/vmnet2" +ethernet0.networkName = "net2" + +floppy0.present = "FALSE" + +usb.generic.autoconnect = "FALSE" + +uuid.action = "create" diff --git a/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml new file mode 100644 index 0000000000..3b01392058 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml @@ -0,0 +1,25 @@ + + Client + 564dad58-0629-d3e6-ecfe-8ff839c5e35d + 270336 + 270336 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx new file mode 100644 index 0000000000..a8c71f189b --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +ide0:0.present = "true" +ide0:0.deviceType = "ata-hardDisk" +ide0:0.fileName = "harddisk.vmdk" diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml new file mode 100644 index 0000000000..c507ea21e2 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx new file mode 100644 index 0000000000..933707c984 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx @@ -0,0 +1,6 @@ +config.version = "8" +virtualHW.version = "4" +scsi0.present = "true" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "harddisk.vmdk" diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml new file mode 100644 index 0000000000..6b8b4fc1d1 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx b/tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx new file mode 100644 index 0000000000..73d3972591 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx @@ -0,0 +1,3 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other-64" diff --git a/tests/vmx2xmldata/vmx2xml-minimal-64bit.xml b/tests/vmx2xmldata/vmx2xml-minimal-64bit.xml new file mode 100644 index 0000000000..cec8ba09b1 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-minimal-64bit.xml @@ -0,0 +1,15 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + diff --git a/tests/vmx2xmldata/vmx2xml-minimal.vmx b/tests/vmx2xmldata/vmx2xml-minimal.vmx new file mode 100644 index 0000000000..a8e5db3746 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-minimal.vmx @@ -0,0 +1,2 @@ +config.version = "8" +virtualHW.version = "4" diff --git a/tests/vmx2xmldata/vmx2xml-minimal.xml b/tests/vmx2xmldata/vmx2xml-minimal.xml new file mode 100644 index 0000000000..acfd9bd7d5 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-minimal.xml @@ -0,0 +1,15 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + diff --git a/tests/vmx2xmldata/vmx2xml-parallel-device.vmx b/tests/vmx2xmldata/vmx2xml-parallel-device.vmx new file mode 100644 index 0000000000..ee2eb749b6 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-parallel-device.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +parallel0.present = "true" +parallel0.fileType = "device" +parallel0.fileName = "/dev/parallel0" diff --git a/tests/vmx2xmldata/vmx2xml-parallel-device.xml b/tests/vmx2xmldata/vmx2xml-parallel-device.xml new file mode 100644 index 0000000000..28c23028d5 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-parallel-device.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-parallel-file.vmx b/tests/vmx2xmldata/vmx2xml-parallel-file.vmx new file mode 100644 index 0000000000..e91906a9d7 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-parallel-file.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +parallel0.present = "true" +parallel0.fileType = "file" +parallel0.fileName = "parallel0.file" diff --git a/tests/vmx2xmldata/vmx2xml-parallel-file.xml b/tests/vmx2xmldata/vmx2xml-parallel-file.xml new file mode 100644 index 0000000000..77c8119ec3 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-parallel-file.xml @@ -0,0 +1,19 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-scsi-buslogic.vmx b/tests/vmx2xmldata/vmx2xml-scsi-buslogic.vmx new file mode 100644 index 0000000000..1725051bee --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-scsi-buslogic.vmx @@ -0,0 +1,7 @@ +config.version = "8" +virtualHW.version = "4" +scsi0.present = "true" +scsi0.virtualDev = "buslogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "harddisk.vmdk" diff --git a/tests/vmx2xmldata/vmx2xml-scsi-buslogic.xml b/tests/vmx2xmldata/vmx2xml-scsi-buslogic.xml new file mode 100644 index 0000000000..2c12348b6a --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-scsi-buslogic.xml @@ -0,0 +1,20 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx new file mode 100644 index 0000000000..54ac49c914 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx @@ -0,0 +1,8 @@ +config.version = "8" +virtualHW.version = "4" +scsi0.present = "true" +scsi0.virtualDev = "buslogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "harddisk.vmdk" +scsi0:0.writeThrough = "true" diff --git a/tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml new file mode 100644 index 0000000000..3c3a8e0886 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml @@ -0,0 +1,20 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-serial-device.vmx b/tests/vmx2xmldata/vmx2xml-serial-device.vmx new file mode 100644 index 0000000000..8c101e311e --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-device.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +serial0.present = "true" +serial0.fileType = "device" +serial0.fileName = "/dev/ttyS0" diff --git a/tests/vmx2xmldata/vmx2xml-serial-device.xml b/tests/vmx2xmldata/vmx2xml-serial-device.xml new file mode 100644 index 0000000000..83e1ce93a8 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-device.xml @@ -0,0 +1,23 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-serial-file.vmx b/tests/vmx2xmldata/vmx2xml-serial-file.vmx new file mode 100644 index 0000000000..2c3bc39628 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-file.vmx @@ -0,0 +1,5 @@ +config.version = "8" +virtualHW.version = "4" +serial0.present = "true" +serial0.fileType = "file" +serial0.fileName = "serial0.file" diff --git a/tests/vmx2xmldata/vmx2xml-serial-file.xml b/tests/vmx2xmldata/vmx2xml-serial-file.xml new file mode 100644 index 0000000000..55b44c5b6e --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-file.xml @@ -0,0 +1,23 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx new file mode 100644 index 0000000000..f104aab099 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx @@ -0,0 +1,7 @@ +config.version = "8" +virtualHW.version = "4" +serial0.present = "true" +serial0.fileType = "pipe" +serial0.fileName = "serial0.pipe" +serial0.pipe.endPoint = "client" +serial0.tryNoRxLoss = "true" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx new file mode 100644 index 0000000000..3b487ee5e3 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx @@ -0,0 +1,6 @@ +config.version = "8" +virtualHW.version = "4" +serial0.present = "true" +serial0.fileType = "pipe" +serial0.fileName = "serial0.pipe" +serial0.pipe.endPoint = "client" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx new file mode 100644 index 0000000000..27ee3bc216 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx @@ -0,0 +1,7 @@ +config.version = "8" +virtualHW.version = "4" +serial0.present = "true" +serial0.fileType = "pipe" +serial0.fileName = "serial0.pipe" +serial0.pipe.endPoint = "server" +serial0.tryNoRxLoss = "true" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx new file mode 100644 index 0000000000..b99c627eb6 --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx @@ -0,0 +1,6 @@ +config.version = "8" +virtualHW.version = "4" +serial0.present = "true" +serial0.fileType = "pipe" +serial0.fileName = "serial0.pipe" +serial0.pipe.endPoint = "server" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe.xml b/tests/vmx2xmldata/vmx2xml-serial-pipe.xml new file mode 100644 index 0000000000..38e69a605e --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe.xml @@ -0,0 +1,23 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c new file mode 100644 index 0000000000..5c344d0d73 --- /dev/null +++ b/tests/vmx2xmltest.c @@ -0,0 +1,173 @@ +#include + +#ifdef WITH_ESX + +#include +#include +#include + +#include "internal.h" +#include "memory.h" +#include "testutils.h" +#include "esx/esx_vmx.h" + +static char *progname = NULL; +static char *abs_srcdir = NULL; + +#define MAX_FILE 4096 + +static int +testCompareFiles(const char *vmx, const char *xml, esxVI_APIVersion apiVersion) +{ + int result = -1; + char vmxData[MAX_FILE]; + char xmlData[MAX_FILE]; + char *formatted = NULL; + char *vmxPtr = &(vmxData[0]); + char *xmlPtr = &(xmlData[0]); + virDomainDefPtr def = NULL; + + if (virtTestLoadFile(vmx, &vmxPtr, MAX_FILE) < 0) { + goto failure; + } + + if (virtTestLoadFile(xml, &xmlPtr, MAX_FILE) < 0) { + goto failure; + } + + def = esxVMX_ParseConfig(NULL, vmxData, apiVersion); + + if (def == NULL) { + goto failure; + } + + formatted = virDomainDefFormat(NULL, def, 0); + + if (formatted == NULL) { + goto failure; + } + + if (STRNEQ(xmlData, formatted)) { + virtTestDifference(stderr, xmlData, formatted); + goto failure; + } + + result = 0; + + failure: + VIR_FREE(formatted); + virDomainDefFree(def); + + return result; +} + +struct testInfo { + const char *input; + const char *output; + esxVI_APIVersion version; +}; + +static int +testCompareHelper(const void *data) +{ + const struct testInfo *info = data; + char vmx[PATH_MAX]; + char xml[PATH_MAX]; + + snprintf(vmx, PATH_MAX, "%s/vmx2xmldata/vmx2xml-%s.vmx", abs_srcdir, + info->input); + snprintf(xml, PATH_MAX, "%s/vmx2xmldata/vmx2xml-%s.xml", abs_srcdir, + info->output); + + return testCompareFiles(vmx, xml, info->version); +} + +static int +mymain(int argc, char **argv) +{ + int result = 0; + char cwd[PATH_MAX]; + + progname = argv[0]; + + if (argc > 1) { + fprintf(stderr, "Usage: %s\n", progname); + return EXIT_FAILURE; + } + + abs_srcdir = getenv("abs_srcdir"); + + if (abs_srcdir == NULL) { + abs_srcdir = getcwd(cwd, sizeof(cwd)); + } + + if (argc > 1) { + fprintf(stderr, "Usage: %s\n", progname); + return EXIT_FAILURE; + } + + #define DO_TEST(_in, _out, _version) \ + do { \ + struct testInfo info = { _in, _out, _version }; \ + virResetLastError(); \ + if (virtTestRun("VMware VMX-2-XML "_in" -> "_out, 1, \ + testCompareHelper, &info) < 0) { \ + result = -1; \ + } \ + } while (0) + + DO_TEST("minimal", "minimal", esxVI_APIVersion_25); + DO_TEST("minimal-64bit", "minimal-64bit", esxVI_APIVersion_25); + + DO_TEST("scsi-buslogic", "scsi-buslogic", esxVI_APIVersion_25); + DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_APIVersion_25); + + DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_APIVersion_25); + DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_APIVersion_25); + + DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_APIVersion_25); + DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_APIVersion_25); + DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_APIVersion_25); + DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_APIVersion_25); + + DO_TEST("floppy-file", "floppy-file", esxVI_APIVersion_25); + DO_TEST("floppy-device", "floppy-device", esxVI_APIVersion_25); + + DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_APIVersion_25); + + DO_TEST("ethernet-custom", "ethernet-custom", esxVI_APIVersion_25); + DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_APIVersion_25); + + DO_TEST("serial-file", "serial-file", esxVI_APIVersion_25); + DO_TEST("serial-device", "serial-device", esxVI_APIVersion_25); + DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_APIVersion_25); + DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_APIVersion_25); + DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_APIVersion_25); + DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_APIVersion_25); + + DO_TEST("parallel-file", "parallel-file", esxVI_APIVersion_25); + DO_TEST("parallel-device", "parallel-device", esxVI_APIVersion_25); + + DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_APIVersion_25); + DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_APIVersion_25); + DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_APIVersion_25); + DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_APIVersion_25); + + DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_APIVersion_25); + DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_APIVersion_25); + DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_APIVersion_25); + DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_APIVersion_25); + + return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE; +} + +VIRT_TEST_MAIN(mymain) + +#else + +int main (void) +{ + return 77; /* means 'test skipped' for automake */ +} + +#endif /* WITH_ESX */ diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-ide-device.vmx b/tests/xml2vmxdata/xml2vmx-cdrom-ide-device.vmx new file mode 100644 index 0000000000..8712e1970d --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-ide-device.vmx @@ -0,0 +1,10 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "cdrom-ide-device" +memsize = "4" +numvcpus = "1" +ide0:0.present = "true" +ide0:0.deviceType = "atapi-cdrom" +ide0:0.fileName = "/dev/scd0" diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-ide-device.xml b/tests/xml2vmxdata/xml2vmx-cdrom-ide-device.xml new file mode 100644 index 0000000000..17199a945c --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-ide-device.xml @@ -0,0 +1,14 @@ + + cdrom-ide-device + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-ide-file.vmx b/tests/xml2vmxdata/xml2vmx-cdrom-ide-file.vmx new file mode 100644 index 0000000000..efcff55ee9 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-ide-file.vmx @@ -0,0 +1,10 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "cdrom-ide-file" +memsize = "4" +numvcpus = "1" +ide0:0.present = "true" +ide0:0.deviceType = "cdrom-image" +ide0:0.fileName = "cdrom.iso" diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml b/tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml new file mode 100644 index 0000000000..f54bced6df --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml @@ -0,0 +1,14 @@ + + cdrom-ide-file + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.vmx b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.vmx new file mode 100644 index 0000000000..5121c36f04 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.vmx @@ -0,0 +1,11 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "cdrom-scsi-device" +memsize = "4" +numvcpus = "1" +scsi0.present = "true" +scsi0:0.present = "true" +scsi0:0.deviceType = "atapi-cdrom" +scsi0:0.fileName = "/dev/scd0" diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.xml b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.xml new file mode 100644 index 0000000000..931e99d275 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-device.xml @@ -0,0 +1,14 @@ + + cdrom-scsi-device + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.vmx b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.vmx new file mode 100644 index 0000000000..29f2d41062 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.vmx @@ -0,0 +1,11 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "cdrom-scsi-file" +memsize = "4" +numvcpus = "1" +scsi0.present = "true" +scsi0:0.present = "true" +scsi0:0.deviceType = "cdrom-image" +scsi0:0.fileName = "cdrom.iso" diff --git a/tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml new file mode 100644 index 0000000000..0f21dcfab9 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml @@ -0,0 +1,14 @@ + + cdrom-scsi-file + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx new file mode 100644 index 0000000000..b9a18ef02d --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx @@ -0,0 +1,17 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10" +displayName = "Fedora11" +memsize = "1024" +numvcpus = "1" +scsi0.present = "true" +scsi0.virtualDev = "lsilogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "Fedora11.vmdk" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:91:48:C7" diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml new file mode 100644 index 0000000000..eb0e9ef973 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml @@ -0,0 +1,25 @@ + + Fedora11 + 50115e16-9bdc-49d7-f171-53c4d7f91710 + 1048576 + 1048576 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx new file mode 100644 index 0000000000..43714c182f --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx @@ -0,0 +1,38 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other-64" +uuid.bios = "56 4d cd 37 36 85 88 89-35 ea 71 9f c9 3c 98 3e" +displayName = "virtDebian1" +memsize = "1000" +sched.mem.max = "118" +numvcpus = "4" +sched.cpu.affinity = "0,1,2,5,6,7" +scsi0.present = "true" +scsi0.virtualDev = "lsilogic" +scsi1.present = "true" +scsi1.virtualDev = "buslogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "Debian1.vmdk" +scsi0:0.writeThrough = "true" +scsi1:0.present = "true" +scsi1:0.deviceType = "cdrom-image" +scsi1:0.fileName = "Debian1-cdrom.iso" +ide0:0.present = "true" +ide0:0.deviceType = "cdrom-image" +ide0:0.fileName = "/vmimages/tools-isoimages/linux.iso" +ide0:1.present = "true" +ide0:1.deviceType = "atapi-cdrom" +ide0:1.fileName = "/dev/scd0" +ide1:1.present = "true" +ide1:1.deviceType = "ata-hardDisk" +ide1:1.fileName = "Debian1-IDE.vmdk" +floppy0.present = "true" +floppy0.fileType = "device" +floppy0.fileName = "/dev/fd0" +ethernet0.present = "true" +ethernet0.virtualDev = "vlance" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0C:29:3C:98:3E" diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml new file mode 100644 index 0000000000..62e8bb4ab4 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml @@ -0,0 +1,47 @@ + + virtDebian1 + 564dcd37-3685-8889-35ea-719fc93c983e + 1024000 + 120832 + 4 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx new file mode 100644 index 0000000000..c0bc514b8a --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx @@ -0,0 +1,24 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other-64" +uuid.bios = "56 4d b7 68 f3 32 42 ee-62 01 06 97 3c f5 c3 0c" +displayName = "virtDebian2" +memsize = "1024" +numvcpus = "2" +sched.cpu.affinity = "0,3,4,5" +scsi0.present = "true" +scsi0.virtualDev = "lsilogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "Debian2.vmdk" +ide0:0.present = "true" +ide0:0.deviceType = "cdrom-image" +ide0:0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Isos/debian-testing-amd64-netinst.iso" +floppy1.present = "true" +floppy1.fileType = "file" +floppy1.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Debian2/dummy.flp" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0C:29:F5:C3:0C" diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml new file mode 100644 index 0000000000..3f85cb429b --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml @@ -0,0 +1,33 @@ + + virtDebian2 + 564db768-f332-42ee-6201-06973cf5c30c + 1048576 + 1048576 + 2 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx new file mode 100644 index 0000000000..8685bae583 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx @@ -0,0 +1,29 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "virtMonServ1" +memsize = "512" +numvcpus = "1" +scsi0.present = "true" +scsi0.virtualDev = "lsilogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "virtMonServ1.vmdk" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:91:66:D4" +ethernet1.present = "true" +ethernet1.networkName = "VM Switch 2" +ethernet1.connectionType = "bridged" +ethernet1.addressType = "static" +ethernet1.address = "00:50:56:91:0C:51" +serial0.present = "true" +serial0.fileType = "file" +serial0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/virtMonServ1/serial1.file" +serial0.yieldOnMsrRead = "true" +parallel0.present = "true" +parallel0.fileType = "file" +parallel0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/virtMonServ1/parallel1.file" diff --git a/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml new file mode 100644 index 0000000000..2b3ed93362 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml @@ -0,0 +1,41 @@ + + virtMonServ1 + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 524288 + 524288 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-bridged.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-bridged.vmx new file mode 100644 index 0000000000..7d9c6f7a6d --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-ethernet-bridged.vmx @@ -0,0 +1,12 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "ethernet-bridged" +memsize = "4" +numvcpus = "1" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:11:22:33" diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-bridged.xml b/tests/xml2vmxdata/xml2vmx-ethernet-bridged.xml new file mode 100644 index 0000000000..12a87885b6 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-ethernet-bridged.xml @@ -0,0 +1,14 @@ + + ethernet-bridged + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-custom.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-custom.vmx new file mode 100644 index 0000000000..fb4b116f3f --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-ethernet-custom.vmx @@ -0,0 +1,13 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "ethernet-custom" +memsize = "4" +numvcpus = "1" +ethernet0.present = "true" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "custom" +ethernet0.vnet = "vmnet7" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:11:22:33" diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-custom.xml b/tests/xml2vmxdata/xml2vmx-ethernet-custom.xml new file mode 100644 index 0000000000..cd1d88f41b --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-ethernet-custom.xml @@ -0,0 +1,15 @@ + + ethernet-custom + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-e1000.vmx b/tests/xml2vmxdata/xml2vmx-ethernet-e1000.vmx new file mode 100644 index 0000000000..3aed46cad4 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-ethernet-e1000.vmx @@ -0,0 +1,13 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "ethernet-e1000" +memsize = "4" +numvcpus = "1" +ethernet0.present = "true" +ethernet0.virtualDev = "e1000" +ethernet0.networkName = "VM Network" +ethernet0.connectionType = "bridged" +ethernet0.addressType = "static" +ethernet0.address = "00:50:56:11:22:33" diff --git a/tests/xml2vmxdata/xml2vmx-ethernet-e1000.xml b/tests/xml2vmxdata/xml2vmx-ethernet-e1000.xml new file mode 100644 index 0000000000..7e9536393b --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-ethernet-e1000.xml @@ -0,0 +1,15 @@ + + ethernet-e1000 + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-floppy-device.vmx b/tests/xml2vmxdata/xml2vmx-floppy-device.vmx new file mode 100644 index 0000000000..465501b06c --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-floppy-device.vmx @@ -0,0 +1,10 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "floppy-device" +memsize = "4" +numvcpus = "1" +floppy0.present = "true" +floppy0.fileType = "device" +floppy0.fileName = "/dev/fd0" diff --git a/tests/xml2vmxdata/xml2vmx-floppy-device.xml b/tests/xml2vmxdata/xml2vmx-floppy-device.xml new file mode 100644 index 0000000000..91bac26454 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-floppy-device.xml @@ -0,0 +1,14 @@ + + floppy-device + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-floppy-file.vmx b/tests/xml2vmxdata/xml2vmx-floppy-file.vmx new file mode 100644 index 0000000000..e3322392ab --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-floppy-file.vmx @@ -0,0 +1,10 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "floppy-file" +memsize = "4" +numvcpus = "1" +floppy0.present = "true" +floppy0.fileType = "file" +floppy0.fileName = "floppy.flp" diff --git a/tests/xml2vmxdata/xml2vmx-floppy-file.xml b/tests/xml2vmxdata/xml2vmx-floppy-file.xml new file mode 100644 index 0000000000..a069fda927 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-floppy-file.xml @@ -0,0 +1,14 @@ + + floppy-file + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx new file mode 100644 index 0000000000..a018d4f741 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx @@ -0,0 +1,16 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 12 23 f8 35 c4 b1-bb f6 e3 23 90 d6 2b d3" +displayName = "Server1" +memsize = "32" +numvcpus = "1" +ide0:0.present = "true" +ide0:0.deviceType = "ata-hardDisk" +ide0:0.fileName = "Debian-System1-0-cl2.vmdk" +ethernet0.present = "true" +ethernet0.networkName = "net1" +ethernet0.connectionType = "custom" +ethernet0.vnet = "/dev/vmnet1" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0C:29:D6:2B:D3" diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml new file mode 100644 index 0000000000..d2bc9641de --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml @@ -0,0 +1,25 @@ + + Server1 + 564d1223-f835-c4b1-bbf6-e32390d62bd3 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx new file mode 100644 index 0000000000..5c248a772f --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx @@ -0,0 +1,16 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 33 01 26 7f a0 ef-8b 7d d4 5e 98 d6 cb a4" +displayName = "Server2" +memsize = "32" +numvcpus = "1" +ide0:0.present = "true" +ide0:0.deviceType = "ata-hardDisk" +ide0:0.fileName = "Debian-System1-0-cl3.vmdk" +ethernet0.present = "true" +ethernet0.networkName = "net1" +ethernet0.connectionType = "custom" +ethernet0.vnet = "/dev/vmnet1" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0C:29:D6:CB:A4" diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml new file mode 100644 index 0000000000..1e1bab8fd5 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml @@ -0,0 +1,25 @@ + + Server2 + 564d3301-267f-a0ef-8b7d-d45e98d6cba4 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx new file mode 100644 index 0000000000..865ebfc805 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx @@ -0,0 +1,22 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d de be e8 6f d5 86-08 54 a0 87 9c c4 be 5a" +displayName = "Router" +memsize = "32" +numvcpus = "1" +ide0:0.present = "true" +ide0:0.deviceType = "ata-hardDisk" +ide0:0.fileName = "Debian-System1-0-cl1.vmdk" +ethernet0.present = "true" +ethernet0.networkName = "net1" +ethernet0.connectionType = "custom" +ethernet0.vnet = "/dev/vmnet1" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0C:29:C4:BE:5A" +ethernet1.present = "true" +ethernet1.networkName = "net2" +ethernet1.connectionType = "custom" +ethernet1.vnet = "/dev/vmnet2" +ethernet1.addressType = "generated" +ethernet1.generatedAddress = "00:0C:29:C4:BE:64" diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml new file mode 100644 index 0000000000..93ca7542b5 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml @@ -0,0 +1,30 @@ + + Router + 564ddebe-e86f-d586-0854-a0879cc4be5a + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx new file mode 100644 index 0000000000..947154cb92 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx @@ -0,0 +1,16 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d ad 58 06 29 d3 e6-ec fe 8f f8 39 c5 e3 5d" +displayName = "Client" +memsize = "264" +numvcpus = "1" +ide0:0.present = "true" +ide0:0.deviceType = "ata-hardDisk" +ide0:0.fileName = "Debian-System1-0-cl2.vmdk" +ethernet0.present = "true" +ethernet0.networkName = "net2" +ethernet0.connectionType = "custom" +ethernet0.vnet = "/dev/vmnet2" +ethernet0.addressType = "generated" +ethernet0.generatedAddress = "00:0C:29:C5:E3:5D" diff --git a/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml new file mode 100644 index 0000000000..99038838d5 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml @@ -0,0 +1,25 @@ + + Client + 564dad58-0629-d3e6-ecfe-8ff839c5e35d + 270336 + 270336 + 1 + + hvm + + + destroy + restart + destroy + + + + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-harddisk-ide-file.vmx b/tests/xml2vmxdata/xml2vmx-harddisk-ide-file.vmx new file mode 100644 index 0000000000..2ce1b12ac7 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-harddisk-ide-file.vmx @@ -0,0 +1,10 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "harddisk-ide-file" +memsize = "4" +numvcpus = "1" +ide0:0.present = "true" +ide0:0.deviceType = "ata-hardDisk" +ide0:0.fileName = "harddisk.vmdk" diff --git a/tests/xml2vmxdata/xml2vmx-harddisk-ide-file.xml b/tests/xml2vmxdata/xml2vmx-harddisk-ide-file.xml new file mode 100644 index 0000000000..147a7e2fa0 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-harddisk-ide-file.xml @@ -0,0 +1,14 @@ + + harddisk-ide-file + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.vmx b/tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.vmx new file mode 100644 index 0000000000..38ca686be9 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.vmx @@ -0,0 +1,11 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "harddisk-scsi-file" +memsize = "4" +numvcpus = "1" +scsi0.present = "true" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "harddisk.vmdk" diff --git a/tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.xml b/tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.xml new file mode 100644 index 0000000000..38eb26d073 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-harddisk-scsi-file.xml @@ -0,0 +1,14 @@ + + harddisk-scsi-file + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-minimal-64bit.vmx b/tests/xml2vmxdata/xml2vmx-minimal-64bit.vmx new file mode 100644 index 0000000000..87de002e3e --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-minimal-64bit.vmx @@ -0,0 +1,7 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other-64" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "minimal-64bit" +memsize = "4" +numvcpus = "1" diff --git a/tests/xml2vmxdata/xml2vmx-minimal-64bit.xml b/tests/xml2vmxdata/xml2vmx-minimal-64bit.xml new file mode 100644 index 0000000000..42ef4ca5a8 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-minimal-64bit.xml @@ -0,0 +1,8 @@ + + minimal-64bit + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + diff --git a/tests/xml2vmxdata/xml2vmx-minimal.vmx b/tests/xml2vmxdata/xml2vmx-minimal.vmx new file mode 100644 index 0000000000..08cc83f85d --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-minimal.vmx @@ -0,0 +1,7 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "minimal" +memsize = "4" +numvcpus = "1" diff --git a/tests/xml2vmxdata/xml2vmx-minimal.xml b/tests/xml2vmxdata/xml2vmx-minimal.xml new file mode 100644 index 0000000000..8e4e988a35 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-minimal.xml @@ -0,0 +1,8 @@ + + minimal + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + diff --git a/tests/xml2vmxdata/xml2vmx-parallel-device.vmx b/tests/xml2vmxdata/xml2vmx-parallel-device.vmx new file mode 100644 index 0000000000..9294279ec0 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-parallel-device.vmx @@ -0,0 +1,10 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "parallel-device" +memsize = "4" +numvcpus = "1" +parallel0.present = "true" +parallel0.fileType = "device" +parallel0.fileName = "/dev/parallel0" diff --git a/tests/xml2vmxdata/xml2vmx-parallel-device.xml b/tests/xml2vmxdata/xml2vmx-parallel-device.xml new file mode 100644 index 0000000000..2ddfb35dfa --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-parallel-device.xml @@ -0,0 +1,14 @@ + + parallel-device + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-parallel-file.vmx b/tests/xml2vmxdata/xml2vmx-parallel-file.vmx new file mode 100644 index 0000000000..4f42d26c20 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-parallel-file.vmx @@ -0,0 +1,10 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "parallel-file" +memsize = "4" +numvcpus = "1" +parallel0.present = "true" +parallel0.fileType = "file" +parallel0.fileName = "parallel0.file" diff --git a/tests/xml2vmxdata/xml2vmx-parallel-file.xml b/tests/xml2vmxdata/xml2vmx-parallel-file.xml new file mode 100644 index 0000000000..2c81cedaa5 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-parallel-file.xml @@ -0,0 +1,14 @@ + + parallel-file + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-scsi-buslogic.vmx b/tests/xml2vmxdata/xml2vmx-scsi-buslogic.vmx new file mode 100644 index 0000000000..de5da89c73 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-scsi-buslogic.vmx @@ -0,0 +1,12 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "scsi-buslogic" +memsize = "4" +numvcpus = "1" +scsi0.present = "true" +scsi0.virtualDev = "buslogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "harddisk.vmdk" diff --git a/tests/xml2vmxdata/xml2vmx-scsi-buslogic.xml b/tests/xml2vmxdata/xml2vmx-scsi-buslogic.xml new file mode 100644 index 0000000000..cd72df1fc4 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-scsi-buslogic.xml @@ -0,0 +1,15 @@ + + scsi-buslogic + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-scsi-writethrough.vmx b/tests/xml2vmxdata/xml2vmx-scsi-writethrough.vmx new file mode 100644 index 0000000000..feb577bb7d --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-scsi-writethrough.vmx @@ -0,0 +1,13 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "scsi-writethrough" +memsize = "4" +numvcpus = "1" +scsi0.present = "true" +scsi0.virtualDev = "buslogic" +scsi0:0.present = "true" +scsi0:0.deviceType = "scsi-hardDisk" +scsi0:0.fileName = "harddisk.vmdk" +scsi0:0.writeThrough = "true" diff --git a/tests/xml2vmxdata/xml2vmx-scsi-writethrough.xml b/tests/xml2vmxdata/xml2vmx-scsi-writethrough.xml new file mode 100644 index 0000000000..90a771973f --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-scsi-writethrough.xml @@ -0,0 +1,15 @@ + + scsi-writethrough + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-serial-device.vmx b/tests/xml2vmxdata/xml2vmx-serial-device.vmx new file mode 100644 index 0000000000..32cb175589 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-serial-device.vmx @@ -0,0 +1,11 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "serial-device" +memsize = "4" +numvcpus = "1" +serial0.present = "true" +serial0.fileType = "device" +serial0.fileName = "/dev/ttyS0" +serial0.yieldOnMsrRead = "true" diff --git a/tests/xml2vmxdata/xml2vmx-serial-device.xml b/tests/xml2vmxdata/xml2vmx-serial-device.xml new file mode 100644 index 0000000000..050eff7f4c --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-serial-device.xml @@ -0,0 +1,14 @@ + + serial-device + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-serial-file.vmx b/tests/xml2vmxdata/xml2vmx-serial-file.vmx new file mode 100644 index 0000000000..481e054afb --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-serial-file.vmx @@ -0,0 +1,11 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "serial-file" +memsize = "4" +numvcpus = "1" +serial0.present = "true" +serial0.fileType = "file" +serial0.fileName = "serial0.file" +serial0.yieldOnMsrRead = "true" diff --git a/tests/xml2vmxdata/xml2vmx-serial-file.xml b/tests/xml2vmxdata/xml2vmx-serial-file.xml new file mode 100644 index 0000000000..6fc8eaccc6 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-serial-file.xml @@ -0,0 +1,14 @@ + + serial-file + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxdata/xml2vmx-serial-pipe.vmx b/tests/xml2vmxdata/xml2vmx-serial-pipe.vmx new file mode 100644 index 0000000000..b177e14e4f --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-serial-pipe.vmx @@ -0,0 +1,13 @@ +config.version = "8" +virtualHW.version = "4" +guestOS = "other" +uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName = "serial-pipe" +memsize = "4" +numvcpus = "1" +serial0.present = "true" +serial0.fileType = "pipe" +serial0.pipe.endPoint = "client" +serial0.tryNoRxLoss = "false" +serial0.fileName = "serial0.pipe" +serial0.yieldOnMsrRead = "true" diff --git a/tests/xml2vmxdata/xml2vmx-serial-pipe.xml b/tests/xml2vmxdata/xml2vmx-serial-pipe.xml new file mode 100644 index 0000000000..9a6db530fc --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-serial-pipe.xml @@ -0,0 +1,14 @@ + + serial-pipe + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + + + + + + + diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c new file mode 100644 index 0000000000..df0a4a6b8f --- /dev/null +++ b/tests/xml2vmxtest.c @@ -0,0 +1,226 @@ +#include + +#ifdef WITH_ESX + +#include +#include +#include + +#include "internal.h" +#include "memory.h" +#include "testutils.h" +#include "esx/esx_vmx.h" + +static char *progname = NULL; +static char *abs_srcdir = NULL; +static virCapsPtr caps = NULL; + +#define MAX_FILE 4096 + +static void +testESXCapsInit(void) +{ + virCapsGuestPtr guest = NULL; + + caps = virCapabilitiesNew("i686", 1, 1); + + if (caps == NULL) { + return; + } + + virCapabilitiesSetMacPrefix(caps, (unsigned char[]){ 0x00, 0x50, 0x56 }); + virCapabilitiesAddHostMigrateTransport(caps, "esx"); + + /* i686 guest */ + guest = + virCapabilitiesAddGuest(caps, "hvm", "i686", 32, NULL, NULL, 0, NULL); + + if (guest == NULL) { + goto failure; + } + + if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0, + NULL) == NULL) { + goto failure; + } + + /* x86_64 guest */ + guest = + virCapabilitiesAddGuest(caps, "hvm", "x86_64", 64, NULL, NULL, 0, NULL); + + if (guest == NULL) { + goto failure; + } + + if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0, + NULL) == NULL) { + goto failure; + } + + return; + + failure: + virCapabilitiesFree(caps); + caps = NULL; +} + +static int +testCompareFiles(const char *xml, const char *vmx, esxVI_APIVersion apiVersion) +{ + int result = -1; + char xmlData[MAX_FILE]; + char vmxData[MAX_FILE]; + char *formatted = NULL; + char *xmlPtr = &(xmlData[0]); + char *vmxPtr = &(vmxData[0]); + virDomainDefPtr def = NULL; + + if (virtTestLoadFile(xml, &xmlPtr, MAX_FILE) < 0) { + goto failure; + } + + if (virtTestLoadFile(vmx, &vmxPtr, MAX_FILE) < 0) { + goto failure; + } + + def = virDomainDefParseString(NULL, caps, xmlData, VIR_DOMAIN_XML_INACTIVE); + + if (def == NULL) { + goto failure; + } + + formatted = esxVMX_FormatConfig(NULL, def, apiVersion); + + if (formatted == NULL) { + goto failure; + } + + if (STRNEQ(vmxData, formatted)) { + virtTestDifference(stderr, vmxData, formatted); + goto failure; + } + + result = 0; + + failure: + VIR_FREE(formatted); + virDomainDefFree(def); + + return result; +} + +struct testInfo { + const char *input; + const char *output; + esxVI_APIVersion version; +}; + +static int +testCompareHelper(const void *data) +{ + const struct testInfo *info = data; + char xml[PATH_MAX]; + char vmx[PATH_MAX]; + + snprintf(xml, PATH_MAX, "%s/xml2vmxdata/xml2vmx-%s.xml", abs_srcdir, + info->input); + snprintf(vmx, PATH_MAX, "%s/xml2vmxdata/xml2vmx-%s.vmx", abs_srcdir, + info->output); + + return testCompareFiles(xml, vmx, info->version); +} + +static int +mymain(int argc, char **argv) +{ + int result = 0; + char cwd[PATH_MAX]; + + progname = argv[0]; + + if (argc > 1) { + fprintf(stderr, "Usage: %s\n", progname); + return EXIT_FAILURE; + } + + abs_srcdir = getenv("abs_srcdir"); + + if (abs_srcdir == NULL) { + abs_srcdir = getcwd(cwd, sizeof(cwd)); + } + + if (argc > 1) { + fprintf(stderr, "Usage: %s\n", progname); + return EXIT_FAILURE; + } + + #define DO_TEST(_in, _out, _version) \ + do { \ + struct testInfo info = { _in, _out, _version }; \ + virResetLastError(); \ + if (virtTestRun("VMware XML-2-VMX "_in" -> "_out, 1, \ + testCompareHelper, &info) < 0) { \ + result = -1; \ + } \ + } while (0) + + testESXCapsInit(); + + if (caps == NULL) { + return EXIT_FAILURE; + } + + DO_TEST("minimal", "minimal", esxVI_APIVersion_25); + DO_TEST("minimal-64bit", "minimal-64bit", esxVI_APIVersion_25); + + DO_TEST("scsi-buslogic", "scsi-buslogic", esxVI_APIVersion_25); + DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_APIVersion_25); + + DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_APIVersion_25); + DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_APIVersion_25); + + DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_APIVersion_25); + DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_APIVersion_25); + DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_APIVersion_25); + DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_APIVersion_25); + + DO_TEST("floppy-file", "floppy-file", esxVI_APIVersion_25); + DO_TEST("floppy-device", "floppy-device", esxVI_APIVersion_25); + + DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_APIVersion_25); + + DO_TEST("ethernet-custom", "ethernet-custom", esxVI_APIVersion_25); + DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_APIVersion_25); + + DO_TEST("serial-file", "serial-file", esxVI_APIVersion_25); + DO_TEST("serial-device", "serial-device", esxVI_APIVersion_25); + DO_TEST("serial-pipe", "serial-pipe", esxVI_APIVersion_25); + + DO_TEST("parallel-file", "parallel-file", esxVI_APIVersion_25); + DO_TEST("parallel-device", "parallel-device", esxVI_APIVersion_25); + + DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_APIVersion_25); + DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_APIVersion_25); + DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_APIVersion_25); + DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_APIVersion_25); + + DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_APIVersion_25); + DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_APIVersion_25); + DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_APIVersion_25); + DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_APIVersion_25); + + virCapabilitiesFree(caps); + + return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE; +} + +VIRT_TEST_MAIN(mymain) + +#else + +int main (void) +{ + return 77; /* means 'test skipped' for automake */ +} + +#endif /* WITH_ESX */