summaryrefslogtreecommitdiffstats
path: root/regressions
Commit message (Collapse)AuthorAgeFilesLines
* fish: Allow suffixes on number parameters (eg. 1M)Richard Jones2010-05-212-6/+2
| | | | | | | | | | | | | | | | This small change uses the gnulib xstrtoll functionality to enable suffixes on integer parameters in guestfish. For example: truncate-size /file 1G (previously you would have had to given the full number). This also applies to the 'alloc' and 'sparse' commands (and indirectly to the -N option). The specification for these commands has changed slightly, in that 'alloc foo 1MB' would now use SI units, allocating 1000000 bytes instead of a true megabyte. All existing uses would use 'alloc foo 1M' which still allocates true megabytes.
* generator: Check parameters are not NULL (RHBZ#501893).Richard Jones2010-05-202-0/+61
| | | | | | | | | | | | | | This adds additional tests to check that several types of parameter including String are not NULL when passed to the C functions. Previously this would cause a segfault inside libguestfs. With this change, you get an error message / exception. Of the possible pointer parameters, only OptString is now permitted to be NULL. This change does not affect the Perl bindings. This is because Perl XS code was already adding similar checks if you passed undef into a parameter expecting a string.
* Fix FileIn cmds losing synch if both ends send cancel messages (RHBZ#576879).Richard Jones2010-05-131-1/+11
| | | | | | | | | | | | | | | | | | | | | | | During a FileIn command (eg. upload, tar-in) if both sides experience errors, then both sides could send cancel messages, the result being lost synchronization. The reason for the lost synch was because the daemon was ignoring this case and sending an error message back which the library side (which had cancelled) was not expecting. Fix this by checking in the daemon for the case where the library also cancels during daemon cancellation, and not sending an error messages. This also includes an enhanced regression test which checks for this case. This extends the original fix in commit 5922d7084d6b43f0a1a15b664c7082dfeaf584d0. More details can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5
* fish: Add -N option for making prepared disk images.Richard Jones2010-04-229-51/+17
| | | | | | | | | | | | | | | | | Previously you might have typed: $ guestfish ><fs> alloc test1.img 100M ><fs> run ><fs> part-disk /dev/sda mbr ><fs> mkfs ext4 /dev/sda1 now you can do the same with: $ guestfish -N fs:ext4 Some tests have also been updated to use this new functionality.
* Replace 'dd' in tests with use of guestfish 'sparse' command.Richard Jones2010-04-203-6/+5
| | | | | | | 'dd' is a very inefficient way to create files. 'truncate' is better, but unfortunately that command is not available in RHEL 5. So use the guestfish 'sparse' command instead (which also avoids allocating disk space).
* Fix upload losing synchronization if root not mounted (RHBZ#576879).Richard Jones2010-04-172-0/+34
| | | | | | | | | | | | Modify the generator so that it can correctly handle early cancellation for Pathname|Device|.. parameters. This fixes the upload command, but consequently we need to fix the parameters for tar_in and t?z_in commands. This should also mean that 'win:' can now be used as the second argument of tar_in and t?z_in commands in guestfish, whereas previously this wouldn't have worked. Adds a regression test for the original problem.
* fish: Allow '-' prefix on command line to override exit on error (RHBZ#578407).Richard Jones2010-04-132-0/+44
| | | | | | | | | | | | | | | Allow -cmd on the command line to mean that normal exit on error behaviour is overridden, ie. we will not exit. This allows you to do: guestfish -- command : -command : command with the second command allowing errors. (Note that '--' is required to stop getopt parsing -command as an option). Also this fixes the remote case which is what the original bug report was about.
* Code cleanups related to RHBZ#580246.Richard Jones2010-04-082-0/+48
| | | | | | | | | | | | | | This includes various code cleanups: (a) A regression test for RHBZ#580246. (b) Use write instead of fwrite to write out the tar file. This is just because the error handling of write seems to be better specified and easier to use. (c) Use size_t instead of int for length. (d) Clearer debug messages when in verbose mode.
* New APIs: Query the relationship between LVM objects.Richard Jones2010-03-182-0/+101
| | | | | | | | | These calls allow you to query the relationship between LVM objects, for example, which PVs contain a VG, or which LVs are contained in a VG. See the example / test program 'regressions/test-lvm-mapping.pl' for an example of how to do this from Perl.
* guestfish: Use xstrtoll to parse Int params (RHBZ#569757 RHBZ#567567).Richard Jones2010-03-121-4/+4
| | | | | | Change guestfish so it uses xstrtoll to parse Int (31 bit) parameters. This fixes two bugs on 32 bit platforms which failed when long = 32 bits. long long = 64 bits on both.
* Use mount-options instead of mount to avoid implicit -o sync.Richard Jones2010-02-104-4/+4
| | | | | | | | | | | | | | | 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.
* Add files to EXTRA_DIST.Richard Jones2010-02-051-1/+2
|
* Fix regressions/rhbz557655.sh when debugging is enabled (v2).Richard Jones2010-01-293-14/+23
| | | | | | | | The previous fix didn't cope with ordinary warnings emitted by qemu (eg. "open /dev/kvm: No such file or directory"). This is a hopefully more complete fix for the problem. See also commit 3cd7ce75f1ce5048a4d9f6aeaf66aff3194e1096.
* Fix regressions/rhbz557655.sh when debugging is enabled.Richard Jones2010-01-281-0/+1
| | | | | | | | | | | | The regression test for RHBZ#557655 would fail if debugging was enabled, because debug output would get mixed up with the test output. To reproduce the error do: LIBGUESTFS_DEBUG=1 make -C regressions TESTS=rhbz557655.sh check This commit disables debug for just this test.
* guestfish: Use xstrtol to parse integers (RHBZ#557655).Richard Jones2010-01-253-1/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code uses atoi to parse the generator Int type and atoll to parse the generator Int64 type. The problem with the ato* functions is that they don't cope with errors very well, and they cannot parse numbers that begin with 0.. or 0x.. for octal and hexadecimal respectively. This replaces the atoi call with a call to Gnulib xstrtol and the atoll call with a call to Gnulib xstrtoll. The generated code looks like this for all Int arguments: { strtol_error xerr; long r; xerr = xstrtol (argv[0], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "memsize", "xstrtol", xerr); return -1; } /* The Int type in the generator is a signed 31 bit int. */ if (r < (-(2LL<<30)) || r > ((2LL<<30)-1)) { fprintf (stderr, _("%s: %s: integer out of range\n"), cmd, "memsize"); return -1; } /* The check above should ensure this assignment does not overflow. */ memsize = r; } and like this for all Int64 arguments (note we don't need the range check for these): { strtol_error xerr; long long r; xerr = xstrtoll (argv[1], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "size", "xstrtoll", xerr); return -1; } size = r; } Note this also fixes an unrelated bug in guestfish handling of RBufferOut. We were using 'fwrite' without checking the return value, and this could have caused silent failures, eg. in the case where there was not enough disk space to store the resulting file, or even if the program was interrupted (but continued) during the write. Replace this with Gnulib 'full-write', and check the return value and report errors.
* build: Fix inter-directory dependenciesMatthew Booth2009-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds an explicit dependency on generator.ml for every file it generates, except java files. Java is left for another time because it's considerably trickier. It also adds a build rule for src/libguestfs.la so it can be rebuilt as required from other directories. It does this by creating a top level make file, subdir-rules.mk, which can be included from sub-directories. sub-directories need to define 'generator_built' to include local files which are built by generator.ml, and they will be updated automatically. This fixes parallel make, and will automatically re-create generated files when make is run from any directory. It also fixes the problem which efad4f53 was targetting. Specifically, src/guestfs_protocol.(c|h) had an erroneous dependency on stamp-generator, and therefore generator.ml, despite not being directly created by it. This caused them to be recreated every time generator.ml ran rather than only when src/guestfs_protocol.x was updated, which cascaded into a daemon and therefore appliance update. This patch also changes the contents of the distribution tarball by including files created by rpcgen.
* Generic partition creation interface.Richard Jones2009-11-104-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a generic partition creation interface which should be future-proof and extensible, and partially replaces the old sfdisk-based interface. The implementation is based on parted but is hopefully not too dependent on the particulars of parted. The following new calls are introduced: guestfs_part_init: Initialize a disk with a partition table. Unlike the sfdisk- based interface, we also support GPT and other partition types, which is essential to scale to devices larger than 2TB. guestfs_part_add: Add a partition to an existing disk. guestfs_part_disk: Convenience function which combines part_init & part_add, creating a single partition that covers the whole disk. guestfs_part_set_bootable: guestfs_part_set_name: Set various aspects of existing partitions. guestfs_part_list: List partitions on a device. This returns a programming-friendly list of partition structs (in contrast to sfdisk-l which cannot be parsed). guestfs_part_get_parttype: Return the partition table type, eg. "msdos" or "gpt". The following calls are planned, but not added currently: guestfs_part_get_bootable guestfs_part_get_name guestfs_part_set_type guestfs_part_get_type
* Debian: Use /bin/bash as the shell for regression test scripts.Richard Jones2009-11-0414-14/+14
| | | | | | | | | | /bin/sh on Debian is a minimal shell called 'dash' which doesn't support some features we need such as the particular 'function' syntax used by regressions/test-stringlist.sh, and therefore this script was failing on Debian. Change all of these scripts to use #!/bin/bash explicitly to avoid these sorts of problems.
* New API: find0 (unlimited version of find)Richard Jones2009-10-202-0/+40
| | | | | | | | | | | | | This adds a new API call guestfs_find0, which is like guestfs_find but mainly doesn't suffer from the protocol limit of the earlier command. The earlier command is not deprecated because it is still very useful. guestfs_find0 uses a FileOut parameter and writes the results to an external file. The filenames in the output are separated by ASCII NUL characters (so a bit like "find -print0"). There is also the addition of a regression test for this command.
* guestfish: Enable grouping in string listsMatthew Booth2009-09-142-1/+62
| | | | | | | | | | | | | | | | | | | | | | This change adds the ability to group entries in a string list with single quotes. So the string: "'foo bar'" becomes 1 token rather than 2. Consequently single quotes must now be escaped: "\'" resolves to a literal single quote. Incidentally, this change also alters another, probably unintentional behaviour of the previous implementation, in that tokens are separated by any amount of whitespace rather than a single whitespace character. I.e.: "a b" resolves to: 'a' 'b' rather than: 'a' '' 'b' That last syntax can be used if an empty argument is still desired. Whitespace is now also defined to include tabs. parse_string_list can also now fail if it contains an unmatched open quote.
* guestfish: Redirect stdout when executing remote commandsMatthew Booth2009-09-141-0/+12
| | | | | | | | | | | guestfish --listen necessarily redirects its stdout to /dev/null so as not to interfere with eval. The remote protocol doesn't contain any other provision for collecting stdout for the caller, so executing guestfish --remote will never generate any output. This patch fixes that by forwarding the caller's STDOUT to the listener over the unix socket connection. The listener redirects its STDOUT to the caller's STDOUT for the duration of the command, then closes it again.
* tests: Found three more references to the squashfs, replaced with ISO.Richard W.M. Jones2009-08-192-4/+4
|
* tests: increase likelihood that heap abuse triggers failureJim Meyering2009-08-131-0/+3
| | | | | * regressions/Makefile.am (TESTS_ENVIRONMENT): Always set MALLOC_PERTURB_ to a random value in 1..255.
* Fix regression test rhbz503169c10.sh.Richard Jones2009-08-121-0/+3
| | | | | | | 'll' command has changed semantics very slightly (see commit 6727e7c8bdf1cb39264a9de6333d228b51c39956). We need to fix this test so it doesn't try to run the ll command without a mounted disk.
* Add copyright and license notice to regressions/test-noexec-stack.plRichard Jones2009-08-061-0/+15
|
* Add a test for an executable stack in resultant binariesMatthew Booth2009-08-052-3/+69
|
* build: remove trailing blanks, enable syntax-checkJim Meyering2009-08-041-1/+1
| | | | | | | * regressions/test-cancellation-download-librarycancels.sh: * src/generator.ml: * cfg.mk (disable_temporarily): Remove sc_trailing_blank. * .x-sc_trailing_blank: New file.
* RHEL 5 thinks squashfs is HFS+ filesystem, unless we specify the type ↵Richard Jones2009-07-231-1/+1
| | | | explicitly.
* Generator: Implement RBufferOut and "read-file" call.Richard W.M. Jones2009-07-212-0/+35
| | | | | | | | | This commit implements the RBufferOut type for returning arbitrary 8 bit data from calls. We also implement the guestfs_read_file call to read a whole file that can contain any 8 bit content, but up to a limit of ~ 2 MB.
* Guestfish feature: remote control of guestfish over a pipe.Richard Jones2009-07-142-0/+35
| | | | | | | | | | | | | | | | | The use case is to have a long-running guestfish process in a shell script, and thus to avoid the overhead of starting guestfish each time. Do: eval `guestfish --listen` guestfish --remote somecmd guestfish --remote someothercmd guestfish --remote exit This patch also supports having multiple guestfish processes at the same time. The protocol is simple XDR messages over a Unix domain socket.
* Regression test: Test reopening the handle in the same process.Richard W.M. Jones2009-07-112-1/+43
|
* RHEL 5: Mount squashfs with explicit type.Richard Jones2009-07-071-1/+1
|
* Test two (of four) cancellation paths.Richard Jones2009-07-063-0/+85
|
* Introduce regression tests for various qemu failures.Richard Jones2009-07-068-13/+150
| | | | | | | | | | | Test failure of qemu and recovery of the library: - mid-command - between commands - during launch [test not working yet] - explicitly killed by guestfs_kill_subprocess Also this patch cleans up the other tests in this directory and disables the long-winded test-bootbootboot test.
* remove trailing blanksJim Meyering2009-07-031-1/+0
|
* Fix RHBZ#503169 comment 13 (regression) and add a regression test.Richard Jones2009-06-042-0/+45
|
* Added regression test for RHBZ503169#c10Richard Jones2009-06-042-3/+52
|
* Move pure regression tests to their own subdirectory.Richard Jones2009-06-043-0/+103