Remove unnecessary opinionated parts of the test cases.
Do not add and manage drivers manually in the test case unless
the test case is specifically testing for that.
Consolidate test configurations into common comfig files
when possible.
do_strip="no"
do_hardlink="no"
early_microcode="no"
-hostonly_cmdline="no"
+hostonly="no"
stdloglvl=2
+mdadmconf="no"
+
+# testsuite assumes the following drivers for convenience
+add_drivers+=" ext4 sd_mod "
do_strip="no"
do_hardlink="no"
early_microcode="no"
-hostonly_cmdline="no"
+hostonly="no"
stdloglvl=2
+keep=yes
+
+# testsuite assumes the following drivers for convenience
+add_drivers+=" ext4 sd_mod "
test_setup() {
# create root filesystem
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-f "$TESTDIR"/initramfs.root
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
--mount "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root /usr btrfs subvol=usr,rw" \
-f "$TESTDIR"/initramfs.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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-I "mkfs.btrfs" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
test_setup() {
# Create what will eventually be our root filesystem
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
"$TESTDIR"/tmp-initramfs.root
test_setup() {
# create root filesystem
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-f "$TESTDIR"/initramfs.root
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-f "$TESTDIR"/initramfs.root
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# devices, volume groups, encrypted partitions, etc.
# shellcheck disable=SC2046
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-a "lvm" \
-I "grep" \
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-f "$TESTDIR"/initramfs.root
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# 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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-a "bash crypt lvm mdraid" \
-I "grep cryptsetup" \
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-i ./test-init.sh /sbin/init-persist \
-f "$TESTDIR"/initramfs.root
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-f "$TESTDIR"/initramfs.root
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# 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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir "test-makeroot" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
- --nomdadmconf \
- -N \
-f "$TESTDIR"/initramfs.makeroot
declare -a disk_args=()
fi
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-a "$dracut_modules" \
-f "$TESTDIR"/initramfs.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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-a "btrfs crypt" \
-I "mkfs.btrfs cryptsetup" \
test_setup() {
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-f "$TESTDIR"/initramfs.root
mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.*
# 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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
- --nomdadmconf \
- -N \
-f "$TESTDIR"/initramfs.makeroot
declare -a disk_args=()
test_setup() {
# create root filesystem
# shellcheck disable=SC2153
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-f "$TESTDIR"/initramfs.root
test_setup() {
# create root filesystem
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
-I "ip" \
-i "./assertion.sh" "/assertion.sh" \
--add-confdir test-root \
}
test_setup() {
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-a "url-lib nfs" \
-I "ip grep setsid" \
mkdir -p "$TESTDIR"/server/overlay
# Create what will eventually be the server root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR"/server/overlay \
+ "$DRACUT" --tmpdir "$TESTDIR"/server/overlay \
--add-confdir test-root \
-a "bash $USE_NETWORK nfs" \
--add-drivers "nfsd sunrpc lockd" \
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -i "$TESTDIR"/server/overlay / \
--add-confdir test-makeroot \
- -a "bash rootfs-block kernel-modules qemu" \
- --add-drivers "ext4" \
- -I "mkfs.ext4" \
+ -a "bash" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
- --nomdadmconf \
- -N \
-f "$TESTDIR"/initramfs.makeroot
rm -rf -- "$TESTDIR"/server
-a "bash $USE_NETWORK ${SERVER_DEBUG:+debug}" \
--include ./server.link /etc/systemd/network/01-server.link \
--include ./wait-if-server.sh /lib/dracut/hooks/pre-mount/99-wait-if-server.sh \
- --add-drivers "ext4" \
-N \
-f "$TESTDIR"/initramfs.server
}
test_setup() {
# Create what will eventually be the client root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-I "ip grep setsid" \
-f "$TESTDIR"/initramfs.root
-a "crypt lvm mdraid" \
-I "setsid blockdev" \
-i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \
- -N \
-f "$TESTDIR"/initramfs.makeroot
rm -rf -- "$TESTDIR"/overlay
rm -- "$TESTDIR"/marker.img
# Create what will eventually be the server root filesystem onto an overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-a "$USE_NETWORK" \
-d "iscsi_tcp crc32c ipv6" \
# 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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \
-f "$TESTDIR"/initramfs.makeroot
"$DRACUT" \
-a "$USE_NETWORK" \
--add-confdir test \
- -d "piix ide-gd_mod ata_piix ext4 sd_mod drbg virtio_net virtio_pci virtio_scsi" \
-i "./server.link" "/etc/systemd/network/01-server.link" \
-i ./wait-if-server.sh /lib/dracut/hooks/pre-mount/99-wait-if-server.sh \
-N \
-a "crypt lvm mdraid" \
-I "setsid blockdev" \
-i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \
- -N \
-f "$TESTDIR"/initramfs.makeroot
rm -rf -- "$TESTDIR"/overlay
rm -- "$TESTDIR"/marker.img
rm -rf -- "$TESTDIR"/overlay
- "$DRACUT" -N --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-a "$USE_NETWORK iscsi" \
-d "iscsi_tcp crc32c ipv6 af_packet" \
# 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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \
-f "$TESTDIR"/initramfs.makeroot
# Make server's dracut image
"$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test \
- -a "rootfs-block kernel-modules $USE_NETWORK ${SERVER_DEBUG:+debug}" \
- -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod drbg virtio_net" \
+ -a "$USE_NETWORK ${SERVER_DEBUG:+debug}" \
-i "./server.link" "/etc/systemd/network/01-server.link" \
-i "./wait-if-server.sh" "/lib/dracut/hooks/pre-mount/99-wait-if-server.sh" \
-N \
make_encrypted_root() {
rm -fr "$TESTDIR"/overlay
# Create what will eventually be our root filesystem onto an overlay
- "$DRACUT" --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-I "ip grep" \
--no-hostonly \
-a "crypt lvm mdraid" \
-I "cryptsetup" \
-i ./create-encrypted-root.sh /lib/dracut/hooks/initqueue/01-create-encrypted-root.sh \
- -N \
-f "$TESTDIR"/initramfs.makeroot
rm -rf -- "$TESTDIR"/overlay
make_client_root() {
rm -fr "$TESTDIR"/overlay
- "$DRACUT" --keep --tmpdir "$TESTDIR" \
+ "$DRACUT" --tmpdir "$TESTDIR" \
--add-confdir test-root \
-I "ip" \
--no-hostonly \
"$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \
- --nomdadmconf \
- -N \
-f "$TESTDIR"/initramfs.makeroot
declare -a disk_args=()
# 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.
- "$DRACUT" -N -i "$TESTDIR"/overlay / \
+ "$DRACUT" -i "$TESTDIR"/overlay / \
--add-confdir test-makeroot \
-a "$USE_NETWORK" \
-i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \
- --nomdadmconf \
- -N \
-f "$TESTDIR"/initramfs.makeroot
declare -a disk_args=()
"$DRACUT" -N -i "$TESTDIR"/overlay / \
--add-confdir test \
-a "$USE_NETWORK ${SERVER_DEBUG:+debug}" \
- -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod drbg virtio_net" \
-i "./server.link" "/etc/systemd/network/01-server.link" \
-i "./wait-if-server.sh" "/lib/dracut/hooks/pre-mount/99-wait-if-server.sh" \
-f "$TESTDIR"/initramfs.server