]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test(DMSQUASH): add coverage for more dracut modules inside the iso
authorJo Zzsi <jozzsicsataban@gmail.com>
Sun, 28 Sep 2025 02:00:15 +0000 (22:00 -0400)
committerLaszlo <laszlo.gombos@gmail.com>
Sun, 28 Sep 2025 12:34:07 +0000 (08:34 -0400)
The list of additionally included dracut modules are inspired by
the list in the Fedora iso.

Most notably, this commit adds networking into the iso.

See https://github.com/livecd-tools/livecd-tools/blob/main/imgcreate/live.py .

test/TEST-30-DMSQUASH/test.sh

index 92a27600d75f11c031c4ab54dde17b2b43d62189..cd4e2357a8697d477d9531a3f9ee06effb039c6d 100755 (executable)
@@ -1,6 +1,8 @@
 #!/usr/bin/env bash
 set -eu
 
+[ -z "${TEST_FSTYPE-}" ] && TEST_FSTYPE="ext4"
+
 # shellcheck disable=SC2034
 TEST_DESCRIPTION="live root on a squash filesystem"
 
@@ -125,9 +127,23 @@ EOF
         mkfs.ext4 -q -L dracut_iso -d "$TESTDIR"/iso/ "$TESTDIR"/root_iso.img && sync "$TESTDIR"/root_iso.img
     fi
 
+    local dracut_modules="dmsquash-live-autooverlay convertfs pollcdrom kernel-modules kernel-modules-extra qemu qemu-net"
+
+    if type -p ntfs-3g &> /dev/null; then
+        dracut_modules="$dracut_modules dmsquash-live-ntfs"
+    fi
+
+    if type -p NetworkManager &> /dev/null; then
+        dracut_modules="$dracut_modules network-manager"
+        if type -p curl &> /dev/null; then
+            dracut_modules="$dracut_modules livenet"
+        fi
+    fi
+
     test_dracut \
         --no-hostonly \
-        --modules "dmsquash-live-autooverlay kernel-modules"
+        --add-drivers "${TEST_FSTYPE}" \
+        --modules " $dracut_modules "
 }
 
 # shellcheck disable=SC1090