From: Benjamin Drung Date: Wed, 16 Aug 2023 09:06:16 +0000 (+0200) Subject: test: make dracut directory configurable X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9939d0e1f1e17cc5d33cba55717ac063d21a048;p=thirdparty%2Fdracut.git test: make dracut directory configurable Make the directory of the `dracut.sh` script configurable to allow running the test suite out-of-tree. This change is used to run the test suite against the installed dracut in an autopkgtest for the Debian/Ubuntu package. Signed-off-by: Benjamin Drung --- diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index b877dbdf5..28016663e 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -23,7 +23,7 @@ test_run() { test_setup() { # Create what will eventually be our root filesystem onto an overlay - "$basedir"/dracut.sh -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ -m "test-root" \ -i ./test-init.sh /sbin/init \ -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \ @@ -36,7 +36,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "test-makeroot" \ -I "mkfs.ext4" \ -i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \ @@ -59,7 +59,7 @@ test_setup() { rm -- "$TESTDIR"/marker.img # make sure --omit-drivers does not filter out drivers using regexp to test for an earlier regression (assuming there is no one letter linux kernel module needed to run the test) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -a "test watchdog" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod i6300esb ib700wdt" \ --omit-drivers 'a b c d e f g h i j k l m n o p q r s t u v w x y z' \ diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index d161905bd..f5d7427af 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -25,7 +25,7 @@ test_run() { test_setup() { # Create what will eventually be our root filesystem onto an overlay - "$basedir"/dracut.sh -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ -m "test-root" \ -i ./test-init.sh /sbin/init \ -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \ @@ -38,7 +38,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "test-makeroot" \ -I "mkfs.ext4" \ -i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \ @@ -62,7 +62,7 @@ test_setup() { # systemd-analyze.sh calls man indirectly # make the man command succeed always - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -a "test systemd" \ -o "network kernel-network-modules" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index 49ee92dab..a6c52ce9b 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -41,7 +41,7 @@ test_run() { test_setup() { # Create what will eventually be our root filesystem onto an overlay - "$basedir"/dracut.sh -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ -m "test-root" \ -i ./test-init.sh /sbin/init \ -i ./fstab /etc/fstab \ @@ -55,7 +55,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "test-makeroot" \ -I "mkfs.btrfs" \ -i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \ @@ -83,7 +83,7 @@ test_setup() { return 1 fi - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -a "test watchdog" \ -o "network kernel-network-modules" \ -d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \ diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index c19e003e5..078363b5c 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -51,7 +51,7 @@ test_setup() { shopt -q -s globstar # Create what will eventually be our root filesystem onto an overlay - "$basedir"/dracut.sh -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ -m "test-root dbus" \ -I "ldconfig" \ -i ./test-init.sh /sbin/test-init \ @@ -116,7 +116,7 @@ EOF # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "test-makeroot bash btrfs" \ -I "mkfs.btrfs" \ -i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \ @@ -148,7 +148,7 @@ EOF [ -e /etc/machine-id ] && EXTRA_MACHINE="/etc/machine-id" [ -e /etc/machine-info ] && EXTRA_MACHINE+=" /etc/machine-info" - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -a "test systemd i18n qemu" \ ${EXTRA_MACHINE:+-I "$EXTRA_MACHINE"} \ -o "network plymouth lvm mdraid resume crypt caps dm terminfo usrmount kernel-network-modules rngd" \ diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index 28a1b0235..9b263d97d 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -73,7 +73,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash crypt lvm mdraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --nomdadmconf \ @@ -112,7 +112,7 @@ test_setup() { echo -n "test" > "$initdir"/etc/key ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index 710fdf485..38597c2e4 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -74,7 +74,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash lvm mdraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --no-hostonly-cmdline -N \ @@ -105,7 +105,7 @@ test_setup() { inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 1503476bc..b4c51e4fc 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -104,7 +104,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash crypt lvm mdraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --no-hostonly-cmdline -N \ @@ -148,7 +148,7 @@ test_setup() { chmod 0600 "$initdir"/etc/key ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index c491e5d9c..d9e734908 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -100,7 +100,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash crypt lvm mdraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --no-hostonly-cmdline -N \ @@ -146,7 +146,7 @@ test_setup() { echo -n test > "$initdir"/etc/key chmod 0600 "$initdir"/etc/key ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh index 61f3ad15a..227f05ee2 100755 --- a/test/TEST-14-IMSM/test.sh +++ b/test/TEST-14-IMSM/test.sh @@ -98,7 +98,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash lvm mdraid dmraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod dm-multipath dm-crypt dm-round-robin faulty linear multipath raid0 raid10 raid1 raid456" \ --no-hostonly-cmdline -N \ @@ -136,7 +136,7 @@ test_setup() { inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index fe16e1b2f..2080672d4 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -76,7 +76,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash btrfs rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ --nomdadmconf \ @@ -111,7 +111,7 @@ test_setup() { inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" \ -d "piix ide-gd_mod ata_piix btrfs sd_mod" \ diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index af9440172..95157084e 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -81,7 +81,7 @@ test_run() { test_setup() { # Create what will eventually be our root filesystem onto an overlay - "$basedir"/dracut.sh -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ -m "test-root" \ -i ./test-init.sh /sbin/init \ -i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \ @@ -94,7 +94,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ --modules "test-makeroot" \ --install "sfdisk mkfs.ext4 mkfs.ntfs mksquashfs" \ --drivers "ntfs3" \ @@ -131,7 +131,7 @@ test_setup() { SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs3" EOF - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ --modules "test dash dmsquash-live qemu" \ --omit "rngd" \ --drivers "ext4 ntfs3 sd_mod" \ @@ -140,7 +140,7 @@ EOF --no-hostonly --no-hostonly-cmdline \ --force "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ --modules "test dmsquash-live-autooverlay qemu" \ --omit "rngd" \ --drivers "ext4 sd_mod" \ diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh index aff5dc540..9dc16e2d0 100755 --- a/test/TEST-17-LVM-THIN/test.sh +++ b/test/TEST-17-LVM-THIN/test.sh @@ -72,7 +72,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash lvm mdraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --no-hostonly-cmdline -N \ @@ -103,7 +103,7 @@ test_setup() { inst_hook shutdown-emergency 000 ./hard-off.sh inst_hook emergency 000 ./hard-off.sh ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth network kernel-network-modules" \ -a "debug" -I lvs \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ diff --git a/test/TEST-18-UEFI/test.sh b/test/TEST-18-UEFI/test.sh index fabb6bc8b..4191fed5d 100755 --- a/test/TEST-18-UEFI/test.sh +++ b/test/TEST-18-UEFI/test.sh @@ -41,7 +41,7 @@ test_dracut() { # shellcheck disable=SC2162 IFS=' ' read -a TEST_DRACUT_ARGS_ARRAY <<< "$TEST_DRACUT_ARGS" - "$basedir"/dracut.sh "$@" \ + "$DRACUT" "$@" \ --kernel-cmdline "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot selinux=0 console=ttyS0,115200n81 $DEBUGFAIL" \ "${TEST_DRACUT_ARGS_ARRAY[@]}" || return 1 } @@ -62,7 +62,7 @@ test_run() { test_setup() { # Create what will eventually be our root filesystem - "$basedir"/dracut.sh --local --no-hostonly --no-early-microcode --nofscks \ + "$DRACUT" --local --no-hostonly --no-early-microcode --nofscks \ --tmpdir "$TESTDIR" --keep --modules "test-root" --include ./test-init.sh /sbin/init \ "$TESTDIR"/tmp-initramfs.root "$KVERSION" || return 1 diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 8a852ed13..6040544c0 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -362,7 +362,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/server/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/server/overlay / \ -m "bash rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --nomdadmconf \ @@ -398,7 +398,7 @@ test_setup() { ) # Make client's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth" \ -a "dmsquash-live debug watchdog ${USE_NETWORK}" \ --no-hostonly-cmdline -N \ @@ -414,7 +414,7 @@ test_setup() { inst_hook pre-mount 99 ./wait-if-server.sh ) # Make server's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "dash rootfs-block debug kernel-modules watchdog qemu network network-legacy" \ -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod e1000 i6300esb" \ --no-hostonly-cmdline -N \ diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index bfc3a548a..a3d7058a4 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -130,7 +130,7 @@ test_check() { test_setup() { # Create what will eventually be the client root filesystem onto an overlay - "$basedir"/dracut.sh -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ -m "test-root" \ -i ./client-init.sh /sbin/init \ -I "ip ping grep setsid" \ @@ -145,7 +145,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "test-makeroot crypt lvm mdraid" \ -I "mkfs.ext4 setsid blockdev" \ -i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \ @@ -169,7 +169,7 @@ test_setup() { rm -- "$TESTDIR"/marker.img # Create what will eventually be the server root filesystem onto an overlay - "$basedir"/dracut.sh -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ -m "test-root network network-legacy" \ -d "iscsi_tcp crc32c ipv6" \ -i ./server-init.sh /sbin/init \ @@ -189,7 +189,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "test-makeroot" \ -I "mkfs.ext4" \ -i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \ @@ -213,7 +213,7 @@ test_setup() { rm -- "$TESTDIR"/marker.img # Make server's dracut image - "$basedir"/dracut.sh -l \ + "$DRACUT" -l \ -a "dash rootfs-block test kernel-modules network network-legacy" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod e1000 drbg" \ -i "./server.link" "/etc/systemd/network/01-server.link" \ diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh index 3cee87abd..7b6125420 100755 --- a/test/TEST-35-ISCSI-MULTI/test.sh +++ b/test/TEST-35-ISCSI-MULTI/test.sh @@ -189,7 +189,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "dash crypt lvm mdraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --no-hostonly-cmdline -N \ @@ -274,7 +274,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "dash rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --nomdadmconf \ @@ -309,7 +309,7 @@ test_setup() { inst_simple ./client.link /etc/systemd/network/01-client.link ) # Make client's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth dmraid nfs" \ -a "debug ${USE_NETWORK}" \ --no-hostonly-cmdline -N \ @@ -325,7 +325,7 @@ test_setup() { inst_hook pre-mount 99 ./wait-if-server.sh ) # Make server's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -a "dash rootfs-block debug kernel-modules network network-legacy" \ -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod e1000 drbg" \ --no-hostonly-cmdline -N \ diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 7ba9075b1..f10299081 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -243,7 +243,7 @@ make_encrypted_root() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "dash crypt lvm mdraid kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --no-hostonly-cmdline -N \ @@ -321,7 +321,7 @@ make_client_root() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "dash rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --nomdadmconf \ @@ -417,7 +417,7 @@ EOF # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "dash rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --nomdadmconf \ @@ -468,7 +468,7 @@ test_setup() { inst_simple ./client.link /etc/systemd/network/01-client.link ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "plymouth iscsi nfs" \ -a "debug watchdog ${USE_NETWORK}" \ --no-hostonly-cmdline -N \ @@ -483,7 +483,7 @@ test_setup() { inst_simple ./server.link /etc/systemd/network/01-server.link inst_hook pre-mount 99 ./wait-if-server.sh ) - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -a "rootfs-block debug kernel-modules network network-legacy" \ -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod e1000 drbg" \ --no-hostonly-cmdline -N \ diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 4499d9e42..dd4e41f5e 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -299,7 +299,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --nomdadmconf \ @@ -337,7 +337,7 @@ test_setup() { inst_hook pre-pivot 85 "$basedir/modules.d/45ifcfg/write-ifcfg.sh" ) # Make client's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -o "ifcfg plymouth" \ -a "debug watchdog ${USE_NETWORK}" \ --no-hostonly-cmdline -N \ @@ -353,7 +353,7 @@ test_setup() { inst_hook pre-mount 99 ./wait-if-server.sh ) # Make server's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "dash rootfs-block debug kernel-modules watchdog qemu network network-legacy" \ -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esb ib700wdt" \ --no-hostonly-cmdline -N \ diff --git a/test/TEST-60-BONDBRIDGEVLAN/test.sh b/test/TEST-60-BONDBRIDGEVLAN/test.sh index 16d23ff37..24f3e37af 100755 --- a/test/TEST-60-BONDBRIDGEVLAN/test.sh +++ b/test/TEST-60-BONDBRIDGEVLAN/test.sh @@ -331,7 +331,7 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ -m "bash rootfs-block kernel-modules qemu" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod" \ --nomdadmconf \ @@ -364,7 +364,7 @@ test_setup() { inst_simple ./client.link /etc/systemd/network/01-client.link ) # Make client's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ --no-early-microcode \ -o "plymouth" \ -a "debug ${USE_NETWORK}" \ @@ -381,7 +381,7 @@ test_setup() { inst_hook pre-mount 99 ./wait-if-server.sh ) # Make server's dracut image - "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -l -i "$TESTDIR"/overlay / \ --no-early-microcode \ -m "rootfs-block debug kernel-modules watchdog qemu network network-legacy" \ -d "ipvlan macvlan af_packet piix ide-gd_mod ata_piix ext4 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd virtio-net i6300esb ib700wdt" \ diff --git a/test/TEST-63-DRACUT-CPIO/test.sh b/test/TEST-63-DRACUT-CPIO/test.sh index be93cfb5e..163bab2ac 100755 --- a/test/TEST-63-DRACUT-CPIO/test.sh +++ b/test/TEST-63-DRACUT-CPIO/test.sh @@ -30,7 +30,7 @@ echo o > /proc/sysrq-trigger sleep 20 EOF - "$basedir"/dracut.sh -l --drivers "" \ + "$DRACUT" -l --drivers "" \ "${dracut_cpio_params[@]}" \ --modules "bash base" \ --include "$tdir/init.sh" /lib/dracut/hooks/emergency/00-init.sh \ diff --git a/test/test-functions b/test/test-functions index abd20ec62..ee8a5920e 100644 --- a/test/test-functions +++ b/test/test-functions @@ -16,13 +16,15 @@ KVERSION=${KVERSION-$(uname -r)} if [[ -z $basedir ]]; then basedir="$(realpath ../..)"; fi +DRACUT=${DRACUT-${basedir}/dracut.sh} + test_dracut() { TEST_DRACUT_ARGS+=" --local --no-hostonly --no-early-microcode --add test --kver $KVERSION" # shellcheck disable=SC2162 IFS=' ' read -a TEST_DRACUT_ARGS_ARRAY <<< "$TEST_DRACUT_ARGS" - "$basedir"/dracut.sh "$@" \ + "$DRACUT" "$@" \ --kernel-cmdline "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot selinux=0 console=ttyS0,115200n81 $DEBUGFAIL" \ "${TEST_DRACUT_ARGS_ARRAY[@]}" || return 1 }