summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-034-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* tests: Add a test of /dev/disk/by-id paths (RHBZ#627675).Richard W.M. Jones2012-06-291-0/+8
|
* tests: Use qemu-img to create an overlay for testing, instead of copying.Richard W.M. Jones2012-06-291-9/+9
| | | | | | | | | | Replace: cp tests/guests/fedora.img test.img with the longer but possibly more space-efficient equivalent: qemu-img create -F raw -b tests/guests/fedora.img -f qcow2 test.qcow2
* tests: Reformat TESTS_ENVIRONMENT so all use a standard format.Richard W.M. Jones2012-06-283-7/+3
| | | | No functional change.
* run: Set MALLOC_PERTURB_ to a random value.Richard W.M. Jones2012-06-2812-55/+11
| | | | | | | | | | | | | | | | | MALLOC_PERTURB_ is a glibc feature which causes malloc to wipe memory before and after it is used, allowing both use-after-free and uninitialized reads to be detected with relatively little performance penalty: http://udrepper.livejournal.com/11429.html?nojs=1 Modify the ./run script so that it always sets this. We were already using MALLOC_PERTURB_ in most tests. Since ./run is now setting this, we can remove it from individual Makefiles. Most TESTS_ENVIRONMENT will now simply look like this: TESTS_ENVIRONMENT = $(top_builddir)/run --test
* tests: Add ./run --test option.Richard W.M. Jones2012-06-2614-18/+16
| | | | | | | This option, when added via TESTS_ENVIRONMENT = [...] $(top_builddir)/run --test allows us to run the tests and only print the full output (including debugging etc) when the test fails.
* tests: Add thread IDs to test of bug 790721.Richard W.M. Jones2012-06-261-5/+10
|
* tests: Allow SELinux tests to be skipped with an environment variable.Richard W.M. Jones2012-06-251-0/+6
|
* tests/xml: Fix compilation of test on RHEL 5 with old libvirt.Richard W.M. Jones2012-06-221-2/+9
| | | | | | | | | | | Old <libvirt.h> had a conflicting definition of virDomainGetXMLDesc: fake_libvirt_xml.c:36: error: conflicting types for 'virDomainGetXMLDesc' /usr/include/libvirt/libvirt.h:715: error: previous declaration of 'virDomainGetXMLDesc' was here The difference is not material ('int' vs. 'unsigned int'). Avoid the error by not including <libvirt.h>.
* tests: Add workaround for missing O_CLOEXEC.Richard W.M. Jones2012-06-221-0/+4
|
* tests: Fix broken workarounds for missing O_CLOEXEC.Richard W.M. Jones2012-06-222-2/+2
|
* tests: Add SKIP_TEST_* variables to allow these tests to be skipped.Richard W.M. Jones2012-06-226-0/+30
| | | | | By setting these variables, we can skip tests that fail on RHEL 5.
* build: Define abs_builddir if not defined already.Richard W.M. Jones2012-06-181-0/+3
| | | | | | This is missing on RHEL 5. This updates commit 50aa9533e4a505e1c64dbedddb30491bfbb755d6.
* tests: Replace truncate command with 'guestfish sparse'.Richard W.M. Jones2012-06-184-5/+5
| | | | | | | | | | RHEL 5 didn't have the truncate command, but we can replace: truncate -s SIZE FILE with the roughly equivalent command: guestfish sparse FILE SIZE
* build: Define builddir and abs_srcdir when they are missing.Richard W.M. Jones2012-06-184-6/+12
| | | | | | | | | | | | | | | | | | | | | RHEL 5-era autoconf did not define these, so define them manually when they are missing. Define builddir as '.' The scripts require this. It won't work in the srcdir != builddir case, but we don't care about that for RHEL 5. This commit also moves the builddir / abs_srcdir variable setting above the include of subdir-rules.mk, in case that include uses these variables. Useful script: for f in $(find -name Makefile.am | xargs fgrep '$(abs_srcdir)' -l) ; do if ! grep -q '^abs_srcdir' $f; then echo missing in $f fi done
* tests: Add tests for extended attrs and SELinux, direct and via FUSE.Richard W.M. Jones2012-06-146-0/+464
| | | | | | | Note that the SELinux + FUSE test is disabled because of: https://bugzilla.redhat.com/show_bug.cgi?id=811217 https://bugzilla.redhat.com/show_bug.cgi?id=812798#c42
* tests: Add a test which adds the maximum number of disks and uses them.Richard W.M. Jones2012-06-132-0/+192
|
* tests/md: Don't hard code /dev/vda in expected output of tests.Richard W.M. Jones2012-06-122-13/+14
| | | | Use a small sed script to canonicalize the device names.
* tests: Fix spelling in comment.Richard W.M. Jones2012-06-121-2/+2
|
* tests/lvm: Don't hard-code /dev/vda in test.Richard W.M. Jones2012-06-121-1/+1
| | | | | Hard-coding it breaks virtio-scsi because the devices are called /dev/sda etc.
* tests: Allow regression test for bug 690819 to be skipped.Richard W.M. Jones2012-06-091-0/+12
|
* btrfs: Modify test to correctly detect btrfs availability.Richard W.M. Jones2012-06-091-4/+6
|
* tests: Add a test of non-ASCII character fidelity on various filesystem ↵Richard W.M. Jones2012-05-252-0/+491
| | | | | | types (RHBZ#823887). Thanks Laszlo Ersek.
* tests: Regression test for RHBZ#701814.Richard W.M. Jones2012-05-035-0/+255
| | | | | | | | | | | | | | | | | This commit adds a tests/xml directory, and an LD_PRELOAD module which can fake arbitrary libvirt XML from an external file (and is therefore a much more flexible test than using the libvirt test:// driver alone). Also added is one regression test for: https://bugzilla.redhat.com/show_bug.cgi?id=701814 Loading the given libvirt XML using Sys::Guestfs::Lib::open_guest used to fail with the error: format parameter is empty or contains disallowed characters at /home/rjones/d/libguestfs/perl/blib/lib/Sys/Guestfs/Lib.pm line 256. Thanks to Tom Horsley for supplying the test data.
* btrfs: Fix btrfs test so it works with btrfs-progs in Rawhide.Richard W.M. Jones2012-04-261-12/+12
| | | | See: http://bugzilla.redhat.com/816346
* btrfs: Enhance the btrfs device test.Richard W.M. Jones2012-04-251-2/+37
| | | | This enhances commit 87ea7a04094d5ed40f3f047ff2b7a613d4d530d4.
* tests: Add some more substantial test data.Richard W.M. Jones2012-04-253-0/+2
| | | | | | | | | | | | | The two tarballs: 8252 bytes tests/data/filesanddirs-10M.tar.xz 41152 bytes tests/data/filesanddirs-100M.tar.xz contain, as their names suggest, highly compressed files and directories, with unpacked size respectively around 10M and 100M (the precise size after unpacking depends on the filesystem). These can be used for testing purposes.
* btrfs-device-delete: Use correct (sysroot-prefixed) path to filesystem.Richard W.M. Jones2012-04-251-3/+1
| | | | This fixes commit 87ea7a04094d5ed40f3f047ff2b7a613d4d530d4.
* New btrfs APIs.Richard W.M. Jones2012-04-253-0/+183
| | | | | | | | | | | | | | | | Bind the easy parts of the 'btrfs' program. The new APIs are: btrfs-device-add: add devices to a btrfs filesystem btrfs-device-delete: remove devices from a btrfs filesystem btrfs-filesystem-sync: sync a btrfs filesystem btrfs-filesystem-balance: balance a btrfs filesystem btrfs-subvolume-create: create a btrfs snapshot btrfs-subvolume-delete: delete a btrfs snapshot btrfs-subvolume-list: list btrfs snapshots and subvolumes btrfs-subvolume-set-default: set default btrfs subvolume btrfs-subvolume-snapshot: create a writable btrfs snapshot
* guests: Add /etc/shadow file to fedora.img.Richard W.M. Jones2012-04-211-0/+5
| | | | This is used for testing file permissions and SELinux contexts.
* tests: Space before parens in perl code.Richard W.M. Jones2012-04-211-77/+77
|
* Remove obsolete valgrind rule from C API tests.Richard W.M. Jones2012-04-181-5/+0
|
* extra-tests: Check if valgrind supports --vgdb=no option.Richard W.M. Jones2012-04-181-3/+3
| | | | This option didn't exist in RHEL 6 valgrind.
* tests: Fix reference to guestfish in test for RHBZ#811649.Richard W.M. Jones2012-04-131-1/+1
| | | | This fixes commit a9bd90abfb3d4519278dfff305b8b7033ae6d76a.
* Add regression test to test funny filenames (RHBZ#811649).Richard W.M. Jones2012-04-122-0/+50
|
* extra-tests: Add suppression for memory leak in FUSE.Richard W.M. Jones2012-04-121-0/+9
|
* inspection: Remove spurious warning for Ubuntu 10.04 with encrypted swap ↵Richard W.M. Jones2012-04-121-0/+3
| | | | (RHBZ#811872).
* extra-tests: Add suppression for libvirt/gnutls leak.Richard W.M. Jones2012-04-111-1/+12
| | | | https://www.redhat.com/archives/libvir-list/2012-April/msg00322.html
* extra-tests: Disable valgrind vgdb.Richard W.M. Jones2012-04-101-1/+2
| | | | This leaves files called 'vgdb-pipe-*' in .
* tests: Fix guest building so parallel 'make -jN check' works.Richard W.M. Jones2012-04-065-29/+33
| | | | | | | | | | | | | | | | This means renaming various temporary files (eg. fstab.tmp) that several of the scripts were using so they don't conflict (eg. fstab.tmp.$$). Also the rule: fedora-md1.img fedora-md2.img: guest-aux/make-fedora-img.pl causes the script to run twice in parallel when using 'make -jN'. Replace this with a stamp file so it runs once: fedora-md1.img fedora-md2.img: stamp-fedora-md.img stamp-fedora-md.img: guest-aux/make-fedora-img.pl
* tests: Don't print "4" when running make-windows-img.shRichard W.M. Jones2012-04-061-1/+1
| | | | | The return value of the pwrite-device command -- 4 (bytes) -- is printed out. Hide it instead.
* extra-tests: Test virt-sysprep.Richard W.M. Jones2012-04-011-1/+14
|
* Rewrite virt-sysprep.Richard W.M. Jones2012-03-311-3/+1
|
* test: Thread function is a candidate for attribute noreturn.Richard Jones2012-03-291-3/+1
| | | | | The start_test_thread function never returns, it is always cancelled by the main thread.
* Use O_CLOEXEC / SOCK_CLOEXEC for almost all file descriptors.Richard W.M. Jones2012-03-142-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | The presumption is that all file descriptors should be created with the close-on-exec flag set. The only exception are file descriptors that we want passed through to exec'd subprocesses (mainly pipes and stdin/stdout/stderr). For open calls, we pass O_CLOEXEC as an extra flag, eg: fd = open ("foo", O_RDONLY|O_CLOEXEC); This is a Linux-ism, but using a macro we can easily make it portable. For sockets, similarly: sock = socket (..., SOCK_STREAM|SOCK_CLOEXEC, ...); For accepted sockets, we use the Linux accept4 system call which allows flags to be supplied, but we use the Gnulib 'accept4' module to make this portable. For dup, dup2, we use the Linux dup3 system call, and the Gnulib modules 'dup3' and 'cloexec'.
* tests: Remove/fix unused variables warnings.Richard W.M. Jones2012-03-122-0/+2
|
* tests: Remove unused variable.Richard W.M. Jones2012-03-121-1/+0
|
* extra-tests: Export LIBVIRT_DEFAULT_URI to pick-guests.pl.Richard W.M. Jones2012-03-081-1/+6
| | | | This fixes commit 2912e4e1173226f461517a0008664e01b5d3066d.
* extra-tests: Check that guests are accessible before picking them.Richard W.M. Jones2012-03-082-11/+65
|
* tests/md: Number the errors so we can easily see which test fails.Richard W.M. Jones2012-03-081-3/+3
|