nixos: Installer tests for systemd stage 1

This commit is contained in:
Will Fancher 2022-04-17 17:24:13 -04:00
parent 9e8b463cce
commit 9ee5d61a16
4 changed files with 44 additions and 1 deletions

View file

@ -99,6 +99,10 @@ with lib;
stdenvNoCC # for runCommand
busybox
jq # for closureInfo
# For boot.initrd.systemd
makeInitrdNGTool
systemdStage1
systemdStage1Network
];
# Show all debug messages from the kernel but don't log refused packets

View file

@ -232,6 +232,7 @@ in
input-remapper = handleTest ./input-remapper.nix {};
inspircd = handleTest ./inspircd.nix {};
installer = handleTest ./installer.nix {};
installer-systemd-stage-1 = handleTest ./installer-systemd-stage-1.nix {};
invoiceplane = handleTest ./invoiceplane.nix {};
iodine = handleTest ./iodine.nix {};
ipfs = handleTest ./ipfs.nix {};

View file

@ -0,0 +1,33 @@
{ system ? builtins.currentSystem
, config ? {}
, pkgs ? import ../.. { inherit system config; }
}:
{
# Some of these tests don't work with systemd stage 1 yet. Uncomment
# them when fixed.
inherit (import ./installer.nix { inherit system config pkgs; systemdStage1 = true; })
# bcache
# btrfsSimple
# btrfsSubvolDefault
# btrfsSubvols
# encryptedFSWithKeyfile
# grub1
# luksroot
# luksroot-format1
# luksroot-format2
# lvm
separateBoot
separateBootFat
simple
simpleLabels
simpleProvided
simpleSpecialised
simpleUefiGrub
simpleUefiGrubSpecialisation
simpleUefiSystemdBoot
# swraid
# zfsroot
;
}

View file

@ -1,6 +1,7 @@
{ system ? builtins.currentSystem,
config ? {},
pkgs ? import ../.. { inherit system config; }
pkgs ? import ../.. { inherit system config; },
systemdStage1 ? false
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
@ -23,6 +24,8 @@ let
# To ensure that we can rebuild the grub configuration on the nixos-rebuild
system.extraDependencies = with pkgs; [ stdenvNoCC ];
${optionalString systemdStage1 "boot.initrd.systemd.enable = true;"}
${optionalString (bootLoader == "grub") ''
boot.loader.grub.version = ${toString grubVersion};
${optionalString (grubVersion == 1) ''
@ -290,6 +293,8 @@ let
virtualisation.cores = 8;
virtualisation.memorySize = 1536;
boot.initrd.systemd.enable = systemdStage1;
# Use a small /dev/vdb as the root disk for the
# installer. This ensures the target disk (/dev/vda) is
# the same during and after installation.