Skip to content

Commit 027eee9

Browse files
LaszloGombosjohannbg
authored andcommitted
test(DMSQUASH): add test for overlay on top of a block device
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.
1 parent d091014 commit 027eee9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ mkfs.ext4 -q -L dracut /dev/disk/by-id/ata-disk_root
1515
mkdir -p /root
1616
mount /dev/disk/by-id/ata-disk_root /root
1717
mkdir -p /root/run /root/testdir
18+
cp -a -t /root /source/*
1819
echo "Creating squashfs"
1920
mksquashfs /source /root/testdir/rootfs.img -quiet
2021
umount /root

test/TEST-16-DMSQUASH/test.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ test_run() {
1616
qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker
1717
qemu_add_drive_args disk_index disk_args "$TESTDIR"/root.img root
1818

19+
"$testdir"/run-qemu \
20+
"${disk_args[@]}" \
21+
-boot order=d \
22+
-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" \
23+
-initrd "$TESTDIR"/initramfs.testing
24+
1925
"$testdir"/run-qemu \
2026
"${disk_args[@]}" \
2127
-boot order=d \
@@ -103,7 +109,7 @@ test_setup() {
103109
export initdir="$TESTDIR"/overlay
104110
# shellcheck disable=SC1090
105111
. "$basedir"/dracut-init.sh
106-
inst_multiple poweroff shutdown mkfs.ext4 find
112+
inst_multiple poweroff shutdown mkfs.ext4
107113
inst_hook shutdown-emergency 000 ./hard-off.sh
108114
inst_hook emergency 000 ./hard-off.sh
109115
)

0 commit comments

Comments
 (0)