]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test(DMSQUASH): add test for overlay on top of a block device
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Mon, 15 Aug 2022 19:45:09 +0000 (19:45 +0000)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Thu, 29 Sep 2022 05:27:49 +0000 (05:27 +0000)
Add a test for mounting root filesystem with overlay for /dev/sdb.

The existing test was testing mounting root filesystem with overlay
from a squashfs image file.

test/TEST-16-DMSQUASH/create-root.sh
test/TEST-16-DMSQUASH/test.sh

index 9bc1aa5dc8ba8ffab11d49c8c29ba2b4f2ae06b3..0a68c1fbccc682df490447a2635372a04ee6c5e3 100755 (executable)
@@ -15,6 +15,7 @@ mkfs.ext4 -q -L dracut /dev/disk/by-id/ata-disk_root
 mkdir -p /root
 mount /dev/disk/by-id/ata-disk_root /root
 mkdir -p /root/run /root/testdir
+cp -a -t /root /source/*
 echo "Creating squashfs"
 mksquashfs /source /root/testdir/rootfs.img -quiet
 umount /root
index 5202937549adb6d5cb144dbb7b8125e34f3c275c..f02d615b7920fac4e750652c6db55efb1029c6b8 100755 (executable)
@@ -16,6 +16,12 @@ test_run() {
     qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker
     qemu_add_drive_args disk_index disk_args "$TESTDIR"/root.img root
 
+    "$testdir"/run-qemu \
+        "${disk_args[@]}" \
+        -boot order=d \
+        -append "rd.live.image rd.live.overlay.overlayfs=1 root=LABEL=dracut console=ttyS0,115200n81 quiet selinux=0 rd.info rd.shell=0 panic=1 oops=panic softlockup_panic=1 $DEBUGFAIL" \
+        -initrd "$TESTDIR"/initramfs.testing
+
     "$testdir"/run-qemu \
         "${disk_args[@]}" \
         -boot order=d \
@@ -103,7 +109,7 @@ test_setup() {
         export initdir="$TESTDIR"/overlay
         # shellcheck disable=SC1090
         . "$basedir"/dracut-init.sh
-        inst_multiple poweroff shutdown mkfs.ext4 find
+        inst_multiple poweroff shutdown mkfs.ext4
         inst_hook shutdown-emergency 000 ./hard-off.sh
         inst_hook emergency 000 ./hard-off.sh
     )