@@ -171,6 +171,7 @@ let
171171
172172 makeInstallerTest = name:
173173 { createPartitions, preBootCommands ? "", extraConfig ? ""
174+ , extraInstallerConfig ? {}
174175 , bootLoader ? "grub" # either "grub" or "systemd-boot"
175176 , grubVersion ? 2, grubDevice ? "/dev/vda", grubIdentifier ? "uuid"
176177 , enableOCR ? false, meta ? {}
@@ -192,6 +193,7 @@ let
192193 { imports =
193194 [ ../modules/profiles/installation-device.nix
194195 ../modules/profiles/base.nix
196+ extraInstallerConfig
195197 ];
196198
197199 virtualisation.diskSize = 8 * 1024;
@@ -332,6 +334,43 @@ in {
332334 '';
333335 };
334336
337+ # zfs on / with swap
338+ zfsroot = makeInstallerTest "zfs-root"
339+ {
340+ extraInstallerConfig = {
341+ boot.supportedFilesystems = [ "zfs" ];
342+ };
343+
344+ extraConfig = ''
345+ boot.supportedFilesystems = [ "zfs" ];
346+
347+ # Using by-uuid overrides the default of by-id, and is unique
348+ # to the qemu disks, as they don't produce by-id paths for
349+ # some reason.
350+ boot.zfs.devNodes = "/dev/disk/by-uuid/";
351+ networking.hostId = "00000000";
352+ '';
353+
354+ createPartitions =
355+ ''
356+ $machine->succeed(
357+ "parted /dev/vda mklabel msdos",
358+ "parted /dev/vda -- mkpart primary linux-swap 1M 1024M",
359+ "parted /dev/vda -- mkpart primary 1024M -1s",
360+ "udevadm settle",
361+
362+ "mkswap /dev/vda1 -L swap",
363+ "swapon -L swap",
364+
365+ "zpool create rpool /dev/vda2",
366+ "zfs create -o mountpoint=legacy rpool/root",
367+ "mount -t zfs rpool/root /mnt",
368+
369+ "udevadm settle"
370+ );
371+ '';
372+ };
373+
335374 # Create two physical LVM partitions combined into one volume group
336375 # that contains the logical swap and root partitions.
337376 lvm = makeInstallerTest "lvm"