summaryrefslogtreecommitdiffstats
path: root/test-tool/test-tool.c
Commit message (Collapse)AuthorAgeFilesLines
* test-tool: Don't print banner when using --help, -V, etc options (RHBZ#879416).Richard W.M. Jones2012-11-231-11/+12
|
* test-tool: Print cachedir and tmpdir.Richard W.M. Jones2012-11-101-0/+6
| | | | This fixes commit 1efed122c07792f4c66a4083159cfacfb1893212.
* test-tool: Add prominent warning about including complete output.Richard W.M. Jones2012-09-261-0/+11
| | | | | | | Everyone ignores the documentation. Everyone ignores me even when I specifically tell them to include the complete output. Place a prominent notice at the beginning of the output.
* test-tool: guestfs_get_path might return NULL.Richard W.M. Jones2012-09-261-1/+1
| | | | | It would almost certainly indicate a bug if it happens, but don't rely on printf not segfaulting if it did happen.
* syntax: Remove PATH_MAX-sized buffers allocated on the stack.Richard W.M. Jones2012-09-151-2/+7
| | | | | | | | | | | | | | On Linux PATH_MAX is 4096, but on some platforms it can be much larger or even not defined (ie. unlimited). Therefore using a PATH_MAX-sized stack buffer is not a great idea for portable programs. This change removes use of PATH_MAX-sized stack-allocated buffers. This change only applies to the library and standalone programs. Inside the daemon, memory allocation is much more complicated so I have not changed those (yet). Found by 'make syntax-check'.
* test-tool: Print more environment variables.Richard W.M. Jones2012-09-141-7/+18
| | | | | This prints LIBVIRT_*, LIBVIRTD_*, LD_* and PATH, since these are all useful for debugging and could affect libguestfs in some way.
* Replace mount-options with mount where appropriate.Richard W.M. Jones2012-08-181-1/+1
| | | | | | Since our minimum supported version is now 1.16 and mount was fixed in 1.13.16, it is now safe to replace mount-options + empty options with mount wherever it occurs.
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The new API splits orderly close into a two-step process: if (guestfs_shutdown (g) == -1) { /* handle the error, eg. qemu error */ } guestfs_close (g); Note that the explicit shutdown step is only necessary in the case where you have made changes to the disk image and want to handle write errors. Read the documentation for further information. This change also: - deprecates guestfs_kill_subprocess - turns guestfs_kill_subprocess into the same as guestfs_shutdown - changes guestfish and other tools to call shutdown + close where necessary (not for read-only tools) - updates documentation - updates examples
* test-tool: Implement -V / --version option.Richard W.M. Jones2012-05-051-18/+28
|
* Remove "convenience header" "gettext.h" and use <libintl.h> instead.Richard W.M. Jones2012-05-011-13/+1
| | | | | | | | | | | | gettextize provides a local file called "gettext.h". Remove this and use <libintl.h> from glibc headers instead. Most of this change is mechanical: #include <libintl.h> in every C file which uses any gettext function. But also we remove the gettext.h file, and adjust the "_" macros. Note that this effectively removes the ./configure --disable-nls option, although we don't know if that ever worked.
* Tempus fugit.Richard W.M. Jones2012-01-181-2/+2
| | | | Update all copyright dates to 2012.
* test-tool: Fix multiple memory leaks found by valgrind.Richard W.M. Jones2011-11-241-4/+8
|
* Update FSF address.Matthew Booth2011-11-081-1/+1
|
* New API: set-smp, get-smpRichard W.M. Jones2011-09-281-0/+1
| | | | | | | These calls allow you to change the number of virtual CPUs assigned to the appliance. This also adds a --smp option to virt-rescue.
* test-tool: Display TMPDIR.Richard Jones2011-09-141-0/+1
|
* test-tool: Make the default timeout be 600 seconds (10 minutes).Richard Jones2011-09-141-1/+1
| | | | | | We could sometimes hit the 120 second timeout, eg. if the appliance needed to be rebuilt and the machine was very slow and/or under heavy I/O load. 10 minutes should be enough for any reasonable situation.
* test-tool: Print FEBOOTSTRAP_* environment variables (RHBZ#671082).Richard W.M. Jones2011-07-261-0/+3
|
* test-tool: Display state of pgroup flag from the handle.Richard W.M. Jones2011-07-261-0/+1
| | | | This updates commit f173543fd207bdc254a5eb75180d82ef25eacae9.
* test-tool: Don't use static binary helper program, nor ISO.Richard W.M. Jones2011-04-061-124/+33
| | | | | | | | | | | | | | This simplifies the libguestfs-test-tool program down to essentials. Bugs most commonly occur when starting the appliance, so what we should concentrate on test is just that. Previously the test tool built a special static binary helper program, packaged it up in an ISO, then ran this inside the appliance. None of this really tested useful failure modes, but they did make the test tool itself harder to build, harder for users to run, and more brittle. This change also adds some more debugging of libguestfs state.
* generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This large commit changes the generator so that optional arguments can be supported for functions. The model for arguments (known as the "style") is changed from (ret, args) to (ret, args, optargs) where optargs is a more limited list of arguments. One function has been added which takes optional arguments, it is "add-drive-opts", modelled as: (RErr, [String "filename"], #required [Bool "readonly"; String "format"; String "iface"]) #optional Note that this function is processed in the library (does not go over the RPC protocol to the daemon). This has allowed us to simplify the current implementation by omitting changes related to RPC or the daemon, although we plan to add these at some point in the future. From C this function can be called in 3 different ways as in these examples: guestfs_add_drive_opts (g, filename, GUESTFS_ADD_DRIVE_OPTS_READONLY, 1, GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -1); (the argument(s) between 'filename' and '-1' are the optional ones). guestfs_add_drive_opts_va (g, filename, args); where 'args' is a va_list. This works like the first version. struct guestfs_add_drive_opts_argv optargs = { .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK, .readonly = 1, } guestfs_add_drive_opts_argv (g, filename, &optargs); This last form lets you construct lists of optional arguments, and is used by guestfish and the language bindings. In guestfish optional arguments are used like this: add-drive-opts filename readonly:true In OCaml these are mapped naturally to OCaml optional arguments, eg: g#add_drive_opts ~readonly:true filename; In Perl these are mapped to extra arguments, eg: $g->add_drive_opts ($filename, readonly => 1); In Python these are mapped to optional arguments, eg: g.add_drive_opts ("file", readonly = 1, format = "qcow2") In Ruby these are mapped to a final hash argument, eg: g.add_drive_opts("file", {}) g.add_drive_opts("file", :readonly => 1) g.add_drive_opts("file", :readonly => 1, :iface => "virtio") In PHP these are mapped to extra parameters. This is not quite accurate since you cannot omit arbitrary optional parameters, but there's not much than can be done within the limitations of PHP as a language. Unimplemented in: Haskell, C#, Java.
* Allow $TMPDIR to override most temporary directory uses.Richard W.M. Jones2010-09-241-3/+7
| | | | | | | Be more consistent in allowing the user to override use of the temporary directory by specifying $TMPDIR. Also prefer P_tmpdir macro (defined in <stdio.h>) if that is defined, rather than hard-coding "/tmp" for the fallback location.
* Mac OS X: For PATH_MAX, include <limits.h>Richard Jones2010-03-221-0/+1
|
* Mac OS X: setlocale function requires <locale.h> header file.Richard Jones2010-03-221-0/+1
|
* Mac OS X: Detect bindtextdomain.Richard Jones2010-03-221-0/+7
| | | | | These are missing on Mac OS X. I think you would need to install a gettext package to get these.
* Use mount-options instead of mount to avoid implicit -o sync.Richard Jones2010-02-101-1/+1
| | | | | | | | | | | | | | | guestfs_mount adds -o sync implicitly. This causes a very large performance problem for write-intensive programs (eg. virt-v2v). Document this as a "gotcha". Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use mount-options instead. (Note that this gotcha does not affect mount-ro). The source of the performance problem was first identified by Matthew Booth.
* Set locale in C programs so l10n works (RHBZ#559962).Richard Jones2010-01-291-0/+4
| | | | | | | | | | | | | | | This commit adds the calls to setlocale &c to all of the current C programs. It also adds l10n support to hivexget and hivexml which lacked them previously. To test this, try: LANG=pa_IN.UTF-8 guestfish --cmd-help (You can only do this test after installing the package, or at least the 'pa.mo' mo-file in the correct place).
* maint: use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1 to exitJim Meyering2009-11-201-29/+29
| | | | | | | | | | | | | | | Convert all uses automatically, via these two commands: git grep -l '\<exit *(1)' \ | grep -vEf .x-sc_prohibit_magic_number_exit \ | xargs --no-run-if-empty \ perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/' git grep -l '\<exit *(0)' \ | grep -vEf .x-sc_prohibit_magic_number_exit \ | xargs --no-run-if-empty \ perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/' * .x-sc_prohibit_magic_number_exit: New file. Edit (RWMJ): Don't change Java code.
* Don't export STREQ and friends in <guestfs.h>Richard Jones2009-11-101-0/+10
| | | | | Move these to private header file(s) and other places as required since these aren't part of the public API.
* use STREQ, not strcmp: part 1Jim Meyering2009-11-091-3/+3
| | | | | git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
* change strncmp() == 0 to STREQLEN()Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strncmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
* Remove guestfs_wait_ready (turn it into a no-op).Richard Jones2009-09-211-8/+2
| | | | | | | | | | | | | | This commit changes guestfs_launch so that it both launches the appliance and waits until it is ready (ie. the daemon communicates back to us). Since we removed the pretence that we could implement a low-level asynchronous API, the need to call launch() followed by wait_ready() has looked a bit silly. Now guestfs_wait_ready() is basically a no-op. It is left in the API for backwards compatibility. Any calls to guestfs_wait_ready() can be removed from client code.
* test-tool: Recognize '-t timeout' as an option.Richard Jones2009-08-161-1/+1
|
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-52/+52
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* build: reenable "syntax-check" rule: sc_const_long_optionJim Meyering2009-08-031-1/+1
| | | | | | | * cfg.mk (disable_temporarily): Remove sc_const_long_option. * daemon/guestfsd.c (main): Declare long_options to be "const". * fish/fish.c (main): Likewise. * test-tool/test-tool.c (main): Likewise.
* Add libguestfs-test-tool.Richard Jones2009-07-221-0/+437
This is an end-user testing tool, designed to test basic functionality of libguestfs/qemu/kernel combination on the end-user's final host machine. It does not perform a thorough test, but should be enough to find most booting issues. Also this is intended to be used when reporting bugs.