11 Commits

Author SHA1 Message Date
Richard W.M. Jones
b5fbc7e617 tests: Replace $TEST_FUNCTIONS
Replace strange $TEST_FUNCTIONS variable/expansion thing with
something more like what we use in nbdkit, a simple tests/functions.sh
script that gets sourced into each test script.

Update the common submodule to get:

  commit 8137d47d0e654065391151eb275e3b64f230f6f5
  Author: Richard W.M. Jones <rjones@redhat.com>
  Date:   Thu Feb 13 11:13:55 2025 +0000

    mlcustomize, mltools: Replace $TEST_FUNCTIONS

    TEST_FUNCTIONS is being removed from libguestfs and guestfs-tools (it
    was removed from virt-v2v a while back).  Make the same adjustment in
    the common submodule.

(and some other commits which are not relevant to libguestfs)
2025-02-13 11:15:34 +00:00
Richard W.M. Jones
a1b3d8d04b tests: Extend $TEST_FUNCTIONS with predefined functions for skipping tests etc.
Apply this change across all the shell scripts containing tests.

Additionally this defines the environment variables $abs_srcdir,
$abs_builddir, $top_srcdir, $top_builddir, $abs_top_srcdir and
$abs_top_builddir which can now be used throughout test scripts.
2017-02-21 17:23:22 +00: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
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
07e47513df fish: Fix tests that specified qcow2 format, but passed a raw format disk.
In some tests we were specifying qcow2 as the image format when adding
a disk, but actually passing a raw format image.

Libguestfs previously did not detect this until guestfs_launch, but it
was still a bug to pass an incorrect format to guestfs_add_drive_opts.

It only worked because these tests never call guestfs_launch.

A later commit in this series will cause this to be detected
(sometimes) during guestfs_add_drive_opts.
2014-01-16 18:01:46 +00:00
Richard W.M. Jones
65b4ab11e1 tests: fish: Add valgrind testing to various existing tests.
This involves running ./guestfish under $VG (== valgrind + options,
defined only when check-valgrind is run).
2013-07-30 16:27:55 +01:00
Richard W.M. Jones
4180abcc1f tests: Use unique or temporary names for temporary files.
Review every test(!) to ensure that it:

 - Doesn't use a generic name (eg. "test1.img", "test.out") for any
   temporary file it needs.

 - Does instead use a unique name or a temporary name (eg. a name like
   "name-of-the-test.img", or a scratch disk).

 - Does not use 'rm -f' to clean up its temporary files (so we can
   detect errors if the wrong temporary file is created or removed).

This allows tests to be run in parallel, so they don't stomp on each
other's temporary files.
2013-07-23 10:16:00 +01:00
Richard W.M. Jones
3614d76b37 tests: Move debug-drives testing API to launch.c and change the output.
It should work with any attach-method.
2012-07-23 20:17:24 +01:00
Richard W.M. Jones
39df80dcc0 tests: Replace truncate command with 'guestfish sparse'.
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
2012-06-18 15:33:04 +01:00
Richard W.M. Jones
1f603bfd6d fish: Rename tests and make test paths relative.
When these tests were originally in the old regressions/ directory,
they used to refer to guestfish via the path '../fish/guestfish'.
Some of the tests were also called 'test-guestfish-*'.

Now that the tests have been moved into the fish/ directory, neither
of these things make sense.  So change the relative path to
'./guestfish' and rename all 'test-guestfish-*' as 'test-*'.
2012-03-12 15:09:15 +00:00
Richard W.M. Jones
498758faee tests: Split regressions -> various subdirectories of tests/ 2011-12-22 13:04:41 +00:00