Skip to content

Commit fca1778

Browse files
committed
tests: Replace $TEST_FUNCTIONS
The same change as in this libguestfs commit: libguestfs/libguestfs@b5fbc7e Also update the common submodule to get: commit 8137d47d0e654065391151eb275e3b64f230f6f5 Author: Richard W.M. Jones <[email protected]> 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. commit a4d620ddef0feee290e72924c245d98952ad3b0c Merge: 2bb8c83 91d89a5 Author: rwmjones <[email protected]> Date: Wed Feb 12 21:59:29 2025 +0000 Merge pull request #7 from crobinso/remove-remove mldrivers/linux.ml: delete `Remove` commit 91d89a574ee6aeeb7f61c58c9e223fdb29de8459 Author: Cole Robinson <[email protected]> Date: Wed Feb 12 16:44:09 2025 -0500 mldrivers/linux.ml: delete `Remove` Last usages were removed in libguestfs/virt-v2v@b3268a1 Signed-off-by: Cole Robinson <[email protected]> commit 2bb8c83c1ce5d10d35e5470464e4b9de5034673b Merge: 40bfeed 3831560 Author: rwmjones <[email protected]> Date: Sun Feb 9 17:33:27 2025 +0000 Merge pull request #6 from rwmjones/RHEL-77989 mldrivers/linux_bootloaders.ml: Don't overwrite EFI grub2 wrapper commit 38315604596ac747e44e38db79496610efee49f8 Author: Richard W.M. Jones <[email protected]> Date: Thu Feb 6 08:04:38 2025 +0000 mldrivers/linux_bootloaders.ml: Don't overwrite EFI grub2 wrapper Fedora 34+ and RHEL 9.0+ unified BIOS and UEFI grub configuration into a single file. This leaves /boot/efi/EFI/<OS>/grub.cfg as a so-called "wrapper" which just loads the real grub2 configuration at /boot/grub2/grub.cfg. Running '/sbin/grub2-mkconfig -o /boot/efi/EFI/<OS>/grub.cfg' overwrites the wrapper instead of the real configuration file. RHEL 9.5 added a hard error if you try to do this, which broke virt-v2v. The error message was: commandrvf: /sbin/grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg Running `grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg' will overwrite the GRUB wrapper. Please run `grub2-mkconfig -o /boot/grub2/grub.cfg' instead to update grub.cfg. Try to detect this situation and substitute the real grub configuration file instead. Reported-by: Robert Knipp, Fabian Deutsch Thanks: Nijin Ashok, Marta Lewandowska Fixes: https://issues.redhat.com/browse/RHEL-77989 Related: https://issues.redhat.com/browse/RHEL-32099 Related: https://fedoraproject.org/wiki/Changes/UnifyGrubConfig commit 40bfeed7339b830ce5bd9526599acad36e73f74d Author: Richard W.M. Jones <[email protected]> Date: Thu Feb 6 08:04:18 2025 +0000 mldrivers/linux_bootloaders.ml: Fix comment style
1 parent 556c75b commit fca1778

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+157
-84
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,6 @@ Makefile.in
149149
/test-data/phony-guests/windows.img
150150
/test-data/phony-guests/windows-software
151151
/test-data/phony-guests/windows-system
152+
/tests/functions.sh
152153
/website/*.html
153154
/win-reg/virt-win-reg

Makefile.am

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ endif
4747
# Data used by the tests.
4848
SUBDIRS += test-data
4949

50+
# Not used but needed.
51+
SUBDIRS += tests
52+
5053
# virt-tools in C.
5154
SUBDIRS += align cat diff df edit format inspector make-fs
5255

align/test-virt-alignment-scan-docs.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
$top_srcdir/podcheck.pl "$srcdir/virt-alignment-scan.pod" virt-alignment-scan \

align/test-virt-alignment-scan-guests.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19-
$TEST_FUNCTIONS
19+
source ../tests/functions.sh
20+
# set -e # command below fails
21+
set -x
22+
2023
skip_if_skipped
2124

2225
libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests-all-good.xml"

align/test-virt-alignment-scan.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19-
$TEST_FUNCTIONS
19+
source ../tests/functions.sh
20+
# set -e # command below fails
21+
set -x
22+
2023
skip_if_skipped
2124

2225
$VG virt-alignment-scan --format=raw -a ../test-data/phony-guests/fedora.img

bash/test-complete-in-script.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
# Test that the correct 'complete' command is included in the script.
2020
# Mainly prevents symlinking errors and some omissions.
2121

22-
$TEST_FUNCTIONS
22+
source ../tests/functions.sh
23+
set -e
24+
set -x
25+
2326
skip_if_skipped
2427

2528
if [ -z "$commands" ]; then

builder/test-console.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
# The script currently assumes a Linux guest. We should test Windows,
2525
# FreeBSD in future (XXX).
2626

27+
source ../tests/functions.sh
2728
set -e
29+
set -x
2830

29-
$TEST_FUNCTIONS
30-
slow_test
3131
skip_if_skipped "$script"
32+
slow_test
3233

3334
guestname="$1"
3435
if [ -z "$guestname" ]; then

builder/test-docs.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
$top_srcdir/podcheck.pl "$srcdir/virt-builder.pod" virt-builder \

builder/test-virt-builder-cacheall.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
tmpdir="$(mktemp -d)"

builder/test-virt-builder-list-simplestreams.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
export XDG_CONFIG_HOME=

builder/test-virt-builder-list.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818

1919
# Test the virt-builder --list [--long] options.
2020

21+
source ../tests/functions.sh
2122
set -e
23+
set -x
2224

23-
$TEST_FUNCTIONS
2425
skip_if_skipped
2526

2627
export XDG_CONFIG_HOME=

builder/test-virt-builder-planner.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818

1919
set -e
2020

21-
$TEST_FUNCTIONS
22-
slow_test
21+
source ../tests/functions.sh
22+
set -e
23+
set -x
24+
2325
skip_if_skipped
26+
slow_test
2427

2528
export XDG_CONFIG_HOME=
2629
export VIRT_BUILDER_DIRS="$abs_builddir/test-config"

builder/test-virt-builder-repository.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818

1919
set -e
2020

21-
$TEST_FUNCTIONS
22-
slow_test
21+
source ../tests/functions.sh
22+
set -e
23+
set -x
24+
2325
skip_if_skipped "$script"
26+
slow_test
2427

2528
test_data=repository-testdata
2629
rm -rf $test_data

builder/test-virt-builder.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
export XDG_CONFIG_HOME=

cat/test-docs.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
$top_srcdir/podcheck.pl "$srcdir/virt-cat.pod" virt-cat \

cat/test-virt-cat.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
# Read out the test files from the image using virt-cat.

cat/test-virt-filesystems.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
output="$($VG virt-filesystems --format=raw -a ../test-data/phony-guests/fedora.img | sort)"

cat/test-virt-log.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
can_handle ()

cat/test-virt-ls.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
# Read out the test directory using virt-ls.

cat/test-virt-tail.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
# in the guestfish instance we append to the file, and we check that
2222
# the addenda are displayed by virt-tail.
2323

24+
source ../tests/functions.sh
2425
set -e
2526
set -x
2627

27-
$TEST_FUNCTIONS
2828
skip_if_skipped
2929

3030
# Libvirt screws with the SELinux labels, preventing guestfish from

configure.ac

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ AC_CONFIG_FILES([podwrapper.pl],
9999
[chmod +x,-w podwrapper.pl])
100100
AC_CONFIG_FILES([run],
101101
[chmod +x,-w run])
102+
AC_CONFIG_FILES([tests/functions.sh],
103+
[chmod +x,-w tests/functions.sh])
102104
AC_CONFIG_FILES([win-reg/virt-win-reg],
103105
[chmod +x,-w win-reg/virt-win-reg])
104106

@@ -157,6 +159,7 @@ AC_CONFIG_FILES([Makefile
157159
test-data/blank-disks/Makefile
158160
test-data/phony-guests/Makefile
159161
test-data/phony-guests/guests.xml
162+
tests/Makefile
160163
win-reg/Makefile])
161164

162165
AC_OUTPUT

customize/test-settings.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
# NB. 'test-settings.sh' runs the tests, but the various tests are
2222
# run via the 'test-settings-GUESTNAME.sh' wrappers.
2323

24+
source ../tests/functions.sh
2425
set -e
2526
set -x
2627

27-
$TEST_FUNCTIONS
2828
slow_test
2929
skip_if_skipped "$script"
3030

customize/test-virt-customize-docs.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
23+
skip_if_skipped
2224

2325
$top_srcdir/podcheck.pl "$srcdir/virt-customize.pod" virt-customize \
2426
--path $top_srcdir/common/options \

customize/test-virt-customize.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
2021
set -x
2122

22-
$TEST_FUNCTIONS
2323
skip_if_skipped
2424
skip_unless_phony_guest fedora.img
2525

df/test-virt-df-docs.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
23+
skip_if_skipped
2224

2325
$top_srcdir/podcheck.pl "$srcdir/virt-df.pod" virt-df \
2426
--path $top_srcdir/common/options

df/test-virt-df-guests.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818

1919
# Run virt-df on the test guests.
2020

21+
source ../tests/functions.sh
2122
set -e
23+
set -x
2224

23-
$TEST_FUNCTIONS
2425
skip_if_skipped
2526

2627
libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml"

df/test-virt-df.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
23+
skip_if_skipped
2224

2325
# Run virt-df.
2426
output=$($VG virt-df --format=raw -a ../test-data/phony-guests/fedora.img)

diff/test-virt-diff-docs.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
23+
skip_if_skipped
2224

2325
$top_srcdir/podcheck.pl "$srcdir/virt-diff.pod" virt-diff \
2426
--path $top_srcdir/common/options \

diff/test-virt-diff.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324
skip_unless_phony_guest fedora.img
2425

drivers/test-virt-drivers-docs.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324

2425
$top_srcdir/podcheck.pl "$srcdir/virt-drivers.pod" virt-drivers \

drivers/test-virt-drivers-linux.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324
skip_unless_phony_guest fedora.img
2425

drivers/test-virt-drivers-windows.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818

19+
source ../tests/functions.sh
1920
set -e
21+
set -x
2022

21-
$TEST_FUNCTIONS
2223
skip_if_skipped
2324
skip_unless_phony_guest windows.img
2425

0 commit comments

Comments
 (0)