summaryrefslogtreecommitdiffstats
path: root/test/test-fstab-generator
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-fstab-generator')
-rw-r--r--test/test-fstab-generator/.gitattributes1
-rw-r--r--test/test-fstab-generator/test-01-dev-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-01-dev-nfs.input1
-rw-r--r--test/test-fstab-generator/test-02-dhcp.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-02-dhcp.input1
-rw-r--r--test/test-fstab-generator/test-03-dhcp6.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-03-dhcp6.input1
-rw-r--r--test/test-fstab-generator/test-04-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-04-nfs.input1
-rw-r--r--test/test-fstab-generator/test-05-nfs4.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-05-nfs4.input1
-rw-r--r--test/test-fstab-generator/test-06-ipv4.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-06-ipv4.input1
-rw-r--r--test/test-fstab-generator/test-07-ipv6.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-07-ipv6.input1
-rw-r--r--test/test-fstab-generator/test-08-implicit-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-08-implicit-nfs.input1
-rw-r--r--test/test-fstab-generator/test-09-cifs.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-09-cifs.input1
-rw-r--r--test/test-fstab-generator/test-10-iscsi.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-10-iscsi.input1
-rw-r--r--test/test-fstab-generator/test-11-live.expected/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-11-live.input1
-rw-r--r--test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-device.target.d/50-root-device.conf5
l---------test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-12-dev-sdx.expected/initrd-usr-fs.target.requires/sysroot.mount1
-rw-r--r--test/test-fstab-generator/test-12-dev-sdx.expected/sysroot.mount14
-rw-r--r--test/test-fstab-generator/test-12-dev-sdx.expected/systemd-fsck-root.service17
-rw-r--r--test/test-fstab-generator/test-12-dev-sdx.input1
-rw-r--r--test/test-fstab-generator/test-13-label.expected/initrd-root-device.target.d/50-root-device.conf5
l---------test/test-fstab-generator/test-13-label.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-13-label.expected/initrd-usr-fs.target.requires/sysroot.mount1
-rw-r--r--test/test-fstab-generator/test-13-label.expected/sysroot.mount14
-rw-r--r--test/test-fstab-generator/test-13-label.expected/systemd-fsck-root.service17
-rw-r--r--test/test-fstab-generator/test-13-label.input1
-rw-r--r--test/test-fstab-generator/test-14-uuid.expected/initrd-root-device.target.d/50-root-device.conf5
l---------test/test-fstab-generator/test-14-uuid.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-14-uuid.expected/initrd-usr-fs.target.requires/sysroot.mount1
-rw-r--r--test/test-fstab-generator/test-14-uuid.expected/sysroot.mount14
-rw-r--r--test/test-fstab-generator/test-14-uuid.expected/systemd-fsck-root.service17
-rw-r--r--test/test-fstab-generator/test-14-uuid.input1
-rw-r--r--test/test-fstab-generator/test-15-partuuid.expected/initrd-root-device.target.d/50-root-device.conf5
l---------test/test-fstab-generator/test-15-partuuid.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-15-partuuid.expected/initrd-usr-fs.target.requires/sysroot.mount1
-rw-r--r--test/test-fstab-generator/test-15-partuuid.expected/sysroot.mount14
-rw-r--r--test/test-fstab-generator/test-15-partuuid.expected/systemd-fsck-root.service17
-rw-r--r--test/test-fstab-generator/test-15-partuuid.input1
l---------test/test-fstab-generator/test-16-tmpfs.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-16-tmpfs.expected/initrd-usr-fs.target.requires/sysroot.mount1
-rw-r--r--test/test-fstab-generator/test-16-tmpfs.expected/sysroot.mount12
-rw-r--r--test/test-fstab-generator/test-16-tmpfs.input1
l---------test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot-usr.mount1
l---------test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount1
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service0
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot-usr.mount11
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot.mount13
l---------test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-fs.target.requires/sysroot-usr.mount1
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-device.target.d/50-root-device.conf5
l---------test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysusr-usr.mount1
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot-usr.mount11
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot.mount13
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/systemd-fsck-root.service17
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysusr-usr.mount11
-rw-r--r--test/test-fstab-generator/test-17-initrd-sysroot.fstab.input2
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.requires/mnt-requiredby.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.wants/mnt-wantedby.mount1
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf4
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-after.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-automount1.automount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-before.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-growfs.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-mkfs.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-pcrfs.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-reqmounts.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-requires.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-rwonly.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-timeout.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-automount2.automount1
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-nofail.mount1
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service0
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-after.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.automount9
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.automount8
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.mount11
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-before.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service0
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount13
l---------test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service1
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-noauto.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-nofail.mount11
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-pcrfs.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-reqmounts.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requiredby.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requires.mount14
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-rwonly.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-timeout.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-wantedby.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/sysroot.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected.sysroot/systemd-makefs@dev-sdx12.service18
l---------test/test-fstab-generator/test-18-options.fstab.expected/foo.service.requires/mnt-requiredby.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/foo.service.wants/mnt-wantedby.mount1
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-device.target.d/50-root-device.conf5
l---------test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount1
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf4
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-after.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-automount1.automount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-before.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-growfs.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-mkfs.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-pcrfs.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-reqmounts.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-requires.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-rwonly.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-timeout.mount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-automount2.automount1
l---------test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-nofail.mount1
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-after.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.automount9
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.automount8
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.mount11
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-before.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service0
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount13
l---------test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service1
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-noauto.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-nofail.mount11
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-pcrfs.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-reqmounts.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-requiredby.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-requires.mount14
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-rwonly.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-timeout.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/mnt-wantedby.mount12
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/sysroot.mount13
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/systemd-fsck-root.service17
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.expected/systemd-makefs@dev-sdx12.service18
-rw-r--r--test/test-fstab-generator/test-18-options.fstab.input16
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-also_in_initrd.mount14
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-not_in_initrd.mount13
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-also_in_initrd.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-not_in_initrd.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/usr.mount1
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/usr.mount13
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_fstype.mount13
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_options.mount13
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-withx20space.mount12
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-foo-also_in_initrd.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-usr.mount1
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-device.target.d/50-root-device.conf5
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysusr-usr.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_fstype.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_options.mount1
l---------test/test-fstab-generator/test-19-mounts-from-cmdline.expected/remote-fs.target.requires/hoge-withx20space.mount1
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-foo-also_in_initrd.mount15
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-usr.mount11
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot.mount13
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-root.service17
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-usr.service17
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysusr-usr.mount13
-rw-r--r--test/test-fstab-generator/test-19-mounts-from-cmdline.input8
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected.container/initrd-usr-fs.target.requires/sysroot.mount0
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy5.swap10
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy6.swap9
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy5.swap1
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy6.swap1
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy1.swap9
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap10
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap.requires/systemd-mkswap@dev-sdy2.service1
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap10
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap.requires/systemd-mkswap@dev-sdy3.service1
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy4.swap9
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy5.swap10
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount0
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy1.swap1
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy2.swap1
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy3.swap1
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy4.swap1
l---------test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy5.swap1
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy2.service18
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy3.service18
-rw-r--r--test/test-fstab-generator/test-20-swap-from-cmdline.input6
191 files changed, 1125 insertions, 0 deletions
diff --git a/test/test-fstab-generator/.gitattributes b/test/test-fstab-generator/.gitattributes
new file mode 100644
index 0000000..6df434f
--- /dev/null
+++ b/test/test-fstab-generator/.gitattributes
@@ -0,0 +1 @@
+* generated
diff --git a/test/test-fstab-generator/test-01-dev-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-01-dev-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-01-dev-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-01-dev-nfs.input b/test/test-fstab-generator/test-01-dev-nfs.input
new file mode 100644
index 0000000..50a1230
--- /dev/null
+++ b/test/test-fstab-generator/test-01-dev-nfs.input
@@ -0,0 +1 @@
+root=/dev/nfs nfsroot=192.168.0.1:/nfsroot/root1:rw
diff --git a/test/test-fstab-generator/test-02-dhcp.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-02-dhcp.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-02-dhcp.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-02-dhcp.input b/test/test-fstab-generator/test-02-dhcp.input
new file mode 100644
index 0000000..5aa159b
--- /dev/null
+++ b/test/test-fstab-generator/test-02-dhcp.input
@@ -0,0 +1 @@
+root=dhcp
diff --git a/test/test-fstab-generator/test-03-dhcp6.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-03-dhcp6.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-03-dhcp6.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-03-dhcp6.input b/test/test-fstab-generator/test-03-dhcp6.input
new file mode 100644
index 0000000..f4c998e
--- /dev/null
+++ b/test/test-fstab-generator/test-03-dhcp6.input
@@ -0,0 +1 @@
+root=dhcp6
diff --git a/test/test-fstab-generator/test-04-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-04-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-04-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-04-nfs.input b/test/test-fstab-generator/test-04-nfs.input
new file mode 100644
index 0000000..6d2fb39
--- /dev/null
+++ b/test/test-fstab-generator/test-04-nfs.input
@@ -0,0 +1 @@
+root=nfs:/nfsroot/root1:rw
diff --git a/test/test-fstab-generator/test-05-nfs4.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-05-nfs4.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-05-nfs4.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-05-nfs4.input b/test/test-fstab-generator/test-05-nfs4.input
new file mode 100644
index 0000000..0584069
--- /dev/null
+++ b/test/test-fstab-generator/test-05-nfs4.input
@@ -0,0 +1 @@
+root=nfs4:/nfsroot/root1:rw
diff --git a/test/test-fstab-generator/test-06-ipv4.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-06-ipv4.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-06-ipv4.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-06-ipv4.input b/test/test-fstab-generator/test-06-ipv4.input
new file mode 100644
index 0000000..a486663
--- /dev/null
+++ b/test/test-fstab-generator/test-06-ipv4.input
@@ -0,0 +1 @@
+root=192.168.0.1:/nfsroot/root1:rw
diff --git a/test/test-fstab-generator/test-07-ipv6.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-07-ipv6.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-07-ipv6.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-07-ipv6.input b/test/test-fstab-generator/test-07-ipv6.input
new file mode 100644
index 0000000..92b292c
--- /dev/null
+++ b/test/test-fstab-generator/test-07-ipv6.input
@@ -0,0 +1 @@
+root=[2001:db8::1]:/nfsroot/root1:rw
diff --git a/test/test-fstab-generator/test-08-implicit-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-08-implicit-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-08-implicit-nfs.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-08-implicit-nfs.input b/test/test-fstab-generator/test-08-implicit-nfs.input
new file mode 100644
index 0000000..12aaa3f
--- /dev/null
+++ b/test/test-fstab-generator/test-08-implicit-nfs.input
@@ -0,0 +1 @@
+root=/nfsroot/root1:rw
diff --git a/test/test-fstab-generator/test-09-cifs.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-09-cifs.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-09-cifs.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-09-cifs.input b/test/test-fstab-generator/test-09-cifs.input
new file mode 100644
index 0000000..9d4af6a
--- /dev/null
+++ b/test/test-fstab-generator/test-09-cifs.input
@@ -0,0 +1 @@
+root=cifs://username:password@192.168.0.1:/cifsroot
diff --git a/test/test-fstab-generator/test-10-iscsi.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-10-iscsi.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-10-iscsi.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-10-iscsi.input b/test/test-fstab-generator/test-10-iscsi.input
new file mode 100644
index 0000000..99327b1
--- /dev/null
+++ b/test/test-fstab-generator/test-10-iscsi.input
@@ -0,0 +1 @@
+root=iscsi:username:password@servername::::tgt
diff --git a/test/test-fstab-generator/test-11-live.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-11-live.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-11-live.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-11-live.input b/test/test-fstab-generator/test-11-live.input
new file mode 100644
index 0000000..81f60ab
--- /dev/null
+++ b/test/test-fstab-generator/test-11-live.input
@@ -0,0 +1 @@
+root=live:http://example.com/liveboot.img
diff --git a/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-device.target.d/50-root-device.conf b/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-device.target.d/50-root-device.conf
new file mode 100644
index 0000000..47c4232
--- /dev/null
+++ b/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-device.target.d/50-root-device.conf
@@ -0,0 +1,5 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Requires=dev-sdx1.device
+After=dev-sdx1.device
diff --git a/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-12-dev-sdx.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-12-dev-sdx.expected/sysroot.mount b/test/test-fstab-generator/test-12-dev-sdx.expected/sysroot.mount
new file mode 100644
index 0000000..8f8ef48
--- /dev/null
+++ b/test/test-fstab-generator/test-12-dev-sdx.expected/sysroot.mount
@@ -0,0 +1,14 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-root-fs.target
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+After=blockdev@dev-sdx1.target
+
+[Mount]
+What=/dev/sdx1
+Where=/sysroot
+Options=ro
diff --git a/test/test-fstab-generator/test-12-dev-sdx.expected/systemd-fsck-root.service b/test/test-fstab-generator/test-12-dev-sdx.expected/systemd-fsck-root.service
new file mode 100644
index 0000000..1473488
--- /dev/null
+++ b/test/test-fstab-generator/test-12-dev-sdx.expected/systemd-fsck-root.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/sdx1
+Documentation=man:systemd-fsck-root.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-sdx1.device
+Conflicts=shutdown.target
+After=initrd-root-device.target local-fs-pre.target dev-sdx1.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-12-dev-sdx.input b/test/test-fstab-generator/test-12-dev-sdx.input
new file mode 100644
index 0000000..8aa56b5
--- /dev/null
+++ b/test/test-fstab-generator/test-12-dev-sdx.input
@@ -0,0 +1 @@
+root=/dev/sdx1
diff --git a/test/test-fstab-generator/test-13-label.expected/initrd-root-device.target.d/50-root-device.conf b/test/test-fstab-generator/test-13-label.expected/initrd-root-device.target.d/50-root-device.conf
new file mode 100644
index 0000000..eada96c
--- /dev/null
+++ b/test/test-fstab-generator/test-13-label.expected/initrd-root-device.target.d/50-root-device.conf
@@ -0,0 +1,5 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Requires=dev-disk-by\x2dlabel-Root.device
+After=dev-disk-by\x2dlabel-Root.device
diff --git a/test/test-fstab-generator/test-13-label.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-13-label.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-13-label.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-13-label.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-13-label.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-13-label.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-13-label.expected/sysroot.mount b/test/test-fstab-generator/test-13-label.expected/sysroot.mount
new file mode 100644
index 0000000..98698d5
--- /dev/null
+++ b/test/test-fstab-generator/test-13-label.expected/sysroot.mount
@@ -0,0 +1,14 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-root-fs.target
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+After=blockdev@dev-disk-by\x2dlabel-Root.target
+
+[Mount]
+What=/dev/disk/by-label/Root
+Where=/sysroot
+Options=ro
diff --git a/test/test-fstab-generator/test-13-label.expected/systemd-fsck-root.service b/test/test-fstab-generator/test-13-label.expected/systemd-fsck-root.service
new file mode 100644
index 0000000..85c1936
--- /dev/null
+++ b/test/test-fstab-generator/test-13-label.expected/systemd-fsck-root.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/disk/by-label/Root
+Documentation=man:systemd-fsck-root.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-disk-by\x2dlabel-Root.device
+Conflicts=shutdown.target
+After=initrd-root-device.target local-fs-pre.target dev-disk-by\x2dlabel-Root.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/disk/by-label/Root
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-13-label.input b/test/test-fstab-generator/test-13-label.input
new file mode 100644
index 0000000..75a3696
--- /dev/null
+++ b/test/test-fstab-generator/test-13-label.input
@@ -0,0 +1 @@
+root=LABEL=Root
diff --git a/test/test-fstab-generator/test-14-uuid.expected/initrd-root-device.target.d/50-root-device.conf b/test/test-fstab-generator/test-14-uuid.expected/initrd-root-device.target.d/50-root-device.conf
new file mode 100644
index 0000000..67b8469
--- /dev/null
+++ b/test/test-fstab-generator/test-14-uuid.expected/initrd-root-device.target.d/50-root-device.conf
@@ -0,0 +1,5 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Requires=dev-disk-by\x2duuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
+After=dev-disk-by\x2duuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
diff --git a/test/test-fstab-generator/test-14-uuid.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-14-uuid.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-14-uuid.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-14-uuid.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-14-uuid.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-14-uuid.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-14-uuid.expected/sysroot.mount b/test/test-fstab-generator/test-14-uuid.expected/sysroot.mount
new file mode 100644
index 0000000..999acb0
--- /dev/null
+++ b/test/test-fstab-generator/test-14-uuid.expected/sysroot.mount
@@ -0,0 +1,14 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-root-fs.target
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+After=blockdev@dev-disk-by\x2duuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.target
+
+[Mount]
+What=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+Where=/sysroot
+Options=ro
diff --git a/test/test-fstab-generator/test-14-uuid.expected/systemd-fsck-root.service b/test/test-fstab-generator/test-14-uuid.expected/systemd-fsck-root.service
new file mode 100644
index 0000000..1c7eaea
--- /dev/null
+++ b/test/test-fstab-generator/test-14-uuid.expected/systemd-fsck-root.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+Documentation=man:systemd-fsck-root.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-disk-by\x2duuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
+Conflicts=shutdown.target
+After=initrd-root-device.target local-fs-pre.target dev-disk-by\x2duuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-14-uuid.input b/test/test-fstab-generator/test-14-uuid.input
new file mode 100644
index 0000000..676246a
--- /dev/null
+++ b/test/test-fstab-generator/test-14-uuid.input
@@ -0,0 +1 @@
+root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
diff --git a/test/test-fstab-generator/test-15-partuuid.expected/initrd-root-device.target.d/50-root-device.conf b/test/test-fstab-generator/test-15-partuuid.expected/initrd-root-device.target.d/50-root-device.conf
new file mode 100644
index 0000000..583f47c
--- /dev/null
+++ b/test/test-fstab-generator/test-15-partuuid.expected/initrd-root-device.target.d/50-root-device.conf
@@ -0,0 +1,5 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Requires=dev-disk-by\x2dpartuuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
+After=dev-disk-by\x2dpartuuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
diff --git a/test/test-fstab-generator/test-15-partuuid.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-15-partuuid.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-15-partuuid.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-15-partuuid.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-15-partuuid.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-15-partuuid.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-15-partuuid.expected/sysroot.mount b/test/test-fstab-generator/test-15-partuuid.expected/sysroot.mount
new file mode 100644
index 0000000..d10fb6e
--- /dev/null
+++ b/test/test-fstab-generator/test-15-partuuid.expected/sysroot.mount
@@ -0,0 +1,14 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-root-fs.target
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+After=blockdev@dev-disk-by\x2dpartuuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.target
+
+[Mount]
+What=/dev/disk/by-partuuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+Where=/sysroot
+Options=ro
diff --git a/test/test-fstab-generator/test-15-partuuid.expected/systemd-fsck-root.service b/test/test-fstab-generator/test-15-partuuid.expected/systemd-fsck-root.service
new file mode 100644
index 0000000..ab27bfd
--- /dev/null
+++ b/test/test-fstab-generator/test-15-partuuid.expected/systemd-fsck-root.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/disk/by-partuuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+Documentation=man:systemd-fsck-root.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-disk-by\x2dpartuuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
+Conflicts=shutdown.target
+After=initrd-root-device.target local-fs-pre.target dev-disk-by\x2dpartuuid-3f5ad593\x2d4546\x2d4a94\x2da374\x2dbcfb68aa11f7.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/disk/by-partuuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-15-partuuid.input b/test/test-fstab-generator/test-15-partuuid.input
new file mode 100644
index 0000000..d59490d
--- /dev/null
+++ b/test/test-fstab-generator/test-15-partuuid.input
@@ -0,0 +1 @@
+root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
diff --git a/test/test-fstab-generator/test-16-tmpfs.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-16-tmpfs.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-16-tmpfs.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-16-tmpfs.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-16-tmpfs.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-16-tmpfs.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-16-tmpfs.expected/sysroot.mount b/test/test-fstab-generator/test-16-tmpfs.expected/sysroot.mount
new file mode 100644
index 0000000..6bd9a07
--- /dev/null
+++ b/test/test-fstab-generator/test-16-tmpfs.expected/sysroot.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-root-fs.target
+
+[Mount]
+What=rootfs
+Where=/sysroot
+Type=tmpfs
+Options=rw
diff --git a/test/test-fstab-generator/test-16-tmpfs.input b/test/test-fstab-generator/test-16-tmpfs.input
new file mode 100644
index 0000000..0d36184
--- /dev/null
+++ b/test/test-fstab-generator/test-16-tmpfs.input
@@ -0,0 +1 @@
+root=tmpfs
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot-usr.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot-usr.mount
new file mode 120000
index 0000000..8bcbb16
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot-usr.mount
@@ -0,0 +1 @@
+../sysroot-usr.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot-usr.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot-usr.mount
new file mode 100644
index 0000000..effb6fc
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot-usr.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx2.target
+
+[Mount]
+What=/dev/sdx2
+Where=/sysroot/usr
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot.mount
new file mode 100644
index 0000000..56cecc0
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected.sysroot/sysroot.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+Requires=systemd-fsck@dev-sdx1.service
+After=systemd-fsck@dev-sdx1.service
+After=blockdev@dev-sdx1.target
+
+[Mount]
+What=/dev/sdx1
+Where=/sysroot
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-fs.target.requires/sysroot-usr.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-fs.target.requires/sysroot-usr.mount
new file mode 120000
index 0000000..8bcbb16
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-fs.target.requires/sysroot-usr.mount
@@ -0,0 +1 @@
+../sysroot-usr.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-device.target.d/50-root-device.conf b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-device.target.d/50-root-device.conf
new file mode 100644
index 0000000..47c4232
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-device.target.d/50-root-device.conf
@@ -0,0 +1,5 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Requires=dev-sdx1.device
+After=dev-sdx1.device
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysusr-usr.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysusr-usr.mount
new file mode 120000
index 0000000..8fb2e18
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/initrd-usr-fs.target.requires/sysusr-usr.mount
@@ -0,0 +1 @@
+../sysusr-usr.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot-usr.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot-usr.mount
new file mode 100644
index 0000000..69be9c1
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot-usr.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=initrd-fs.target
+
+[Mount]
+What=/sysusr/usr
+Where=/sysroot/usr
+Options=bind
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot.mount
new file mode 100644
index 0000000..0e8a701
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysroot.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=initrd-root-fs.target
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+After=blockdev@dev-sdx1.target
+
+[Mount]
+What=/dev/sdx1
+Where=/sysroot
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/systemd-fsck-root.service b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/systemd-fsck-root.service
new file mode 100644
index 0000000..1473488
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/systemd-fsck-root.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/sdx1
+Documentation=man:systemd-fsck-root.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-sdx1.device
+Conflicts=shutdown.target
+After=initrd-root-device.target local-fs-pre.target dev-sdx1.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysusr-usr.mount b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysusr-usr.mount
new file mode 100644
index 0000000..63fcb10
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.expected/sysusr-usr.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=initrd-usr-fs.target
+After=blockdev@dev-sdx2.target
+
+[Mount]
+What=/dev/sdx2
+Where=/sysusr/usr
diff --git a/test/test-fstab-generator/test-17-initrd-sysroot.fstab.input b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.input
new file mode 100644
index 0000000..1ba9b06
--- /dev/null
+++ b/test/test-fstab-generator/test-17-initrd-sysroot.fstab.input
@@ -0,0 +1,2 @@
+/dev/sdx1 /sysroot auto defaults 0 1
+/dev/sdx2 /sysroot/usr auto defaults 0 0
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.requires/mnt-requiredby.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.requires/mnt-requiredby.mount
new file mode 120000
index 0000000..6b012b0
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.requires/mnt-requiredby.mount
@@ -0,0 +1 @@
+../mnt-requiredby.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.wants/mnt-wantedby.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.wants/mnt-wantedby.mount
new file mode 120000
index 0000000..cdf2127
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/foo.service.wants/mnt-wantedby.mount
@@ -0,0 +1 @@
+../mnt-wantedby.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf
new file mode 100644
index 0000000..ac770bc
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf
@@ -0,0 +1,4 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+After=systemd-growfs@mnt-growfs.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-after.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-after.mount
new file mode 120000
index 0000000..68364ef
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-after.mount
@@ -0,0 +1 @@
+../mnt-after.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-automount1.automount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-automount1.automount
new file mode 120000
index 0000000..3638a8c
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-automount1.automount
@@ -0,0 +1 @@
+../mnt-automount1.automount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-before.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-before.mount
new file mode 120000
index 0000000..3a50a40
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-before.mount
@@ -0,0 +1 @@
+../mnt-before.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-growfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-growfs.mount
new file mode 120000
index 0000000..cb05081
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-growfs.mount
@@ -0,0 +1 @@
+../mnt-growfs.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-mkfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-mkfs.mount
new file mode 120000
index 0000000..51f897e
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-mkfs.mount
@@ -0,0 +1 @@
+../mnt-mkfs.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-pcrfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-pcrfs.mount
new file mode 120000
index 0000000..276dfc0
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-pcrfs.mount
@@ -0,0 +1 @@
+../mnt-pcrfs.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-reqmounts.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-reqmounts.mount
new file mode 120000
index 0000000..7efce8d
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-reqmounts.mount
@@ -0,0 +1 @@
+../mnt-reqmounts.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-requires.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-requires.mount
new file mode 120000
index 0000000..34a6aad
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-requires.mount
@@ -0,0 +1 @@
+../mnt-requires.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-rwonly.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-rwonly.mount
new file mode 120000
index 0000000..d03abd2
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-rwonly.mount
@@ -0,0 +1 @@
+../mnt-rwonly.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-timeout.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-timeout.mount
new file mode 120000
index 0000000..b0ec730
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/mnt-timeout.mount
@@ -0,0 +1 @@
+../mnt-timeout.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-automount2.automount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-automount2.automount
new file mode 120000
index 0000000..a30481e
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-automount2.automount
@@ -0,0 +1 @@
+../mnt-automount2.automount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-nofail.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-nofail.mount
new file mode 120000
index 0000000..b82bbad
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/mnt-nofail.mount
@@ -0,0 +1 @@
+../mnt-nofail.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/local-fs.target.wants/systemd-remount-fs.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-after.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-after.mount
new file mode 100644
index 0000000..2aebb68
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-after.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=foo.service
+Before=local-fs.target
+After=blockdev@dev-sdx3.target
+
+[Mount]
+What=/dev/sdx3
+Where=/mnt/after
+Options=x-systemd.after=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.automount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.automount
new file mode 100644
index 0000000..e376689
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.automount
@@ -0,0 +1,9 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+SourcePath=/etc/fstab
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+
+[Automount]
+Where=/mnt/automount1
+TimeoutIdleSec=30min
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.mount
new file mode 100644
index 0000000..1413292
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount1.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx9.target
+
+[Mount]
+What=/dev/sdx9
+Where=/mnt/automount1
+Options=x-systemd.automount,x-systemd.idle-timeout=30m
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.automount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.automount
new file mode 100644
index 0000000..e05d397
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.automount
@@ -0,0 +1,8 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+SourcePath=/etc/fstab
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+
+[Automount]
+Where=/mnt/automount2
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.mount
new file mode 100644
index 0000000..1eba08c
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-automount2.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=blockdev@dev-sdx10.target
+
+[Mount]
+What=/dev/sdx10
+Where=/mnt/automount2
+Options=x-systemd.automount,nofail
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-before.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-before.mount
new file mode 100644
index 0000000..eea084b
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-before.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=foo.service
+Before=local-fs.target
+After=blockdev@dev-sdx4.target
+
+[Mount]
+What=/dev/sdx4
+Where=/mnt/before
+Options=x-systemd.before=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount
new file mode 100644
index 0000000..bbe958c
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx13.target
+
+[Mount]
+What=/dev/sdx13
+Where=/mnt/growfs
+Options=x-systemd.growfs
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount
new file mode 100644
index 0000000..be4c8fa
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx12.target
+
+[Mount]
+What=/dev/sdx12
+Where=/mnt/mkfs
+Type=ext4
+Options=x-systemd.makefs
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service
new file mode 120000
index 0000000..fe80548
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service
@@ -0,0 +1 @@
+../systemd-makefs@dev-sdx12.service \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-noauto.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-noauto.mount
new file mode 100644
index 0000000..4d52a6e
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-noauto.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx15.target
+
+[Mount]
+What=/dev/sdx15
+Where=/mnt/noauto
+Options=noauto
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-nofail.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-nofail.mount
new file mode 100644
index 0000000..3c20b65
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-nofail.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=blockdev@dev-sdx16.target
+
+[Mount]
+What=/dev/sdx16
+Where=/mnt/nofail
+Options=nofail
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-pcrfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-pcrfs.mount
new file mode 100644
index 0000000..2c070e6
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-pcrfs.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx14.target
+
+[Mount]
+What=/dev/sdx14
+Where=/mnt/pcrfs
+Options=x-systemd.pcrfs
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-reqmounts.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-reqmounts.mount
new file mode 100644
index 0000000..c21ccd2
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-reqmounts.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+RequiresMountsFor=/hoge
+Before=local-fs.target
+After=blockdev@dev-sdx6.target
+
+[Mount]
+What=/dev/sdx6
+Where=/mnt/reqmounts
+Options=x-systemd.requires-mounts-for=/hoge
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requiredby.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requiredby.mount
new file mode 100644
index 0000000..5edc4dd
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requiredby.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx8.target
+
+[Mount]
+What=/dev/sdx8
+Where=/mnt/requiredby
+Options=x-systemd.required-by=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requires.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requires.mount
new file mode 100644
index 0000000..8386616
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-requires.mount
@@ -0,0 +1,14 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=foo.service
+Requires=foo.service
+Before=local-fs.target
+After=blockdev@dev-sdx5.target
+
+[Mount]
+What=/dev/sdx5
+Where=/mnt/requires
+Options=x-systemd.requires=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-rwonly.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-rwonly.mount
new file mode 100644
index 0000000..8649734
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-rwonly.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx11.target
+
+[Mount]
+What=/dev/sdx11
+Where=/mnt/rwonly
+Options=x-systemd.rw-only
+ReadWriteOnly=yes
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-timeout.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-timeout.mount
new file mode 100644
index 0000000..09d772a
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-timeout.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx2.target
+
+[Mount]
+What=/dev/sdx2
+Where=/mnt/timeout
+TimeoutSec=10min
+Options=x-systemd.mount-timeout=10m
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-wantedby.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-wantedby.mount
new file mode 100644
index 0000000..e12df82
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/mnt-wantedby.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx7.target
+
+[Mount]
+What=/dev/sdx7
+Where=/mnt/wantedby
+Options=x-systemd.wanted-by=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/sysroot.mount b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/sysroot.mount
new file mode 100644
index 0000000..56cecc0
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/sysroot.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+Requires=systemd-fsck@dev-sdx1.service
+After=systemd-fsck@dev-sdx1.service
+After=blockdev@dev-sdx1.target
+
+[Mount]
+What=/dev/sdx1
+Where=/sysroot
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/systemd-makefs@dev-sdx12.service b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/systemd-makefs@dev-sdx12.service
new file mode 100644
index 0000000..4670c23
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected.sysroot/systemd-makefs@dev-sdx12.service
@@ -0,0 +1,18 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=Make File System on %f
+Documentation=man:systemd-makefs@.service(8)
+
+DefaultDependencies=no
+BindsTo=%i.device
+After=%i.device
+Before=systemd-fsck@%i.service mnt-mkfs.mount
+Conflicts=shutdown.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-makefs ext4 /dev/sdx12
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/foo.service.requires/mnt-requiredby.mount b/test/test-fstab-generator/test-18-options.fstab.expected/foo.service.requires/mnt-requiredby.mount
new file mode 120000
index 0000000..6b012b0
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/foo.service.requires/mnt-requiredby.mount
@@ -0,0 +1 @@
+../mnt-requiredby.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/foo.service.wants/mnt-wantedby.mount b/test/test-fstab-generator/test-18-options.fstab.expected/foo.service.wants/mnt-wantedby.mount
new file mode 120000
index 0000000..cdf2127
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/foo.service.wants/mnt-wantedby.mount
@@ -0,0 +1 @@
+../mnt-wantedby.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-device.target.d/50-root-device.conf b/test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-device.target.d/50-root-device.conf
new file mode 100644
index 0000000..47c4232
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-device.target.d/50-root-device.conf
@@ -0,0 +1,5 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Requires=dev-sdx1.device
+After=dev-sdx1.device
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-18-options.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf
new file mode 100644
index 0000000..ac770bc
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.d/50-order-systemd-growfs@mnt-growfs.service.conf
@@ -0,0 +1,4 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+After=systemd-growfs@mnt-growfs.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-after.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-after.mount
new file mode 120000
index 0000000..68364ef
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-after.mount
@@ -0,0 +1 @@
+../mnt-after.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-automount1.automount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-automount1.automount
new file mode 120000
index 0000000..3638a8c
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-automount1.automount
@@ -0,0 +1 @@
+../mnt-automount1.automount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-before.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-before.mount
new file mode 120000
index 0000000..3a50a40
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-before.mount
@@ -0,0 +1 @@
+../mnt-before.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-growfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-growfs.mount
new file mode 120000
index 0000000..cb05081
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-growfs.mount
@@ -0,0 +1 @@
+../mnt-growfs.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-mkfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-mkfs.mount
new file mode 120000
index 0000000..51f897e
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-mkfs.mount
@@ -0,0 +1 @@
+../mnt-mkfs.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-pcrfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-pcrfs.mount
new file mode 120000
index 0000000..276dfc0
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-pcrfs.mount
@@ -0,0 +1 @@
+../mnt-pcrfs.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-reqmounts.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-reqmounts.mount
new file mode 120000
index 0000000..7efce8d
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-reqmounts.mount
@@ -0,0 +1 @@
+../mnt-reqmounts.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-requires.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-requires.mount
new file mode 120000
index 0000000..34a6aad
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-requires.mount
@@ -0,0 +1 @@
+../mnt-requires.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-rwonly.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-rwonly.mount
new file mode 120000
index 0000000..d03abd2
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-rwonly.mount
@@ -0,0 +1 @@
+../mnt-rwonly.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-timeout.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-timeout.mount
new file mode 120000
index 0000000..b0ec730
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.requires/mnt-timeout.mount
@@ -0,0 +1 @@
+../mnt-timeout.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-automount2.automount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-automount2.automount
new file mode 120000
index 0000000..a30481e
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-automount2.automount
@@ -0,0 +1 @@
+../mnt-automount2.automount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-nofail.mount b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-nofail.mount
new file mode 120000
index 0000000..b82bbad
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/local-fs.target.wants/mnt-nofail.mount
@@ -0,0 +1 @@
+../mnt-nofail.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-after.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-after.mount
new file mode 100644
index 0000000..2aebb68
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-after.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=foo.service
+Before=local-fs.target
+After=blockdev@dev-sdx3.target
+
+[Mount]
+What=/dev/sdx3
+Where=/mnt/after
+Options=x-systemd.after=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.automount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.automount
new file mode 100644
index 0000000..e376689
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.automount
@@ -0,0 +1,9 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+SourcePath=/etc/fstab
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+
+[Automount]
+Where=/mnt/automount1
+TimeoutIdleSec=30min
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.mount
new file mode 100644
index 0000000..1413292
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount1.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx9.target
+
+[Mount]
+What=/dev/sdx9
+Where=/mnt/automount1
+Options=x-systemd.automount,x-systemd.idle-timeout=30m
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.automount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.automount
new file mode 100644
index 0000000..e05d397
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.automount
@@ -0,0 +1,8 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+SourcePath=/etc/fstab
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+
+[Automount]
+Where=/mnt/automount2
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.mount
new file mode 100644
index 0000000..1eba08c
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-automount2.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=blockdev@dev-sdx10.target
+
+[Mount]
+What=/dev/sdx10
+Where=/mnt/automount2
+Options=x-systemd.automount,nofail
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-before.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-before.mount
new file mode 100644
index 0000000..eea084b
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-before.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=foo.service
+Before=local-fs.target
+After=blockdev@dev-sdx4.target
+
+[Mount]
+What=/dev/sdx4
+Where=/mnt/before
+Options=x-systemd.before=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount
new file mode 100644
index 0000000..bbe958c
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx13.target
+
+[Mount]
+What=/dev/sdx13
+Where=/mnt/growfs
+Options=x-systemd.growfs
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-growfs.mount.wants/systemd-growfs@mnt-growfs.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount
new file mode 100644
index 0000000..be4c8fa
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx12.target
+
+[Mount]
+What=/dev/sdx12
+Where=/mnt/mkfs
+Type=ext4
+Options=x-systemd.makefs
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service
new file mode 120000
index 0000000..fe80548
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-mkfs.mount.requires/systemd-makefs@dev-sdx12.service
@@ -0,0 +1 @@
+../systemd-makefs@dev-sdx12.service \ No newline at end of file
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-noauto.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-noauto.mount
new file mode 100644
index 0000000..4d52a6e
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-noauto.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx15.target
+
+[Mount]
+What=/dev/sdx15
+Where=/mnt/noauto
+Options=noauto
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-nofail.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-nofail.mount
new file mode 100644
index 0000000..3c20b65
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-nofail.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=blockdev@dev-sdx16.target
+
+[Mount]
+What=/dev/sdx16
+Where=/mnt/nofail
+Options=nofail
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-pcrfs.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-pcrfs.mount
new file mode 100644
index 0000000..2c070e6
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-pcrfs.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx14.target
+
+[Mount]
+What=/dev/sdx14
+Where=/mnt/pcrfs
+Options=x-systemd.pcrfs
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-reqmounts.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-reqmounts.mount
new file mode 100644
index 0000000..c21ccd2
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-reqmounts.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+RequiresMountsFor=/hoge
+Before=local-fs.target
+After=blockdev@dev-sdx6.target
+
+[Mount]
+What=/dev/sdx6
+Where=/mnt/reqmounts
+Options=x-systemd.requires-mounts-for=/hoge
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-requiredby.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-requiredby.mount
new file mode 100644
index 0000000..5edc4dd
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-requiredby.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx8.target
+
+[Mount]
+What=/dev/sdx8
+Where=/mnt/requiredby
+Options=x-systemd.required-by=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-requires.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-requires.mount
new file mode 100644
index 0000000..8386616
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-requires.mount
@@ -0,0 +1,14 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+After=foo.service
+Requires=foo.service
+Before=local-fs.target
+After=blockdev@dev-sdx5.target
+
+[Mount]
+What=/dev/sdx5
+Where=/mnt/requires
+Options=x-systemd.requires=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-rwonly.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-rwonly.mount
new file mode 100644
index 0000000..8649734
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-rwonly.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx11.target
+
+[Mount]
+What=/dev/sdx11
+Where=/mnt/rwonly
+Options=x-systemd.rw-only
+ReadWriteOnly=yes
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-timeout.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-timeout.mount
new file mode 100644
index 0000000..09d772a
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-timeout.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx2.target
+
+[Mount]
+What=/dev/sdx2
+Where=/mnt/timeout
+TimeoutSec=10min
+Options=x-systemd.mount-timeout=10m
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/mnt-wantedby.mount b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-wantedby.mount
new file mode 100644
index 0000000..e12df82
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/mnt-wantedby.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=local-fs.target
+After=blockdev@dev-sdx7.target
+
+[Mount]
+What=/dev/sdx7
+Where=/mnt/wantedby
+Options=x-systemd.wanted-by=foo.service
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/sysroot.mount b/test/test-fstab-generator/test-18-options.fstab.expected/sysroot.mount
new file mode 100644
index 0000000..0e8a701
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/sysroot.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/etc/fstab
+Before=initrd-root-fs.target
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+After=blockdev@dev-sdx1.target
+
+[Mount]
+What=/dev/sdx1
+Where=/sysroot
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/systemd-fsck-root.service b/test/test-fstab-generator/test-18-options.fstab.expected/systemd-fsck-root.service
new file mode 100644
index 0000000..1473488
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/systemd-fsck-root.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/sdx1
+Documentation=man:systemd-fsck-root.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-sdx1.device
+Conflicts=shutdown.target
+After=initrd-root-device.target local-fs-pre.target dev-sdx1.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-18-options.fstab.expected/systemd-makefs@dev-sdx12.service b/test/test-fstab-generator/test-18-options.fstab.expected/systemd-makefs@dev-sdx12.service
new file mode 100644
index 0000000..4670c23
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.expected/systemd-makefs@dev-sdx12.service
@@ -0,0 +1,18 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=Make File System on %f
+Documentation=man:systemd-makefs@.service(8)
+
+DefaultDependencies=no
+BindsTo=%i.device
+After=%i.device
+Before=systemd-fsck@%i.service mnt-mkfs.mount
+Conflicts=shutdown.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-makefs ext4 /dev/sdx12
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-18-options.fstab.input b/test/test-fstab-generator/test-18-options.fstab.input
new file mode 100644
index 0000000..98ef0b9
--- /dev/null
+++ b/test/test-fstab-generator/test-18-options.fstab.input
@@ -0,0 +1,16 @@
+/dev/sdx1 /sysroot auto defaults 0 1
+/dev/sdx2 /mnt/timeout auto x-systemd.mount-timeout=10m 0 0
+/dev/sdx3 /mnt/after auto x-systemd.after=foo.service 0 0
+/dev/sdx4 /mnt/before auto x-systemd.before=foo.service 0 0
+/dev/sdx5 /mnt/requires auto x-systemd.requires=foo.service 0 0
+/dev/sdx6 /mnt/reqmounts auto x-systemd.requires-mounts-for=/hoge 0 0
+/dev/sdx7 /mnt/wantedby auto x-systemd.wanted-by=foo.service 0 0
+/dev/sdx8 /mnt/requiredby auto x-systemd.required-by=foo.service 0 0
+/dev/sdx9 /mnt/automount1 auto x-systemd.automount,x-systemd.idle-timeout=30m 0 0
+/dev/sdx10 /mnt/automount2 auto x-systemd.automount,nofail 0 0
+/dev/sdx11 /mnt/rwonly auto x-systemd.rw-only 0 0
+/dev/sdx12 /mnt/mkfs ext4 x-systemd.makefs 0 0
+/dev/sdx13 /mnt/growfs auto x-systemd.growfs 0 0
+/dev/sdx14 /mnt/pcrfs auto x-systemd.pcrfs 0 0
+/dev/sdx15 /mnt/noauto auto noauto 0 0
+/dev/sdx16 /mnt/nofail auto nofail 0 0
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-also_in_initrd.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-also_in_initrd.mount
new file mode 100644
index 0000000..ed72fb2
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-also_in_initrd.mount
@@ -0,0 +1,14 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=local-fs.target
+Requires=systemd-fsck@dev-sdx6.service
+After=systemd-fsck@dev-sdx6.service
+After=blockdev@dev-sdx6.target
+
+[Mount]
+What=/dev/sdx6
+Where=/foo/also_in_initrd
+Options=x-initrd.mount
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-not_in_initrd.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-not_in_initrd.mount
new file mode 100644
index 0000000..11b5278
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/foo-not_in_initrd.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=local-fs.target
+Requires=systemd-fsck@dev-sdx7.service
+After=systemd-fsck@dev-sdx7.service
+After=blockdev@dev-sdx7.target
+
+[Mount]
+What=/dev/sdx7
+Where=/foo/not_in_initrd
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-also_in_initrd.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-also_in_initrd.mount
new file mode 120000
index 0000000..e4b2711
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-also_in_initrd.mount
@@ -0,0 +1 @@
+../foo-also_in_initrd.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-not_in_initrd.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-not_in_initrd.mount
new file mode 120000
index 0000000..85965fe
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/foo-not_in_initrd.mount
@@ -0,0 +1 @@
+../foo-not_in_initrd.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/usr.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/usr.mount
new file mode 120000
index 0000000..a570574
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/local-fs.target.requires/usr.mount
@@ -0,0 +1 @@
+../usr.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/usr.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/usr.mount
new file mode 100644
index 0000000..bfdede5
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected.sysroot/usr.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=local-fs.target
+Wants=systemd-fsck@dev-sdx5.service
+After=systemd-fsck@dev-sdx5.service
+After=blockdev@dev-sdx5.target
+
+[Mount]
+What=/dev/sdx5
+Where=/usr
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_fstype.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_fstype.mount
new file mode 100644
index 0000000..a7c6ee9
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_fstype.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=local-fs.target
+Requires=systemd-fsck@dev-sdx3.service
+After=systemd-fsck@dev-sdx3.service
+After=blockdev@dev-sdx3.target
+
+[Mount]
+What=/dev/sdx3
+Where=/hoge/without_fstype
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_options.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_options.mount
new file mode 100644
index 0000000..157ae2b
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-without_options.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=local-fs.target
+Requires=systemd-fsck@dev-sdx2.service
+After=systemd-fsck@dev-sdx2.service
+After=blockdev@dev-sdx2.target
+
+[Mount]
+What=/dev/sdx2
+Where=/hoge/without_options
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-withx20space.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-withx20space.mount
new file mode 100644
index 0000000..e9ffb4b
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/hoge-withx20space.mount
@@ -0,0 +1,12 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=remote-fs.target
+
+[Mount]
+What=//foo￾bar
+Where=/hoge/with space
+Type=cifs
+Options=rw
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-foo-also_in_initrd.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-foo-also_in_initrd.mount
new file mode 120000
index 0000000..314c46c
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-foo-also_in_initrd.mount
@@ -0,0 +1 @@
+../sysroot-foo-also_in_initrd.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-usr.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-usr.mount
new file mode 120000
index 0000000..8bcbb16
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-fs.target.requires/sysroot-usr.mount
@@ -0,0 +1 @@
+../sysroot-usr.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-device.target.d/50-root-device.conf b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-device.target.d/50-root-device.conf
new file mode 100644
index 0000000..47c4232
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-device.target.d/50-root-device.conf
@@ -0,0 +1,5 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Requires=dev-sdx1.device
+After=dev-sdx1.device
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-root-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 120000
index 0000000..0c969cd
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount
@@ -0,0 +1 @@
+../sysroot.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysusr-usr.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysusr-usr.mount
new file mode 120000
index 0000000..8fb2e18
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/initrd-usr-fs.target.requires/sysusr-usr.mount
@@ -0,0 +1 @@
+../sysusr-usr.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_fstype.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_fstype.mount
new file mode 120000
index 0000000..d46cee3
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_fstype.mount
@@ -0,0 +1 @@
+../hoge-without_fstype.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_options.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_options.mount
new file mode 120000
index 0000000..9c790fb
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/local-fs.target.requires/hoge-without_options.mount
@@ -0,0 +1 @@
+../hoge-without_options.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/remote-fs.target.requires/hoge-withx20space.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/remote-fs.target.requires/hoge-withx20space.mount
new file mode 120000
index 0000000..2404d76
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/remote-fs.target.requires/hoge-withx20space.mount
@@ -0,0 +1 @@
+../hoge-withx20space.mount \ No newline at end of file
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-foo-also_in_initrd.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-foo-also_in_initrd.mount
new file mode 100644
index 0000000..098961d
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-foo-also_in_initrd.mount
@@ -0,0 +1,15 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-fs.target
+Requires=systemd-fsck@dev-sdx6.service
+After=systemd-fsck@dev-sdx6.service
+After=blockdev@dev-sdx6.target
+
+[Mount]
+What=/dev/sdx6
+# Canonicalized from /foo/also_in_initrd
+Where=/sysroot/foo/also_in_initrd
+Options=x-initrd.mount
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-usr.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-usr.mount
new file mode 100644
index 0000000..7f6d33c
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot-usr.mount
@@ -0,0 +1,11 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-fs.target
+
+[Mount]
+What=/sysusr/usr
+Where=/sysroot/usr
+Options=bind
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot.mount
new file mode 100644
index 0000000..f46b71a
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysroot.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-root-fs.target
+Requires=systemd-fsck-root.service
+After=systemd-fsck-root.service
+After=blockdev@dev-sdx1.target
+
+[Mount]
+What=/dev/sdx1
+Where=/sysroot
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-root.service b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-root.service
new file mode 100644
index 0000000..1473488
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-root.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/sdx1
+Documentation=man:systemd-fsck-root.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-sdx1.device
+Conflicts=shutdown.target
+After=initrd-root-device.target local-fs-pre.target dev-sdx1.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx1
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-usr.service b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-usr.service
new file mode 100644
index 0000000..512e7b1
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/systemd-fsck-usr.service
@@ -0,0 +1,17 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=File System Check on /dev/sdx5
+Documentation=man:systemd-fsck-usr.service(8)
+
+DefaultDependencies=no
+BindsTo=dev-sdx5.device
+Conflicts=shutdown.target
+After=local-fs-pre.target dev-sdx5.device
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-fsck /dev/sdx5
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysusr-usr.mount b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysusr-usr.mount
new file mode 100644
index 0000000..bfee6a4
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.expected/sysusr-usr.mount
@@ -0,0 +1,13 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+Before=initrd-usr-fs.target
+Requires=systemd-fsck-usr.service
+After=systemd-fsck-usr.service
+After=blockdev@dev-sdx5.target
+
+[Mount]
+What=/dev/sdx5
+Where=/sysusr/usr
diff --git a/test/test-fstab-generator/test-19-mounts-from-cmdline.input b/test/test-fstab-generator/test-19-mounts-from-cmdline.input
new file mode 100644
index 0000000..f16e494
--- /dev/null
+++ b/test/test-fstab-generator/test-19-mounts-from-cmdline.input
@@ -0,0 +1,8 @@
+rd.systemd.mount-extra=/dev/sdx1:/sysroot:auto:defaults
+rd.systemd.mount-extra=/dev/sdx2:/hoge/without_options:auto
+rd.systemd.mount-extra=/dev/sdx3:/hoge/without_fstype
+rd.systemd.mount-extra=/dev/sdx4
+rd.systemd.mount-extra=//foo\ufffebar:/hoge/with\x20space:cifs:rw,seclabel
+systemd.mount-extra=/dev/sdx5:/usr:auto:defaults
+systemd.mount-extra=/dev/sdx6:/foo/also_in_initrd:auto:x-initrd.mount
+systemd.mount-extra=/dev/sdx7:/foo/not_in_initrd:auto:defaults
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected.container/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.container/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.container/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy5.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy5.swap
new file mode 100644
index 0000000..a9009ce
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy5.swap
@@ -0,0 +1,10 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+After=blockdev@dev-sdy5.target
+
+[Swap]
+What=/dev/sdy5
+Options=x-initrd.mount
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy6.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy6.swap
new file mode 100644
index 0000000..383a8c3
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/dev-sdy6.swap
@@ -0,0 +1,9 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+After=blockdev@dev-sdy6.target
+
+[Swap]
+What=/dev/sdy6
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy5.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy5.swap
new file mode 120000
index 0000000..04565db
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy5.swap
@@ -0,0 +1 @@
+../dev-sdy5.swap \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy6.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy6.swap
new file mode 120000
index 0000000..3b36226
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected.sysroot/swap.target.requires/dev-sdy6.swap
@@ -0,0 +1 @@
+../dev-sdy6.swap \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy1.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy1.swap
new file mode 100644
index 0000000..f515bc1
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy1.swap
@@ -0,0 +1,9 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+After=blockdev@dev-sdy1.target
+
+[Swap]
+What=/dev/sdy1
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap
new file mode 100644
index 0000000..104260a
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap
@@ -0,0 +1,10 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+After=blockdev@dev-sdy2.target
+
+[Swap]
+What=/dev/sdy2
+Options=x-systemd.makefs
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap.requires/systemd-mkswap@dev-sdy2.service b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap.requires/systemd-mkswap@dev-sdy2.service
new file mode 120000
index 0000000..5248a5f
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy2.swap.requires/systemd-mkswap@dev-sdy2.service
@@ -0,0 +1 @@
+../systemd-mkswap@dev-sdy2.service \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap
new file mode 100644
index 0000000..3b6563d
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap
@@ -0,0 +1,10 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+After=blockdev@dev-sdy3.target
+
+[Swap]
+What=/dev/sdy3
+Options=x-systemd.makefs
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap.requires/systemd-mkswap@dev-sdy3.service b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap.requires/systemd-mkswap@dev-sdy3.service
new file mode 120000
index 0000000..e41d758
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy3.swap.requires/systemd-mkswap@dev-sdy3.service
@@ -0,0 +1 @@
+../systemd-mkswap@dev-sdy3.service \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy4.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy4.swap
new file mode 100644
index 0000000..37d90f7
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy4.swap
@@ -0,0 +1,9 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+After=blockdev@dev-sdy4.target
+
+[Swap]
+What=/dev/sdy4
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy5.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy5.swap
new file mode 100644
index 0000000..a9009ce
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/dev-sdy5.swap
@@ -0,0 +1,10 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Documentation=man:fstab(5) man:systemd-fstab-generator(8)
+SourcePath=/proc/cmdline
+After=blockdev@dev-sdy5.target
+
+[Swap]
+What=/dev/sdy5
+Options=x-initrd.mount
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/initrd-usr-fs.target.requires/sysroot.mount
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy1.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy1.swap
new file mode 120000
index 0000000..a899ff8
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy1.swap
@@ -0,0 +1 @@
+../dev-sdy1.swap \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy2.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy2.swap
new file mode 120000
index 0000000..14df9d6
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy2.swap
@@ -0,0 +1 @@
+../dev-sdy2.swap \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy3.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy3.swap
new file mode 120000
index 0000000..19663fe
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy3.swap
@@ -0,0 +1 @@
+../dev-sdy3.swap \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy4.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy4.swap
new file mode 120000
index 0000000..9bfd9d8
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy4.swap
@@ -0,0 +1 @@
+../dev-sdy4.swap \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy5.swap b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy5.swap
new file mode 120000
index 0000000..04565db
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/swap.target.requires/dev-sdy5.swap
@@ -0,0 +1 @@
+../dev-sdy5.swap \ No newline at end of file
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy2.service b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy2.service
new file mode 100644
index 0000000..0b0e727
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy2.service
@@ -0,0 +1,18 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=Make Swap on %f
+Documentation=man:systemd-mkswap@.service(8)
+
+DefaultDependencies=no
+BindsTo=%i.device
+After=%i.device
+Before=dev-sdy2.swap
+Conflicts=shutdown.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-makefs swap /dev/sdy2
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy3.service b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy3.service
new file mode 100644
index 0000000..1164c99
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.expected/systemd-mkswap@dev-sdy3.service
@@ -0,0 +1,18 @@
+# Automatically generated by systemd-fstab-generator
+
+[Unit]
+Description=Make Swap on %f
+Documentation=man:systemd-mkswap@.service(8)
+
+DefaultDependencies=no
+BindsTo=%i.device
+After=%i.device
+Before=dev-sdy3.swap
+Conflicts=shutdown.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/lib/systemd/systemd-makefs swap /dev/sdy3
+TimeoutSec=infinity
diff --git a/test/test-fstab-generator/test-20-swap-from-cmdline.input b/test/test-fstab-generator/test-20-swap-from-cmdline.input
new file mode 100644
index 0000000..adde91e
--- /dev/null
+++ b/test/test-fstab-generator/test-20-swap-from-cmdline.input
@@ -0,0 +1,6 @@
+rd.systemd.mount-extra=/dev/sdy1:none:swap
+rd.systemd.mount-extra=/dev/sdy2:none:swap:x-systemd.makefs
+rd.systemd.swap-extra=/dev/sdy3:x-systemd.makefs,nofail
+rd.systemd.swap-extra=/dev/sdy4
+systemd.swap-extra=/dev/sdy5:x-initrd.mount
+systemd.swap-extra=/dev/sdy6