forked from mirrors/nixpkgs
nixos: installer.nix test: test ZFS install use case
This commit is contained in:
parent
ad142902c6
commit
b0a4c2c33f
|
@ -52,6 +52,7 @@ in rec {
|
|||
(all nixos.tests.firefox)
|
||||
(all nixos.tests.firewall)
|
||||
nixos.tests.gnome3.x86_64-linux # FIXME: i686-linux
|
||||
(all nixos.tests.installer.zfsroot)
|
||||
(all nixos.tests.installer.lvm)
|
||||
(all nixos.tests.installer.luksroot)
|
||||
(all nixos.tests.installer.separateBoot)
|
||||
|
|
|
@ -171,6 +171,7 @@ let
|
|||
|
||||
makeInstallerTest = name:
|
||||
{ createPartitions, preBootCommands ? "", extraConfig ? ""
|
||||
, extraInstallerConfig ? {}
|
||||
, bootLoader ? "grub" # either "grub" or "systemd-boot"
|
||||
, grubVersion ? 2, grubDevice ? "/dev/vda", grubIdentifier ? "uuid"
|
||||
, enableOCR ? false, meta ? {}
|
||||
|
@ -192,6 +193,7 @@ let
|
|||
{ imports =
|
||||
[ ../modules/profiles/installation-device.nix
|
||||
../modules/profiles/base.nix
|
||||
extraInstallerConfig
|
||||
];
|
||||
|
||||
virtualisation.diskSize = 8 * 1024;
|
||||
|
@ -332,6 +334,43 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
# zfs on / with swap
|
||||
zfsroot = makeInstallerTest "zfs-root"
|
||||
{
|
||||
extraInstallerConfig = {
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
|
||||
# Using by-uuid overrides the default of by-id, and is unique
|
||||
# to the qemu disks, as they don't produce by-id paths for
|
||||
# some reason.
|
||||
boot.zfs.devNodes = "/dev/disk/by-uuid/";
|
||||
networking.hostId = "00000000";
|
||||
'';
|
||||
|
||||
createPartitions =
|
||||
''
|
||||
$machine->succeed(
|
||||
"parted /dev/vda mklabel msdos",
|
||||
"parted /dev/vda -- mkpart primary linux-swap 1M 1024M",
|
||||
"parted /dev/vda -- mkpart primary 1024M -1s",
|
||||
"udevadm settle",
|
||||
|
||||
"mkswap /dev/vda1 -L swap",
|
||||
"swapon -L swap",
|
||||
|
||||
"zpool create rpool /dev/vda2",
|
||||
"zfs create -o mountpoint=legacy rpool/root",
|
||||
"mount -t zfs rpool/root /mnt",
|
||||
|
||||
"udevadm settle"
|
||||
);
|
||||
'';
|
||||
};
|
||||
|
||||
# Create two physical LVM partitions combined into one volume group
|
||||
# that contains the logical swap and root partitions.
|
||||
lvm = makeInstallerTest "lvm"
|
||||
|
|
Loading…
Reference in a new issue