10 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
Pino Toscano
431cdfd983 fish: edit: write to the real file name
When saving, resolve the path of the file being edited and use that as
real target to write to. Otherwise, if the file name is a symlink then
it will be replaced by a regular file with the new content, leaving the
old file untouched.

Extend test-edit.sh to check for this situation.
2014-09-01 11:46:57 +02: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
fc86db3b3b build: Return 77 from skipped tests. 2012-07-19 11:22:40 +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
7c21e49c2c fish: edit: Preserve permissions, UID, GID, SELinux context when editing files (RHBZ#788641). 2012-02-10 11:27:13 +00:00
Richard W.M. Jones
ddae5abf80 fish: In edit command, upload to a new file.
If the upload fails, this means we don't leave a partially
written file.

Also add a test for the edit command.
2012-02-10 11:27:13 +00:00