aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* virsh: output scaled values with correct unitsEric Blake2012-05-011-4/+4
| | | | | | | | | | | The recent push to use correct scaling terms (kB for 1000, KiB for 1024 - such as commit 9dfdead) missed some places in virsh. * tools/virsh.c (prettyCapacity, cmdDominfo, cmdFreecell) (cmdNodeinfo, cmdNodeMemStats, cmdMigrateSetMaxSpeed) (cmdBlockCopy, cmdBlockPull, cmdBlockJob): Use KiB, not kB, when referring to multiples of 1024. * tests/virshtest.c: Update expected output to match.
* Cleanup for a return statement in source filesMartin Kletzander2012-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Return statements with parameter enclosed in parentheses were modified and parentheses were removed. The whole change was scripted, here is how: List of files was obtained using this command: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' Found files were modified with this command: sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_' Then checked for nonsense. The whole command looks like this: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
* virsh: add option aliasesEric Blake2012-03-071-0/+6
| | | | | | | | | | | | | | | | | | | In the past, we have created some virsh options with less-than-stellar names. For back-compat reasons, those names must continue to parse, but we don't want to document them in help output. This introduces a new option type, an alias, which points to a canonical option name later in the option list. I'm actually quite impressed that our code has already been factored to do all option parsing through common entry points, such that I got this added in relatively few lines of code! * tools/virsh.c (VSH_OT_ALIAS): New option type. (opts_echo): Hook up an alias, for easy testing. (vshCmddefOptParse, vshCmddefHelp, vshCmddefGetOption): Allow for aliases. * tools/virsh.pod (NOTES): Document promise of back-compat. * tests/virshtest.c (mymain): Test new feature.
* build: expand rule to cover testsuiteEric Blake2012-02-031-2/+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.
* build: fix virsh reformat falloutEric Blake2012-01-121-7/+7
| | | | | | | Commit 69f0b446 failed to update the expected test output. * tests/virshtest.c (testCompareListDefault) (testCompareListCustom): Adjust to recent code change.
* tests: Unify style of test skipping codeMatthias Bolte2011-07-291-9/+17
| | | | | | | | Prefer 'return EXIT_AM_SKIP' over 'exit(EXIT_AM_SKIP)'. Prefer 'int main(void)' over 'int main(int argc, char **argv)'. Fix mymain signature in commandtest and nodeinfotest.
* tests: Fix virshtest failure after dominfo changedOsier Yang2011-07-191-0/+1
| | | | Caused by the new changed "dominfo" command.
* tests: Lower stack usage below 4096 bytesMatthias Bolte2011-04-301-35/+23
| | | | | | | | | 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-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* virsh: add tests for recent cli improvementsEric Blake2010-10-151-0/+97
| | | | | * tests/virshtest.c (mymain): Add tests of command parsing and echo command.
* virsh: ensure persistence and autostart are shown for dominfo and pool-infoJustin Clift2010-06-171-0/+1
| | | | | | | | | | This patch adds the persistence status (yes/no) to the output of the virsh dominfo and pool-info commands. This patch also adds the autostart status to the output of the virsh pool-info command. Red Hat BZ for this: https://bugzilla.redhat.com/show_bug.cgi?id=603696
* avoid calling exit with a constant; use EXIT_* insteadJim Meyering2009-12-151-1/+1
| | | | | | | | | | | | | 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.
* Move example XML files into examples/xmlDaniel P. Berrange2009-09-211-1/+1
| | | | | | | | | | * docs/storage/: Move to examples/xml/storage/ * docs/test*.xml: Move to examples/xml/test/ * docs/Makefile.am: Remove example XML files from dist * Makefile.am: Add examples/xml to EXTRA_DIST * tests/virshtest.c: Update for moved test XML * libvirt.spec.in: Include example XML files as docs * tests/int-overflow: UPdate for moved XML
* Move virsh into tools/ directoryDaniel P. Berrange2009-09-211-2/+2
| | | | | | | | | | | | | | | | Move the virsh tool and its man page into the tools directory * Makefile.am: Remove rules for virsh.1 man page * virsh.1: Remove auto-generated file * docs/Makefile.am: Remove rules for virsh.pod man page * docs/virsh.pod: Move to tools/ directory * src/Makefile.am, src/.gitignore: Remove rules for virsh * src/console.c, src/console.h, src/*.ico, src/virsh_win_icon.rc, src/virsh.c: Move into tools/ directory * tools/Makefile.am: Add rules for building virsh * tools/.gitignore: Ignore virsh built files * tests/virshtest.c, tests/int-overflow: Update for new virsh location
* Move the expected output data from virshdata/*.txt into virshtest.c.Jim Meyering2008-11-241-155/+109
| | | | | | | | | | | * tests/virshtest.c: Embed literal, expected output here, rather than using virshdata/*.txt file names. Factor out some common constructs. (testCompareOutputLit): New function. (testCompareOutput): #ifdef-out, not that it's unused. * tests/Makefile.am (SUBDIRS): Remove virshdata/ and all files in it. * docs/testnode.xml: Fix typo in a comment. * configure.in (AC_OUTPUT): Remove tests/virshdata/Makefile.
* avoid many mingw-specific warningsJim Meyering2008-10-281-7/+4
| | | | | | * tests/virshtest.c (mymain): Use only one definition of this function. [WIN32]: Call exit(77) to skip the test. * tests/nodeinfotest.c: Likewise.
* Remove legacy debug outputDaniel P. Berrange2008-07-091-4/+0
|
* Compilation fixes for MinGWAtsushi SAKAI2008-06-261-1/+6
|
* Convert to use new memory allocation APIsDaniel P. Berrange2008-05-291-10/+13
|
* Remove all use of strcmp, strncmp in favour of STREQ, STREQLEN, STRPREFIXDaniel P. Berrange2008-05-141-2/+4
|
* convert TAB-based indentation in C sources to use only spacesJim Meyering2008-04-101-49/+49
| | | | | | Done using this command (also includes .c.in and .h.in files): for i in $(g ls-files|grep -E '\.[ch](\.in)?$'|grep -v gnulib); do expand -i $i > j && mv j $i;done
* Remove all trailing blanks; turn on the rule to detect them.Jim Meyering2008-02-051-3/+3
| | | | | * Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank. * .x-sc_trailing_blank: New file, to exempt the few binary files.
* Enable the <config.h>-requiring test; fix violationsJim Meyering2008-01-291-1/+1
| | | | | | | Use <config.h>, not "config.h", per autoconf documentation. * Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable. * .x-sc_require_config_h: New file, to list exempted files. * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
* Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>Richard W.M. Jones2007-12-051-6/+1
| | | | | | | | | | | | | | | | | | | * python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c, qemud/remote.c, src/internal.h, src/openvz_conf.c, src/openvz_driver.c, src/proxy_internal.h, src/qemu_conf.c, src/qemu_driver.c, src/remote_internal.h, src/test.h, src/util.c, src/xen_unified.c, src/xen_unified.h, tests/nodeinfotest.c, tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/reconnect.c, tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c: Change #include <> to #include "" for local includes. Removed many includes from src/internal.h and put them in the C files which actually use them. Removed <ansidecl.h> - unused. Added a comment around __func__. Removed a clashing redefinition of VERSION symbol. All limits (PATH_MAX etc) now done in src/internal.h, so we don't need to include those headers in other files.
* Mon Nov 26 12:03:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>Richard W.M. Jones2007-11-261-0/+5
| | | | | | | * tests/Makefile.am, tests/nodeinfotest.c, tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c: Miscellaneous fixes to the tests to compile under Cygwin.
* Arrange for tests to pass in a non-srcdir build.Jim Meyering2007-11-141-4/+9
| | | | | | | | | | | | | | | | | | | | * tests/Makefile.am: Include the contents of the *data directories in the make-dist-built tarball by adding each of that *data directories to EXTRA_DIST. Also add int-overflow (via $(test_scripts)) to EXTRA_DIST. * tests/nodeinfotest.c: Prepend "$abs_top_srcdir/tests" to each input file name. * tests/qemuxml2argvtest.c: Likewise. * tests/qemuxml2xmltest.c: Likewise. * tests/sexpr2xmltest.c: Likewise. * tests/test_conf.sh: Likewise. * tests/virshtest.c: Likewise. * tests/xencapstest.c: Likewise. * tests/xmconfigtest.c: Likewise. * tests/xml2sexprtest.c: Likewise. Author: Jim Meyering <meyering@redhat.com>
* Added support for input devicesDaniel P. Berrange2007-07-181-16/+16
|
* Fri Jun 15 16:21:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>Richard W.M. Jones2007-06-151-0/+1
| | | | * configure.in: Solaris header file fixes (Mark Johnson).
* Fixed virsh test suiteDaniel P. Berrange2007-01-261-4/+4
|
* Ensure we strip the :disk postfix from disks in Xen 3.0.3Daniel P. Berrange2006-09-141-2/+2
|
* Added tests for virsh domid, domname, domstat, domuuid, dominfo, list & ↵Daniel P. Berrange2006-08-241-0/+351
nodeinfo commands