summaryrefslogtreecommitdiffstats
path: root/regressions
Commit message (Collapse)AuthorAgeFilesLines
* Remove old regression test that mainly tested a buggy API.Richard W.M. Jones2011-09-012-44/+0
| | | | | | The guestfs_ll command currently lists files in the appliance if you prefix filenames with "/..". However this is a bug, not a feature, and we should not be testing it.
* protocol: Fix case where download can fail for small files.Richard W.M. Jones2011-08-181-6/+20
| | | | | | | | | | | | | There is another case where downloads of small files could fail if the library side (writer) fails. In this case the library would send back a cancellation, but it would be received after the daemon had finished sending the whole file (because the file is small enough). The daemon would reenter the main loop and immediately get an unexpected cancel message, causing the daemon to die. This commit also makes test-cancellation-download-librarycancels.sh more robust. We use Monte-Carlo testing with a range of file sizes. Small file sizes should trigger the error case.
* build: Set TMPDIR for local testing.Richard W.M. Jones2011-08-081-0/+1
| | | | | | This avoids conflicts with the globally installed libguestfs appliance, or lets us build in multiple local directories at the same time without conflicts.
* fish: Fix regression tests for new guestfish line numbers.Richard W.M. Jones2011-08-051-1/+1
| | | | This updates commit 319e946b92e175c05cdd1fdcb85c9b86f5631011.
* Add regression test to catch missing libraries in the appliance.Richard W.M. Jones2011-08-021-0/+49
| | | | Related to RHBZ#727178.
* Fix test-guestfish-escapes regression test to work with debug/trace enabled.Richard W.M. Jones2011-07-151-2/+7
| | | | | | | | If debugging or tracing is enabled, extra messages are sent to stderr which mess with this test. Remove the extra messages before checking stderr. This updates commit 617e7f6bafa7de2303c08e1715004aae3141c389.
* fish: Handle backslash escapes in guestfish double-quoted strings.Richard W.M. Jones2011-07-142-0/+79
|
* part-get-bootable: Fix when partitions are missing or unordered (RHBZ#602997).Richard W.M. Jones2011-07-122-0/+72
|
* New API: list-dm-devices (RHBZ#688062).Richard W.M. Jones2011-07-122-0/+112
| | | | List device mapper devices.
* mkfs: Force mke2fs to create a filesystem even on raw IDE device (RHBZ#690819).Richard W.M. Jones2011-03-252-1/+39
| | | | Notes: Labels: bugfix, RHBZ#690819
* proto: Fix both-ends-cancel case.Richard W.M. Jones2011-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where both ends cancel at the same time (eg. both ends realize there are errors before or during the transfer), previously we skipped sending back an error from the daemon, on the spurious basis that the library would not need it (the library is cancelling because of its own error). However this is wrong: we should always send back an error message from the daemon in order to preserve synchronization of the protocol. A simple test case is: $ guestfish -N fs -m /dev/sda1 upload nosuchfile / libguestfs: error: open: nosuchfile: No such file or directory libguestfs: error: unexpected procedure number (66/282) (Notice two things: there are errors at both ends, and the loss of synchronization). After applying this commit, the loss of synchronization does not occur and we just see the library error: $ guestfish -N fs -m /dev/sda1 upload nosuchfile / libguestfs: error: open: nosuchfile: No such file or directory The choice of displaying the library or the daemon error is fairly arbitrary in this case -- it would be valid to display either or even to combine them into one error. Displaying the library error only makes the code considerably simpler. This commit also (re-)enables a test for this case.
* proto: Fix FileIn ops that abort during the chunk upload stage.Richard W.M. Jones2011-03-184-4/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a previous, incorrect attempt to fix RHBZ#576879 we tried to prevent the daemon from sending an error reply if the daemon had cancelled the transfer. This is wrong: the daemon should send an error reply in these cases. A simple test case is this: guestfish -N fs -m /dev/sda1 upload big-file / (This fails because the target "/" is a directory, not a file.) Prior to this commit, libguestfs would hang instead of printing an error. With this commit, libguestfs prints an error. What is happening is: (1) Library is uploading a file (2) In the middle of the long upload, daemon detects an error. Daemon cancels. (3) Library detects cancel, sends cancel chunk, then waits for the error reply from the daemon. (4) Daemon is supposed to send an error reply message. Because step (4) wasn't happening, uploads that failed like this would hang in the library (waiting for the error message, while the daemon was waiting for the next request). This also adds a regression test. This temporarily breaks the "both ends cancel" case (RHBZ#576879c5). Therefore the test for that is disabled, and this is fixed in the next patch in the series. This partially reverts commit dc706a639eec16084c0618baf7bfde00c6565f63.
* regressions: Enable both tests for bug 576879 (not fixed).Richard W.M. Jones2011-03-181-2/+2
|
* regressions: Rename the file we are uploading too.Richard W.M. Jones2011-03-171-1/+1
| | | | This updates commit cbd8da6d4dd2e4cbc3b87fbc7cb7d6129eb69172.
* regressions: Split the test rhbz576879.sh into two halves.Richard W.M. Jones2011-03-173-20/+36
| | | | | | | We suspect that there are in fact two separate bugs. In any case it makes sense for the two tests to be done separately. Note that these tests still fail.
* regressions: Fix rhbz557655.sh so it works with tracing enabled.Richard W.M. Jones2011-02-031-0/+1
|
* Fix test-guestfish-a.sh regression test for new trace format.Richard W.M. Jones2011-01-281-5/+5
| | | | This fixes commit 1d999540bddd7aea7c2d0fef8b15223d4acc645f.
* fish: Don't fail if some mountpoints in /etc/fstab are bogus (RHBZ#668574).Richard W.M. Jones2011-01-112-0/+71
| | | | | | | | | | | | | | | | | Fix guestfish (and other C tools) so that they ignore errors when /etc/fstab contains bogus entries. Update the documentation for inspect-get-mountpoints to emphasize that callers must be aware of this when mounting the returned values. Add a regression test. Update the example code ("inspect_vm") to reflect the way this API ought to be called. For more detail see: https://bugzilla.redhat.com/show_bug.cgi?id=668574
* fish: fails to tilde expand '~' when $HOME env is unset (RHBZ#617440).Richard W.M. Jones2011-01-042-0/+71
| | | | This also adds a regression test.
* ubuntu: Allow test-luks.sh to be bypassed to workaround Ubuntu bug.Richard W.M. Jones2010-12-071-0/+5
| | | | This is necessary because of too old cryptsetup on Ubuntu.
* regressions: Disable test for 576879.Richard W.M. Jones2010-12-062-6/+10
| | | | | This test has worked only intermittently for a while. Disable it. The upstream bug has been reopened.
* regressions: Fix test-launch-race to work in non-supermin case.Richard W.M. Jones2010-11-241-2/+6
|
* Generate a dummy 'Fedora' fedora.img in images directory for use by tests.Richard W.M. Jones2010-11-111-12/+16
| | | | | | | | We were generating this dummy 'Fedora' image already in the tools directory. It contains just enough Fedora-like files to fool our inspection code and thus to test the tools. This is general enough that we can use it everywhere.
* fish: Use core add-domain API to implement '-d' option.Richard Jones2010-11-111-6/+6
| | | | | | This also makes libxml2 and libvirt into optional dependencies. If they are missing then the core API will print an error, as will the '-d' option to guestfish.
* New API: add-domainRichard Jones2010-11-112-0/+80
| | | | | | | | | | | | | | | | | | | This new API allows you to add the disks from a libvirt domain. In guestfish you can use the 'domain' command to access the API, eg: ><fs> domain Fedora14 libvirturi:qemu:///system 1 The returned number is the number of disks that were added. Also here is a proposed (but commented out) low-level API which would allow you to add a domain from a virDomainPtr. However there are several problems with this API -- see discussion on the list: https://www.redhat.com/archives/libguestfs/2010-November/thread.html#00028
* Ensure atomic creation of a cached applianceMatthew Booth2010-10-282-0/+61
| | | | | | | | | | | | | | | | | | | | Cached appliances are discovered by their predictable path. Previously we were creating a cached appliance directly in this predictable path. This had at least 2 undesirable effects: * Interrupting appliance creation would leave a corrupt appliance * 2 processes could simultaneously attempt to create the same appliance, causing corruption. This patch causes the cached appliance to be created in a temporary directory, and then renamed to the predictable path. As rename is an atomic operation, this makes the whole creation atomic. This patch also changes the predictable path to have a prefix of 'guestfs.'. This will make it simpler for system administrators to clean up old cached appliances. This patch resolves RHBZ#639405
* Disable test for RHBZ#576879 comment 5.Richard W.M. Jones2010-10-271-0/+5
| | | | This test has started to hang, for reasons we don't understand.
* fish: Specify format of disks (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-222-9/+39
| | | | | | | | For libvirt guests, the disk format is copied from libvirt (if libvirt knows it). For command line disk images, you can use --format to override format auto-detection.
* generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-222-1/+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.
* test-copy: Skip this test if /dev/fd is missing, because of broken mock 1.1.4.Richard W.M. Jones2010-10-021-0/+8
|
* regressions: Test just-built guestfish.Richard W.M. Jones2010-09-222-2/+3
| | | | | | Instead of testing the installed /usr/bin/guestfish. This fixes commit ddda0f7bd00a37274dae38f4ce93955b8cfdf7d7.
* Test guestfish -a and guestfish -d options.Richard W.M. Jones2010-09-223-0/+82
| | | | | Since these options were both broken in released version 1.5.17, best to have a regression test to catch this in future.
* syntax: Replace -a and -o with && and || for portability.Richard Jones2010-09-111-6/+7
|
* syntax: Use exit (EXIT_SUCCESS) instead of hard-coded number.Richard Jones2010-09-101-1/+1
|
* fish: Add regression test for copy-in and copy-out.Richard Jones2010-09-102-0/+70
|
* regressions: Don't print misleading 'Expect error ...' lines.Richard Jones2010-07-227-5/+27
| | | | | | | | | | | | | Some tests in the regressions directory deliberately print error messages. As long as they still PASS, this is OK. However these tests also printed some misleading messages about what error to expect. Since error messages were slightly different across distros, these messages were not accurate. Therefore remove these messages, and replace with a general message before all tests telling users not to worry about errors from the tests as long as the tests don't fail.
* New APIs: Support for creating LUKS and managing keys.Richard Jones2010-07-222-0/+89
| | | | | | | | | | | | | | | | | | | This commit adds four APIs for creating new LUKS devices and key management. These are: luks_format Format a LUKS device with the default cipher. luks_format_cipher Format with a chosen cipher. luks_add_key Add another key to an existing device. luks_kill_slot Delete a key from an existing device. This enables all the significant functionality of the cryptsetup luks* commands. Note that you can obtain the UUID of a LUKS device already by using vfs-uuid. This also includes a regression test covering all the LUKS functions.
* New APIs: lvm-set-filter and lvm-clear-filter.Richard Jones2010-07-162-0/+93
| | | | | | | These APIs allow you to change the device filter, the list of block devices that LVM "sees". Either you can set it to a fixed list of devices / partitions, or you can clear it so that LVM sees everything.
* 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
|