]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
feat(test-makeroot): add new module to share code between tests
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Wed, 19 Oct 2022 00:15:54 +0000 (00:15 +0000)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Mon, 7 Nov 2022 17:04:47 +0000 (18:04 +0100)
This module is used for tests to create root filesystem.

modules.d/80test-makeroot/module-setup.sh [new file with mode: 0755]
test/TEST-03-USR-MOUNT/test.sh

diff --git a/modules.d/80test-makeroot/module-setup.sh b/modules.d/80test-makeroot/module-setup.sh
new file mode 100755 (executable)
index 0000000..798c7b8
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+check() {
+    # Only include the module if another module requires it
+    return 255
+}
+
+depends() {
+    echo "qemu"
+}
index 5fffcf30ad1f30f354313b74dfdd585c14651277..bfb874a2b9593ba3e6084e72a9b383e31a4fc9e0 100755 (executable)
@@ -97,7 +97,7 @@ test_setup() {
     # 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 / \
-        -m "dash btrfs rootfs-block kernel-modules qemu" \
+        -m "test-makeroot dash btrfs rootfs-block kernel-modules" \
         -d "piix ide-gd_mod ata_piix btrfs sd_mod" \
         --nomdadmconf \
         --nohardlink \