summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* build: properly skip testsEric Blake2011-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | I got this failure on FreeBSD: shunloadtest.c: In function 'main': shunloadtest.c:150: error: 'EXIT_AM_SKIP' undeclared (first use in this function) but inspection showed several other problems, all fixed here. * tests/domainsnapshotxml2xmltest.c [!WITH_QEMU]: Ensure EXIT_AM_SKIP is defined. * tests/esxutilstest.c [!WITH_ESX]: Likewise. * tests/openvzutilstest.c [!WITH_OPENVZ]: Likewise. * tests/qemuargv2xmltest.c [!WITH_QEMU]: Likewise. * tests/qemuhelptest.c [!WITH_QEMU]: Likewise. * tests/qemuxml2argvtest.c [!WITH_QEMU]: Likewise. * tests/qemuxml2xmltest.c [!WITH_QEMU]: Likewise. * tests/qemuxmlnstest.c [!WITH_QEMU]: Likewise. * tests/shunloadtest.c [!linux]: Likewise. * tests/vmx2xmltest.c [!WITH_VMX]: Likewise. * tests/xml2vmxtest.c [!WITH_VMX]: Likewise.
* tests: Use EXIT_AM_SKIP instead of 77 directlyMatthias Bolte2011-07-091-2/+2
|
* tests: Add a general util testMatthias Bolte2011-07-011-70/+0
| | | | | Move non-esx specific tests from esxutilstest there and add a test for virParseVersionString.
* time_t is not a long on FreeBSD, switch internal type to long longMatthias Bolte2011-05-251-2/+2
|
* tests: Lower stack usage below 4096 bytesMatthias Bolte2011-04-301-0/+2
| | | | | | | | | Make virtTestLoadFile allocate the buffer to read the file into. Fix logic error in virtTestLoadFile, stop reading on the first empty line. Use virFileReadLimFD in virtTestCaptureProgramOutput to avoid manual buffer handling.
* tests: simplify common setupEric Blake2011-04-291-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few of the tests were missing basic sanity checks, while most of them were doing copy-and-paste initialization (in fact, some of them pasted the argc > 1 check more than once!). It's much nicer to do things in one common place, and minimizes the size of the next patch that fixes getcwd usage. * tests/testutils.h (EXIT_AM_HARDFAIL): New define. (progname, abs_srcdir): Define for all tests. (VIRT_TEST_MAIN): Change callback signature. * tests/testutils.c (virtTestMain): Do more common init. * tests/commandtest.c (mymain): Simplify. * tests/cputest.c (mymain): Likewise. * tests/esxutilstest.c (mymain): Likewise. * tests/eventtest.c (mymain): Likewise. * tests/hashtest.c (mymain): Likewise. * tests/networkxml2xmltest.c (mymain): Likewise. * tests/nodedevxml2xmltest.c (myname): Likewise. * tests/nodeinfotest.c (mymain): Likewise. * tests/nwfilterxml2xmltest.c (mymain): Likewise. * tests/qemuargv2xmltest.c (mymain): Likewise. * tests/qemuhelptest.c (mymain): Likewise. * tests/qemuxml2argvtest.c (mymain): Likewise. * tests/qemuxml2xmltest.c (mymain): Likewise. * tests/qparamtest.c (mymain): Likewise. * tests/sexpr2xmltest.c (mymain): Likewise. * tests/sockettest.c (mymain): Likewise. * tests/statstest.c (mymain): Likewise. * tests/storagepoolxml2xmltest.c (mymain): Likewise. * tests/storagevolxml2xmltest.c (mymain): Likewise. * tests/virbuftest.c (mymain): Likewise. * tests/virshtest.c (mymain): Likewise. * tests/vmx2xmltest.c (mymain): Likewise. * tests/xencapstest.c (mymain): Likewise. * tests/xmconfigtest.c (mymain): Likewise. * tests/xml2sexprtest.c (mymain): Likewise. * tests/xml2vmxtest.c (mymain): Likewise.
* esx: Move VMX handling code out of the driver directoryMatthias Bolte2010-12-211-2/+3
| | | | | | | | | | | Now the VMware driver doesn't depend on the ESX driver anymore. Add a WITH_VMX option that depends on WITH_ESX and WITH_VMWARE. Also add a libvirt_vmx.syms file. Move some escaping functions from esx_util.c to vmx.c. Adapt the test suite, ESX and VMware driver to the new code layout.
* esx: Handle non-UTF-8 encoded VMX filesMatthias Bolte2010-10-191-0/+42
| | | | | | | | ESX(i) uses UTF-8, but a Windows based GSX server writes Windows-1252 encoded VMX files. Add a test case to ensure that libxml2 provides Windows-1252 to UTF-8 conversion.
* esx: Handle name escaping properlyMatthias Bolte2010-10-141-0/+54
| | | | | | | VMware uses a mix of percent-, pipe- and base64-encoding in different combinations in different places. Add a testcase for this.
* esx: Rework datastore path parsing and handlingMatthias Bolte2010-09-031-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of splitting the path part of a datastore path into directory and file name, keep this in one piece. An example: "[datastore] directory/file" was split into this before: datastoreName = "datastore" directoryName = "directory" fileName = "file" Now it's split into this: datastoreName = "datastore" directoryName = "directory" directoryAndFileName = "directory/file" This simplifies code using esxUtil_ParseDatastorePath, because directoryAndFileName is used more often than fileName. Also the old approach expected the datastore path to reference an actual file, but this isn't always correct, especially when listing volumes. In that case esxUtil_ParseDatastorePath is used to parse a path that references a directory. This fails for a vpx:// connection because the vCenter returns directory paths with a trailing '/'. The new approach is robust against this and the actual decision if the datastore path should reference a file or a directory is up to the caller of esxUtil_ParseDatastorePath. Update the tests accordingly.
* esx: Make storage pool lookup by name and UUID more robustMatthias Bolte2010-08-021-7/+7
| | | | | | | | | | Don't rely on summary.url anymore, because its value is different between an esx:// and vpx:// connection. Use host.mountInfo.path instead. Don't fallback to lookup by UUID (actually lookup by absolute path) in esxVI_LookupDatastoreByName when lookup by name fails. Add a seperate function for this: esxVI_LookupDatastoreByAbsolutePath
* esx: Add domain snapshot supportMatthias Bolte2010-04-081-0/+60
| | | | | | | | | | Fix invalid code generating in esx_vi_generator.py regarding deep copy types that contain enum properties. Add strptime and timegm to bootstrap.conf. Both are used to convert a xsd:dateTime to calendar time. Add a testcase of the xsd:dateTime conversion.
* build: consistently indent preprocessor directivesEric Blake2010-03-091-9/+9
| | | | | | | * global: patch created by running: for f in $(git ls-files '*.[ch]') ; do cppi $f > $f.t && mv $f.t $f done
* esx: Stop passing around virConnectPtr for error reportingMatthias Bolte2010-01-261-2/+1
|
* Make test suite output less verboseDaniel P. Berrange2010-01-151-1/+1
| | | | | | | | | | | | | | | | | Only print out '.' for each test case, full test output can be re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX Sample output now looks like TEST: statstest ........................................ 40 ................................... 75 OK PASS: statstest TEST: qparamtest ................................ 32 OK PASS: qparamtest TEST: ............ 12 OK
* Add virIndexToDiskName and fix mapping gapMatthias Bolte2009-12-031-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | esxVMX_IndexToDiskName handles indices up to 701. This limit comes from a mapping gap in virDiskNameToIndex: sdzy -> 700 sdzz -> 701 sdaaa -> 728 sdaab -> 729 This line in virDiskNameToIndex causes this gap: idx = (idx + i) * 26; Fixing it by altering this line to: idx = (idx + (i < 1 ? 0 : 1)) * 26; Also add a new version of virIndexToDiskName that handles the inverse mapping for arbitrary indices. * src/esx/esx_vmx.[ch]: remove esxVMX_IndexToDiskName * src/util/util.[ch]: add virIndexToDiskName and fix mapping gap * tests/esxutilstest.c: update test to verify that the gap is fixed
* ESX add esxDomainDefineXML()Matthias Bolte2009-09-231-9/+97
| | | | | | | | | | | | | | | | | | | | | | | | A given domain XML gets converted to a VMX config, uploaded to the host and registered as new virtual machine. * src/esx/esx_driver.c: refactor datastore related path parsing into esxUtil_ParseDatastoreRelatedPath() * src/esx/esx_util.[ch]: add esxUtil_ParseDatastoreRelatedPath() * src/esx/esx_vi.[ch]: add esxVI_Context_UploadFile(), add datastores to the traversal in esxVI_BuildFullTraversalSpecList(), add esxVI_LookupDatastoreByName() * src/esx/esx_vi_methods.[ch]: add esxVI_RegisterVM_Task() * src/esx/esx_vi_types.c: make some error message more verbose * src/esx/esx_vmx.[ch]: add esxVMX_AbsolutePathToDatastoreRelatedPath() to convert a path into a datastore related path, add esxVMX_ParseFileName() to convert from VMX path format to domain XML path format, extend the other parsing function to be datastore aware, add esxVMX_FormatFileName() to convert from domain XML path format to VMX path format, fix VMX ethernet entry formating * tests/esxutilstest.c: add test for esxUtil_ParseDatastoreRelatedPath() * tests/vmx2xmldata/*: update domain XML files to use datastore related paths * tests/xml2vmxdata/*: update domain XML files to use datastore related paths, update VMX files to use absolute paths
* ESX add tests for the VMX to/from domain XML mappingMatthias Bolte2009-09-231-0/+99
* 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