echo "overlay is not writable" >> /run/failed
fi
-if grep -qE 'rd\.overlay=(LABEL|UUID|PARTUUID|PARTLABEL|/dev/)' /proc/cmdline; then
- if grep -q "rd.overlay=LABEL=NONEXISTENT" /proc/cmdline; then
- if grep -q "/run/overlayfs-backing" /proc/mounts; then
- echo "non-existent device should have fallen back to tmpfs but backing is mounted" >> /run/failed
- fi
- else
- if ! grep -q "/run/overlayfs-backing" /proc/mounts; then
- echo "persistent overlay device not mounted at /run/overlayfs-backing" >> /run/failed
- fi
+if grep -q 'test.expect=device' /proc/cmdline; then
+ if ! grep -q "/run/overlayfs-backing" /proc/mounts; then
+ echo "persistent overlay device not mounted at /run/overlayfs-backing" >> /run/failed
fi
else
- # tmpfs mode - verify persistent backing is NOT mounted
if grep -q "/run/overlayfs-backing" /proc/mounts; then
- echo "tmpfs mode but persistent backing is mounted at /run/overlayfs-backing" >> /run/failed
+ echo "persistent overlay device is mounted at /run/overlayfs-backing" >> /run/failed
fi
fi
local overlay_uuid
overlay_uuid=$(blkid -s UUID -o value "$TESTDIR"/overlay.img)
- client_run "tmpfs overlay" "rd.overlayfs=1"
- client_run "persistent device overlay (LABEL)" "rd.overlay=LABEL=OVERLAY"
- client_run "persistent device overlay (UUID)" "rd.overlay=UUID=$overlay_uuid"
+ client_run "tmpfs overlay" "rd.overlayfs=1 test.expect=tmpfs"
+ client_run "persistent device overlay (LABEL)" "rd.overlay=LABEL=OVERLAY test.expect=device"
+ client_run "persistent device overlay (UUID)" "rd.overlay=UUID=$overlay_uuid test.expect=device"
client_run "persistent device overlay (device path)" \
- "rd.overlay=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_overlay"
- client_run "fallback to tmpfs (non-existent LABEL)" "rd.overlay=LABEL=NONEXISTENT"
+ "rd.overlay=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_overlay test.expect=device"
+ client_run "fallback to tmpfs (non-existent LABEL)" "rd.overlay=LABEL=NONEXISTENT test.expect=tmpfs"
}
test_setup() {