git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #26917 from grahamc/zfs-installer-test
425e9ceGraham Christensen
nixos/release-combined.nix+1
@@ -52,6 +52,7 @@ in rec {
52 (all nixos.tests.firefox)
52 (all nixos.tests.firefox)
53 (all nixos.tests.firewall)
53 (all nixos.tests.firewall)
54 nixos.tests.gnome3.x86_64-linux # FIXME: i686-linux
54 nixos.tests.gnome3.x86_64-linux # FIXME: i686-linux
55+ (all nixos.tests.installer.zfsroot)
55 (all nixos.tests.installer.lvm)
56 (all nixos.tests.installer.lvm)
56 (all nixos.tests.installer.luksroot)
57 (all nixos.tests.installer.luksroot)
57 (all nixos.tests.installer.separateBoot)
58 (all nixos.tests.installer.separateBoot)
nixos/tests/installer.nix+39
@@ -171,6 +171,7 @@ let
171
171
172 makeInstallerTest = name:
172 makeInstallerTest = name:
173 { createPartitions, preBootCommands ? "", extraConfig ? ""
173 { createPartitions, preBootCommands ? "", extraConfig ? ""
174+ , extraInstallerConfig ? {}
174 , bootLoader ? "grub" # either "grub" or "systemd-boot"
175 , bootLoader ? "grub" # either "grub" or "systemd-boot"
175 , grubVersion ? 2, grubDevice ? "/dev/vda", grubIdentifier ? "uuid"
176 , grubVersion ? 2, grubDevice ? "/dev/vda", grubIdentifier ? "uuid"
176 , enableOCR ? false, meta ? {}
177 , enableOCR ? false, meta ? {}
@@ -192,6 +193,7 @@ let
192 { imports =
193 { imports =
193 [ ../modules/profiles/installation-device.nix
194 [ ../modules/profiles/installation-device.nix
194 ../modules/profiles/base.nix
195 ../modules/profiles/base.nix
196+ extraInstallerConfig
195 ];
197 ];
196
198
197 virtualisation.diskSize = 8 * 1024;
199 virtualisation.diskSize = 8 * 1024;
@@ -332,6 +334,43 @@ in {
332 '';
334 '';
333 };
335 };
334
336
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+
335 # Create two physical LVM partitions combined into one volume group
374 # Create two physical LVM partitions combined into one volume group
336 # that contains the logical swap and root partitions.
375 # that contains the logical swap and root partitions.
337 lvm = makeInstallerTest "lvm"
376 lvm = makeInstallerTest "lvm"