609 Commits

Author SHA1 Message Date
Pino Toscano
83eea0b197 tests: don't add test-dlopen twice
test-dlopen needs to be added only when libdl is available, and it is
like that already (within if HAVE_LIBDL); hence don't unconditionally
add it as well.
2015-01-29 12:00:32 +01:00
Pino Toscano
e57ed7cd34 build: use libintl where needed
Followup of commit a5426cce5f.
2015-01-29 12:00:01 +01:00
Richard W.M. Jones
19c09bcdee tests/lvm: Remove use of deprecated sfdiskM API.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1183236
for the sorry tale.
2015-01-19 15:01:37 +00:00
Richard W.M. Jones
5ab3a75e1d tests/lvm: Allow test-lvm-mapping.pl to be skipped. 2015-01-17 14:24:35 +00:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Richard W.M. Jones
f1ecd6af80 fish: Add regression test for RHBZ#1175196. 2014-12-17 14:38:44 +00:00
Richard W.M. Jones
5f6677ebd0 environment: Use guestfs___is_true when parsing various boolean environment variables (RHBZ#1175196).
You can now use LIBGUESTFS_DEBUG=true (etc.)

You can disable debugging/tracing by setting LIBGUESTFS_DEBUG=0 (etc.)
2014-12-17 14:38:44 +00:00
Richard W.M. Jones
f843abe400 tests: Fix memory leaks in test-add-libvirt-dom.
Found by valgrind.

This fixes commit df9782ec3a
and commit 96158d42f5.
2014-12-15 17:28:30 +00:00
Richard W.M. Jones
df9782ec3a tests: Enable and fix test-add-libvirt-dom test.
Commit 96158d42f5 enabled the previously
private guestfs_add_libvirt_dom API.  It also tried to enable the
existing test for this API, but failed to do that correctly.  Also the
test was broken.  Fix all of this.

This fixes commit 96158d42f5.
2014-12-12 15:50:07 +00:00
Richard W.M. Jones
96158d42f5 New(ish) API: guestfs_add_libvirt_dom.
This API already existed (as guestfs___add_libvirt_dom), and was used
by a few tools.

This commit changes it to a public API.

Note that for reasons outlined in the previous commit message, it is
impossible to call this from guestfish or from non-C language
bindings.
2014-12-11 14:15:00 +00:00
Richard W.M. Jones
2990db8d1a tests/c-api: Test that the library can really be loaded with dlopen.
Answer is yes, but it was good to know.
2014-11-28 22:26:57 +00:00
Nikos Skalkotos
f3dbf340b8 Add tests for Arch Linux
Signed-off-by: Nikos Skalkotos <skalkoto@gmail.com>
2014-11-25 15:25:45 +00:00
Pino Toscano
a5426cce5f build: check for libintl, and use it
Look for libint/gettext and link to it; this properly detects whether
libint is part of libc.
2014-11-05 13:45:17 +01:00
Pino Toscano
1fab78c7b2 tests/qemu: isolate MD5 calculation in an own shared function
md5sum(1) does not exist everywhere, so wrap it in an own function so
the right implementation can be chosen on each OS.  Also, wrapping it
avoid using awk everytime.
2014-11-04 18:02:20 +01:00
Pino Toscano
9deafea846 test-charset-fidelity: use and link against gnulib
It uses error() which is specific to GNU libc, but supplied by gnulib if
not available.
2014-11-04 18:02:04 +01:00
Pino Toscano
7fcac5f59f tests: switch from get_current_dir_name to getcwd(0, NULL)
get_current_dir_name exists on GNU libc only, so not portable.
On the other hand, while POSIX leaves a null buffer argument for getcwd
as unspecified behaviour, basically the most used/important Unix
implementations (GNU libc, FreeBSD's libc, etc) allow such value,
returning a new allocated buffer with the current directory.

In any case, the change just affects two tests, so even if it hits a
libc not implementing this behaviour for getcwd, only tests are
affected.
2014-10-23 19:03:12 +02:00
Pino Toscano
349536bf70 tests/c-api: add a way to skip test when host and appliance differ
Add a IfNotCrossAppliance prereq for tests, so a test using it can only
be run when the appliance is a copy of the running host system; this can
help marking tests which run stuff (usually built in the host) inside
the appliance.
2014-10-23 19:03:12 +02:00
Pino Toscano
3de9fa7ba9 build: use $(SED) instead of sed when possible
Make use of the sed executable set at configure time.
2014-10-23 19:03:12 +02:00
Richard W.M. Jones
c4bc416820 lib: Enable detection of ARM (32 bit).
This includes some empty binaries to use for detection testing.
2014-10-06 13:17:35 +01:00
Richard W.M. Jones
0823416925 tests: Fix SKIP_ environment variable in a couple of scripts.
I checked and bug 690819 has nothing to do with either of these
tests.  It was just a copy and paste error.
2014-10-02 17:02:21 +01:00
Richard W.M. Jones
765dc6237c tests: rsync: Skip this test when the backend is libvirt.
It would work, except if you have a host firewall which will block
inbound connections on virbr0 to non-standard ports.
2014-10-02 15:31:50 +01:00
Richard W.M. Jones
7806e8667b tests: Add drivers directory to phony Windows image.
Allows virt-v2v to upload drivers.
2014-09-24 17:59:28 +01:00
Richard W.M. Jones
5bb26dcd3c tests/data: Remove abssymlink.
This file causes the test ISO to be rebuilt every time.

Instead of including it as a Makefile dependency, create it just
before making the ISO, which has the same effect.

A test in fish/ also used this file.  Change it so it doesn't need it.
2014-09-20 17:32:18 +01:00
Richard W.M. Jones
5fa568f686 tests/guests: Don't calculate checksums of generated images.
Turns out not to be useful, and takes a long time.

This reverts commit 0c605eb94f.
2014-09-20 15:57:44 +01:00
Richard W.M. Jones
0869f579fd aarch64: Add support to file_architecture API.
Add support for aarch64 to the file_architecture API, so we can
detect aarch64 guests correctly.

Add a test binary and library.  These were generated on an aarch64
machine by doing:

  echo 'main(){}' > bin.c
  gcc bin.c -o bin-aarch64-dynamic
  strip --strip-all bin-aarch64-dynamic
  echo '' > lib.c
  gcc -shared lib.c -o lib-aarch64.so
  strip --strip-all lib-aarch64.so
2014-09-20 11:56:12 +01:00
Richard W.M. Jones
e85a976c5a tests: Don't use relative paths to binaries in tests.
All tests run under the ./run binary.  For a long time the ./run
binary has set the $PATH environment variable to contain all of the
directories with binaries in them.

Therefore there is no reason to use ../fish/guestfish instead of just
plain guestfish (and the same applies to other built binaries).
2014-09-17 17:31:50 +01:00
Pino Toscano
a67845bfa0 test-charset-fidelity: set iocharset in vfat/msdos FSes
The default charset for these filesystems depends on how the kernel was
configured with, so explicitly set the default one (as specified in
Linux sources), eventually setting later a new one for the tests.
2014-09-10 18:47:51 +02:00
Richard W.M. Jones
715020e264 v2v: Remove bogus %systemroot%\Drivers path.
This was based an incorrect translation of what the old virt-v2v was
doing.  %systemroot%\Drivers is not expected to exist already, and
indeed does not exist in a real Windows 7 guest.
2014-08-26 22:54:45 +01:00
Pino Toscano
4a4256b807 tests: make the scratch disk used for scratch much larger
50M can be not enough when uploading various copies of unstripped
static binaries from the system, which can fill up such a small disk.
2014-08-19 17:11:05 +02:00
Pino Toscano
787c42d6eb tests/syslinux: add /usr/lib/syslinux/bios as directory for mbr.bin
On Archlinux that is the location of mbr.bin.
2014-08-15 16:24:09 +01:00
Richard W.M. Jones
7beb9f2cb5 tests/guests: Add Windows/Drivers directory to phony Windows guest.
Allows virt-v2v to complete.
2014-08-13 22:10:31 +01:00
Richard W.M. Jones
5b6a2e68b8 tests/guests: Fix RPM database in phony Fedora guest.
Fix the Name and Packages database so it looks enough like a modern
RPM database to fool inspection.  I'm not sure whether or not the old
version ever worked, but it doesn't work now.

The format is not documented, but in brief:

The Name database contains (Name, link) pairs.  The link is an
arbitrary 32 bit integer.

The Packages database contains (link, RPM-blob) pairs.

The RPM-blob is a binary blob formatted like this:

 * Number of fields               4 bytes, big endian
 * Size in bytes of the store     4 bytes, big endian
 * Field descriptions:
     list of (RPMTAG, 0, offset in store, 0)
                                  4 * 4 * nr_fields bytes, big endian
 * The store                      binary data containing ASCIIZ strings

For the values of RPMTAG_* that we understand, see src/inspect-apps.c.
2014-08-13 22:10:31 +01:00
Richard W.M. Jones
b743fe2c3e tests/guests: Define the disk format of our test guests in the test XML. 2014-08-13 22:10:30 +01:00
Pino Toscano
fef0881b3a tests: c-api: do not crash w/ missing hash entry
If an hash does not have the requested key, just error out cleanly
instead of crashing when trying to compare a null string.
2014-08-08 14:56:27 +02:00
Pino Toscano
7912759fc3 src: always check value passed to set_memsize
Move the minimum memory check from the environment parsing to
set_memsize, so the limit is actually enforced also when using the API.

Adapt the rhbz557655.sh test to the invalid memsize values being
rejected now, and add a new test for checking invalid parameters
explicitly.
2014-08-08 11:20:12 +02:00
Richard W.M. Jones
1d596eb7e6 tests: qemu-speed-test: Allow test time to be adjusted with -t option.
This is useful when analysing with `perf' since it allows us to
increase the amount of time in the test versus the amount of time
spent starting the appliance.
2014-07-29 20:27:53 +01:00
Richard W.M. Jones
1c7da06327 tests: qemu-speed-test: Allow tests to be run selectively. 2014-07-29 12:36:43 +01:00
Richard W.M. Jones
f342cfc69d tests: qemu-boot: Error if extra command line arguments are given. 2014-07-29 12:36:43 +01:00
Richard W.M. Jones
7378edb9fa Add qemu-speed-test program to test speed of qemu.
Currently it tests the upload and download speed of virtio-serial and
the read and write speed of the block device (eg. virtio-scsi).
2014-07-25 22:48:09 +01:00
Richard W.M. Jones
146cc78b7d aarch64: Use a smaller test file for test-cancellation-upload-daemoncancels.sh
This test worked by uploading a 100MB file into a 100MB container and
seeing the inevitable crash.  Unfortunately virtio-mmio (used on
aarch64) is quite slow.  Since this test is not testing the speed of
virtio-mmio, use a smaller test file so the test finishes in a
reasonable time.
2014-07-25 15:28:46 +01:00
Richard W.M. Jones
d268de9394 tests: hotplug: Allow tests to be skipped.
They don't work on aarch64.
2014-07-25 14:43:06 +01:00
Richard W.M. Jones
64498034bb tests: lvm: Allow test to be skipped. 2014-07-25 10:04:44 +01:00
Richard W.M. Jones
de5924a229 tests: Add test program to run qemu/appliance repeatedly.
For example:

  $ time ./run ./tests/qemu/qemu-boot -n 100
  real 1m19.794s
  user 0m10.001s
  sys  0m5.928s

will run 100 appliance start/stops, from multiple threads.
2014-07-17 22:31:59 +01:00
Richard W.M. Jones
333ddf208b tests: Add a protocol regression test for long error messages. 2014-07-17 11:40:41 +01:00
Richard W.M. Jones
00c94d808b tests: Remove tests/protocol/test-qemudie-launchfail.sh
This test has not been run since 2012 as it depends on specifics of
how supermin and new-style appliances work (see
commit 2d89aef897).

This commit removes the test entirely.
2014-07-17 11:40:40 +01:00
Richard W.M. Jones
fa3d6e55b2 tests: qemu: Fix TCG test.
$guestfish was not defined, so the UML test/skip did not do anything.
2014-07-16 13:40:37 +01:00
Richard W.M. Jones
9cdaaeee40 tests: regressions: Allow non-exec stack test to be skipped.
Currently fails on aarch64 because of a buggy GCC.
2014-07-15 22:56:22 +01:00
Richard W.M. Jones
9e01541e48 tests: 9p: aarch64 also uses virtio-mmio (instead of virtio-pci). 2014-07-15 22:56:22 +01:00
Richard W.M. Jones
2d01e06fc9 tests: regressions: Skip test on aarch64 which also does not support IDE. 2014-07-15 22:56:22 +01:00
Richard W.M. Jones
bf47ed1b6a tests: qemu: Test force_tcg setting is effective. 2014-07-02 18:20:51 +01:00