aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* maint: fix up copyright notice inconsistenciesEric Blake2012-09-201-1/+1
| | | | | | | | | https://www.gnu.org/licenses/gpl-howto.html recommends that the 'If not, see <url>.' phrase be a separate sentence. * tests/securityselinuxhelper.c: Remove doubled line. * tests/securityselinuxtest.c: Likewise. * globally: s/; If/. If/
* Add test case for SELinux label generationDaniel P. Berrange2012-08-211-0/+16
| | | | | | | | | | | | This test case validates the correct generation of SELinux labels for VMs, wrt the current process label. Since we can't actually change the label of the test program process, we create a shared library libsecurityselinuxhelper.so which overrides the getcon() and setcon() libselinux.so functions. When started the test case will check to see if LD_PRELOAD is set, and if not, it will re-exec() itself setting LD_PRELOAD=libsecurityselinuxhelper.so Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* maint: Use consistent copyright.Osier Yang2012-07-271-1/+13
| | | | | | | | | | | | | | | | | | | | | This is a follow up patch of commit f9ce7dad6, it modifies all the files which declare the copyright like "See COPYING.LIB for the License of this software" to use the detailed/consistent one. And deserts the outdated comments like: * libvirt-qemu.h: * Summary: qemu specific interfaces * Description: Provides the interfaces of the libvirt library to handle * qemu specific methods * * Copy: Copyright (C) 2010, 2012 Red Hat, Inc. Uses the more compact style like: * libvirt-qemu.h: Interfaces specific for QEMU/KVM driver * * Copyright (C) 2010, 2012 Red Hat, Inc.
* Fix format specifiers in test cases on Win32Daniel P. Berrange2012-04-041-1/+2
| | | | | | | | | | | | | | | | | | Some of the test suites use fprintf with format specifiers that are not supported on Win32 and are not fixed by gnulib. The mingw32 compiler also has trouble detecting ssize_t correctly, complaining that 'ssize_t' does not match 'signed size_t' (which it expects for %zd). Force the cast to size_t to avoid this problem * tests/testutils.c, tests/testutils.h: Fix printf annotation on virTestResult. Use virVasprintf instead of vfprintf * tests/virhashtest.c: Use VIR_WARN instead of fprintf(stderr). Cast to size_t to avoid mingw32 compiler bug Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* build: expand rule to cover testsuiteEric Blake2012-02-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was done with: sed -i 's/\(\bfree *(/VIR_FREE(/g' tests/*.c followed by fixing the few compile errors that resulted. * cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation): Remove tests from exemption. * tests/testutils.h: Add common header. * tests/commandhelper.c: Fix offenders. * tests/cputest.c: Likewise. * tests/domainsnapshotxml2xmltest.c: Likewise. * tests/interfacexml2xmltest.c: Likewise. * tests/networkxml2argvtest.c: Likewise. * tests/networkxml2xmltest.c: Likewise. * tests/nodedevxml2xmltest.c: Likewise. * tests/nodeinfotest.c: Likewise. * tests/nwfilterxml2xmltest.c: Likewise. * tests/qemuargv2xmltest.c: Likewise. * tests/qemuxml2argvtest.c: Likewise. * tests/qemuxml2xmltest.c: Likewise. * tests/qemuxmlnstest.c: Likewise. * tests/qparamtest.c: Likewise. * tests/sexpr2xmltest.c: Likewise. * tests/storagepoolxml2xmltest.c: Likewise. * tests/storagevolxml2xmltest.c: Likewise. * tests/testutils.c: Likewise. * tests/virshtest.c: Likewise. * tests/xencapstest.c: Likewise. * tests/xmconfigtest.c: Likewise. * tests/xml2sexprtest.c: Likewise.
* Provide a simple object for encoding/decoding RPC messagesDaniel P. Berrange2011-06-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a new struct that contains a buffer for the RPC message header+payload, as well as a decoded copy of the message header. There is an API for applying a XDR encoding & decoding of the message headers and payloads. There are also APIs for maintaining a simple FIFO queue of message instances. Expected usage scenarios are: To send a message msg = virNetMessageNew() ...fill in msg->header fields.. virNetMessageEncodeHeader(msg) ...loook at msg->header fields to determine payload filter virNetMessageEncodePayload(msg, xdrfilter, data) ...send msg->bufferLength worth of data from buffer To receive a message msg = virNetMessageNew() ...read VIR_NET_MESSAGE_LEN_MAX of data into buffer virNetMessageDecodeLength(msg) ...read msg->bufferLength-msg->bufferOffset of data into buffer virNetMessageDecodeHeader(msg) ...look at msg->header fields to determine payload filter virNetMessageDecodePayload(msg, xdrfilter, data) ...run payload processor * src/Makefile.am: Add to libvirt-net-rpc.la * src/rpc/virnetmessage.c, src/rpc/virnetmessage.h: Internal message handling API. * testutils.c, testutils.h: Helper for printing binary differences * virnetmessagetest.c: Validate all XDR encoding/decoding
* tests: Lower stack usage below 4096 bytesMatthias Bolte2011-04-301-6/+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-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* tests: silence qemuargv2xmltest noiseEric Blake2010-09-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, the testsuite was noisy: TEST: qemuargv2xmltest ........................................ 40 ................20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument '-unknown', adding to the qemu namespace 20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument 'parameter', adding to the qemu namespace . 57 OK PASS: qemuargv2xmltest It's not a real failure (which is why the test was completing successfully), so much as an intentional warning to the user that use of the qemu namespace has the potential for undefined effects that leaked through the default logging behavior. After this patch series, all tests can access any logged data, and this particular test can explicitly check for the presence or absence of the warning, such that the test output becomes: TEST: qemuargv2xmltest ........................................ 40 ................. 57 OK PASS: qemuargv2xmltest * tests/testutils.h (virtTestLogContentAndReset): New prototype. * tests/testutils.c (struct virtTestLogData): New struct. (virtTestLogOutput, virtTestLogClose, virtTestLogContentAndReset): New functions. (virtTestMain): Always capture log data emitted during tests. * tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain): Use flag to mark which tests expect noisy stderr. (testCompareXMLToArgvFiles): Add parameter to test whether stderr was appropriately silent.
* build: consistently indent preprocessor directivesEric Blake2010-03-091-4/+4
| | | | | | | * global: patch created by running: for f in $(git ls-files '*.[ch]') ; do cppi $f > $f.t && mv $f.t $f done
* Make test suite output less verboseDaniel P. Berrange2010-01-151-1/+3
| | | | | | | | | | | | | | | | | 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
* avoid calling exit with a constant; use EXIT_* insteadJim Meyering2009-12-151-1/+3
| | | | | | | | | | | | | This appeases a new gnulib-provided "syntax-check". * daemon/libvirtd.c (main): Use EXIT_FAILURE, not 1. * proxy/libvirt_proxy.c (main): Likewise, and EXIT_SUCCESS, not 0. * tests/conftest.c (main): Likewise. * tests/reconnect.c (main): Likewise. * tests/testutils.h (EXIT_AM_SKIP): Define. * tests/nodeinfotest.c (mymain): Use EXIT_AM_SKIP, not 77. * tests/qemuargv2xmltest.c: Likewise. * tests/qemuxml2xmltest.c: Likewise. * tests/virshtest.c (mymain): Likewise.
* tests: Centralize VIR_TEST_DEBUG lookup, and document itCole Robinson2009-10-201-2/+2
| | | | | | | | Provide a simple interface for other tests to lookup the testDebug variable. Also remove a redundant error message in interface tests. If anyone feels inclined to change this env variable to match the existing LIBVIRT_* format, it should now be easier to do so.
* Dump qemu driver capabilities if test debugging enabledMark McLoughlin2009-09-101-0/+2
| | | | | | | * src/testutils.[ch]: make testDebug externally available * src/testutilsqemu.c: if VIR_TEST_DEBUG is set, dump the qemu driver capabilities to stderr
* Test case for QEMU driver ARGV -> XML conversionDaniel P. Berrange2009-05-211-0/+2
|
* Add test case for exercising the event loopDaniel P. Berrange2009-05-121-0/+2
|
* remove cvs $Id$ stringsJim Meyering2008-12-121-3/+1
| | | | | | | | | * po/id.po: Likewise. * qemud/remote_generate_stubs.pl: Likewise. * src/virsh.c: Likewise. * tests/testutils.c: Likewise. * tests/testutils.h: Likewise. * RENAMES: Likewise.
* Do conditional driver config in Makefile.am, not source filesDaniel P. Berrange2008-08-201-26/+18
|
* Generic test suite helpers for OOM testingDaniel P. Berrange2008-05-291-0/+9
|
* Test script helper for printing string differencesDaniel P. Berrange2008-04-181-0/+5
|
* remove Vim and Emacs variable settings from C source filesJim Meyering2008-04-101-9/+0
| | | | | | | | | Done with these commands: git grep -l Local.variab|xargs \ perl -0x3b -pi -e 's,\n+/\*\n \* vim:(.|\n)*,\n,' git grep -l Local.variab|xargs \ perl -0x3b -pi -e 's,\n+/\*\n \* Local variables:\n(.|\n)*,\n,'
* Remove all trailing blanks; turn on the rule to detect them.Jim Meyering2008-02-051-1/+1
| | | | | * Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank. * .x-sc_trailing_blank: New file, to exempt the few binary files.
* Added support for input devicesDaniel P. Berrange2007-07-181-13/+21
|
* Added tests for virsh domid, domname, domstat, domuuid, dominfo, list & ↵Daniel P. Berrange2006-08-241-0/+3
| | | | nodeinfo commands
* Added tests for the SEXPR<->XML conversion processDaniel P. Berrange2006-08-241-0/+3
|
* XML-RPC testsKarel Zak2006-05-091-0/+33