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)
This commit is contained in:
Richard W.M. Jones
2025-02-13 10:32:59 +00:00
parent 82e2dea96a
commit b5fbc7e617
114 changed files with 255 additions and 147 deletions

View File

@@ -18,9 +18,10 @@
# Test guestfish -a option.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-a.out

View File

@@ -18,9 +18,10 @@
# Test add-domain command.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-add-domain-{1,2,3,4}.img

View File

@@ -18,10 +18,10 @@
# Test guestfish -a URI.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-add-uri.out

View File

@@ -18,9 +18,10 @@
# Test guestfish alloc and sparse commands.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-alloc.img

View File

@@ -18,9 +18,10 @@
# Test guestfish copy-in and copy-out commands.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
# This test fails on some versions of mock which lack /dev/fd

View File

@@ -18,9 +18,10 @@
# Test guestfish -d option.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-d-{1,2,3,4}.img

View File

@@ -16,9 +16,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
$top_srcdir/podcheck.pl "$srcdir/guestfish.pod" guestfish \

View File

@@ -18,9 +18,10 @@
# Test guestfish edit command.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
# This test fails on some versions of mock which lack /dev/fd

View File

@@ -18,9 +18,10 @@
# Test guestfish string escapes.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test.output test.error test.error.old

View File

@@ -18,9 +18,10 @@
# Test guestfish events.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-events.out

View File

@@ -18,9 +18,10 @@
# Test guestfish file attributes commands (chmod, copy-attributes, etc).
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-file-attrs.out

View File

@@ -18,9 +18,10 @@
# Test find0 call.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
skip_unless_test_iso

View File

@@ -18,9 +18,10 @@
# Test guestfish glob command.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-glob.img test-glob.out

View File

@@ -16,9 +16,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
skip_unless_phony_guest fedora.img

View File

@@ -19,9 +19,10 @@
# Test passing invalid parameters for memory size, smp, etc when setting up
# the appliance.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
# Memory size

View File

@@ -18,7 +18,10 @@
# Test guestfish mount-local / mount-local-run commands.
$TEST_FUNCTIONS
source ../tests/functions.sh
set -e
set -x
skip_if_skipped
skip_unless_fuse

View File

@@ -18,9 +18,10 @@
# Test read_file call.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
skip_unless_test_iso

View File

@@ -18,9 +18,10 @@
# Test remote events in guestfish.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
eval "$(guestfish --listen)"

View File

@@ -18,9 +18,10 @@
# Test remote control of guestfish.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-remote.img

View File

@@ -19,9 +19,10 @@
# Test reopening the handle in the same process. This used to fail
# but was corrected in 03e1f74ee08dc71bc09cc7655bf4732685f80b43.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-reopen.img

View File

@@ -16,9 +16,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
skip_unless_phony_guest fedora.img

View File

@@ -18,9 +18,10 @@
# Test remote control of guestfish.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
rm -f test-stringlist.img

View File

@@ -21,9 +21,10 @@
# RHBZ#511372 guestfish doesn't understand '~' in filenames
# and multiple other fixes to tilde handling.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
# Set XDG_CACHE_HOME correctly, unless set already. See:

View File

@@ -20,9 +20,10 @@
# target to a directory instead of the full filename, then previously
# libguestfs would hang. It should return an error instead.
source ../tests/functions.sh
set -e
set -x
$TEST_FUNCTIONS
skip_if_skipped
skip_unless_test_iso