Commit Graph

291 Commits

Author SHA1 Message Date
Hilko Bengen
7c21e129c9 Do not ship test-qemu-drive-libvirt.xml with tarball as it is generated by configure 2014-03-04 18:56:07 +01:00
Hilko Bengen
d7e3aea7bc Fixes for various tests in out-of-tree builds 2014-03-04 00:06:09 +01:00
Pino Toscano
12bdd94f7e tests/luks: disable if luks is not available 2014-02-28 15:07:32 +01:00
Richard W.M. Jones
f02fddc26b tests: Update miscellaneous tests to use disk-create API.
Instead of calling out to qemu-img / truncate.
2014-01-28 21:02:11 +00:00
Richard W.M. Jones
588af1953e New API: disk-create for creating blank disks.
This is a wrapper around either 'qemu-img create' or calls to open,
truncate and posix_fallocate which litter and complicate existing
code.
2014-01-28 21:02:11 +00:00
Pino Toscano
95f8144cb6 tests/regressions: remove C part of rhbz1044014
All it did was checking for a libvirt version, which is what
libvirt-is-version now does; hence remove the C part, and use guestfish,
ignoring the launch failure (as the C test did).
2014-01-27 17:25:55 +01:00
Pino Toscano
4310f8f175 tests/disks: skip test-qemu-drive-libvirt.sh if libvirt is < 1.1.3
This test relies on the <test:runstate> element in the domain XML, which
has been introduced in libvirt 1.1.3.
2014-01-27 16:33:22 +01:00
Pino Toscano
f66d6a85b6 tests/mountable: add missing space in test-mountable-inspect.sh
No actual behaviour, other than getting rid of a bash warning.
2014-01-27 14:25:47 +01:00
Richard W.M. Jones
4e18712562 tests/disks/test-qemu-drive-libvirt: Include test data.
This was inadvertantly deleted.

This fixes commit 01d27033bd.
2014-01-25 11:56:40 +00:00
Richard W.M. Jones
01d27033bd lib, fish: Handle Gluster, NBD, iSCSI and Sheepdog paths properly.
This fixes the handling of paths for the protocols named above, with
respect to leading '/' (or not) on the volume/export name.

See previous commits which did the same fixes for Ceph:
commit 53a3ff9c00
commit 992a6b2970
2014-01-23 21:49:16 +00:00
Richard W.M. Jones
1d6ba35e6f tests: Add a test of libvirt domain XML to qemu command line (RHBZ#1026688).
This tests that libvirt domain XML (ie. guestfish -d option) is parsed
correctly and results in the correct qemu command line when using the
direct backend.

This is a good end-to-end test of various layers.
2014-01-23 14:46:03 +00:00
Richard W.M. Jones
53a3ff9c00 lib: Handle Ceph/rbd paths properly (RHBZ#1026688).
The path at the protocol level is:

  pool/disk

(with no leading '/' character).  This is now what you have to pass to
guestfs_add_drive_opts.

Also Ceph can be called with no explicit servers (it uses the contents
of /etc/ceph/ceph.conf instead).  So allow zero servers to be used.
2014-01-23 14:46:03 +00:00
Richard W.M. Jones
629cb87b6d tests/regressions: Don't include binaries in EXTRA_DIST.
Because EXTRA_DIST simply used $(TESTS), and because the list of tests
includes C binaries, these were included in the tarball (actually not
binaries, but libtool scripts, but it's still undesirable).
2014-01-22 17:13:00 +00:00
Richard W.M. Jones
7d8d065fee tests: Add a regression test for RHBZ#1054761. 2014-01-22 17:10:37 +00:00
Richard W.M. Jones
ee90a36521 tests: Add regression test for get-attach-method == "appliance".
This updates commit ecd31806a4.
2014-01-20 12:09:29 +00:00
Richard W.M. Jones
ecd31806a4 tests: Add a regression test for parsing LIBGUESTFS_BACKEND/LIBGUESTFS_ATTACH_METHOD (RHBZ#1055452). 2014-01-20 10:22:41 +00:00
Richard W.M. Jones
3858eeb517 tests/nbd: Move wait for qemu-nbd to start up earlier.
tests/nbd/test-nbd.pl contains a hack (a call to sleep) to wait
for qemu-nbd to start up in another process.

This sleep was previously located before the call to $g->launch()
since that is where (previous to commit 4a0f5ed382) the backend would
have connected to the NBD server.

However in the new code, an initial NBD connection test is done when
the drive is added (ie. $g->add_drive (..., protocol=>"nbd")), which
duly failed intermittently because the qemu-nbd server had not opened
its socket yet.

Move the wait earlier -- just after the fork -- to avoid this.

This updates commit 4a0f5ed382.
2014-01-18 16:32:03 +00:00
Richard W.M. Jones
c537b26f20 uml: Fix rule which disables relative-paths test on UML.
This fixes commit e22bd2dcd2.
2014-01-17 19:23:27 +00:00
Richard W.M. Jones
e22bd2dcd2 tests: Add a test of relative paths, to make sure we don't break them.
In some places we turn relative paths passed by the caller into
absolute paths: for example in the libvirt backend, all relative paths
to disk images have to be turned into absolute paths (by calling
realpath) because otherwise libvirt doesn't work.

This has the potential to break things, especially considering that
qemu uses the path passed to it in order to resolve the relative paths
of backing files.

For example consider the case where 'overlay' is a symbolic link to
/dev/dm-1, but /dev/dm-1 contains a qcow2 which references './backing'
as its backing file.  If we rewrote 'overlay' to '/dev/dm-1', then
qemu would try to look up '/dev/backing' for the backing file and
fail.

See also:

https://bugzilla.redhat.com/show_bug.cgi?id=1053684
https://www.redhat.com/archives/libguestfs/2014-January/thread.html#00087
2014-01-17 15:33:26 +00:00
Richard W.M. Jones
7500ae3f75 builder: Fix virt-builder test.
Add Europe/London timezone to phony Fedora guest.

This fixes commit dd1bfea513.
2014-01-12 17:49:48 +00:00
Richard W.M. Jones
746a0b1f19 tests: Add a regression test for libvirt authentication (RHBZ#1044014).
This tests the virConnectAuthPtrDefault wrapper path.
2014-01-08 21:11:52 +00:00
Richard W.M. Jones
873db60c0e tests: Add a regression test of libvirt authentication events.
This requires a change to libvirt (in libvirt >= 1.2.1), see:

https://www.redhat.com/archives/libvir-list/2014-January/msg00378.html
2014-01-08 21:11:52 +00:00
Richard W.M. Jones
6c971faecf Update copyright dates for 2014. 2014-01-02 16:53:34 +00:00
Richard W.M. Jones
883208284b Allow ./configure --without-qemu.
This means there will be no default hypervisor, and effectively the
user will always have to specify one (eg. by setting LIBGUESTFS_HV or
calling guestfs_set_hv).

This is useful on platforms where qemu doesn't work, or where qemu is
not needed (eg. if you want to use UML, or you just want to compile
libguestfs without using/testing it).
2014-01-02 16:24:26 +00:00
Pino Toscano
ac1d5ba77b tests/mountable: skip if btrfs is not available
This test uses btrfs, so skip it if either the "btrfs" feature or the
btrfs filesystem is not available.
2013-12-23 17:02:02 +01:00
Pino Toscano
a13696e99c Re-add regression tests for rh#563450
Added in 2392fae680 and removed in
be025369ad622867ecf08d5c9170e8e59d2d6294; now they should work with any
backend, as the device names are normalised and not change the guestfish
output depending on the used backend.

Thanks Richard for the hints.
2013-12-20 11:38:52 +01:00
Richard W.M. Jones
be025369ad tests/regressions: Remove regression tests rhbz563450*.
These two tests failed 'make check-release' (particularly the
UML tests).

This partially reverts commit 2392fae680.
2013-12-18 20:40:54 +00:00
Richard W.M. Jones
685a28eb2c tests: guests: Add /etc/motd test file to Fedora test image. 2013-12-18 15:15:51 +00:00
Pino Toscano
2392fae680 drives: add CD-ROM disk images as read-only drives (RHBZ#563450).
The current add_cdrom way basically appends a new raw "-cdrom /path"
parameter to the qemu invocation (even when using libvirt as backend),
hence such images are seen as "CD-ROM drives" inside the appliance.
However, there is no need for such particular behaviour, as they need to
be handled as normal (read-only) drives.

Adding CD-ROM disk images as drives also changes the device names used
for them inside the appliance from /dev/srN to the usual e.g. /dev/sdX.

These changes fix different issues:
- it is possible to start guestfish without adding disks with -a, then
  just add-cdrom and run
- list-devices does not cause guestfsd to crash when sorting the list
  of devices (exposed by the test case in RHBZ#563450)
- the result of list-devices now reflects the order images were added
  (RHBZ#563450)

add_cdrom is still deprecated, but now in favour of add_drive_ro
(instead of add_drive), with its documentation reflecting that.

Add two small regression tests for the fixes described above.
2013-12-16 14:54:27 +01:00
Richard W.M. Jones
97ea81eb21 tests: Test that network drives are mapped to correct qemu -drive parameters.
Although this test only specifically tests the direct backend, the
same code is shared with the libvirt backend in some circumstances
(eg. creating readonly drives).  So this is testing a bit of both.
2013-11-25 22:58:23 +00:00
Richard W.M. Jones
18c93ac61f RHEL 5: Don't use 'truncate' command in tests.
Use 'guestfish sparse' instead, which is roughly equivalent.

See commit ef1514aa1e
and commit 39df80dcc0.
2013-10-18 09:09:59 +01:00
Richard W.M. Jones
13b79aacca Use qemu-img -o preallocation=metadata where possible.
When format is qcow2 and we're *not* using a backing disk, we can use
preallocation=metadata for better performance.
2013-10-17 15:03:37 +01:00
Richard W.M. Jones
49e6ba51e3 sysprep: random seed: Try much harder to create a random seed file.
Since this is essential for security, be much more proactive about
trying to create a random seed file, even for guests which have buggy
installers that don't create this file during installation.
2013-10-15 20:41:22 +01:00
Richard W.M. Jones
92e1864913 events: Add a warning event and direct all warning messages through it.
This also causes warnings to be printed even in non-verbose mode,
which is useful.
2013-10-11 15:34:23 +01:00
Richard W.M. Jones
a914889b1d tests/nbd: Avoid warning when tests are skipped.
Since END{} clause is always called,  might not be defined if
we exit early.  Move the whole clause to the top.
2013-10-04 08:26:00 +01:00
Richard W.M. Jones
74938b895c ppc: Disallow ide interface.
qemu-system-ppc64 lets you add the IDE interface to the appliance, but
the appliance kernel ignores it (and consequently can't find the
appliance disk so it all goes wrong).  Best to just disallow this.

Also skip tests that try using iface = 'ide'.
2013-09-10 10:41:37 +01:00
Richard W.M. Jones
415d74d0b8 tests: Add a regression test that ensure the network can be added.
This was only tested before (implicitly) by the rsync test in
tests/rsync.  It's better to have an explicit test of this
functionality.
2013-09-09 12:22:08 +01:00
Richard W.M. Jones
1cfdb4d9a7 arm: tests: 9p: Modify name of virtio-9p-pci device when using virtio-mmio.
It's called virtio-9p-device on virtio-mmio.
2013-09-08 20:50:54 +01:00
Richard W.M. Jones
9d97b86ee8 arm: Error if iface=ide and skip tests that use iface=ide.
ARM doesn't support IDE.  (Well, that's not entirely true as I found a
reference to one extremely obscure ARM board that had IDE disks, but
qemu-system-arm doesn't appear to support them).
2013-09-08 16:21:17 +01:00
Richard W.M. Jones
1b34d6171b Add a regression test of tar-out excludes option (RHBZ#1001875). 2013-08-29 13:36:56 +01:00
Olaf Hering
cb7b1c56b7 tests: change noinst to check
This change avoids the hard requirement for qemu-tools during package
build.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2013-08-19 19:24:23 +01:00
Richard W.M. Jones
78dbd08dd2 Rename 'qemu' as 'hv', 'LIBGUESTFS_QEMU' as 'LIBGUESTFS_HV'. 2013-08-14 17:25:34 +01:00
Richard W.M. Jones
08f605c073 tests: Add a test that console log messages make it up to events.
In Rawhide, the console was briefly broken although it "fixed itself"
when libvirtd was restarted.
2013-08-14 17:25:11 +01:00
Richard W.M. Jones
d25732f852 uml: tests/qemu: Fix tests so they work without support for qcow2. 2013-08-13 15:46:55 +01:00
Richard W.M. Jones
1d20770d41 uml: tests/md: Skip test-inspect-fstab.sh since it needs qcow2. 2013-08-13 15:46:55 +01:00
Richard W.M. Jones
e9d2508694 uml: tests/md: Fix test to cope with /dev/ubd* device names. 2013-08-13 15:46:55 +01:00
Richard W.M. Jones
73e959e1ee uml: tests/luks: Fix assumption that broke /dev/ubd* device names. 2013-08-13 15:46:54 +01:00
Richard W.M. Jones
9c3d1efcaa uml: tests/lvm: Fix assumption that broke /dev/ubd* device names. 2013-08-13 15:46:54 +01:00
Richard W.M. Jones
f622d854a7 uml: tests/mountable: Skip tests that need qcow2. 2013-08-13 15:46:54 +01:00
Richard W.M. Jones
4d64dbfe48 uml: tests/disks: Fix test so it can cope with /dev/ubd* device names. 2013-08-13 15:46:54 +01:00