mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
Merge pull request #265365 from JulienMalka/systemd-boot-garbage-test
nixos/tests/systemd-boot: add garbage-collect-entry test
This commit is contained in:
commit
4d968c70fb
1 changed files with 29 additions and 0 deletions
|
@ -252,6 +252,35 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
garbage-collect-entry = makeTest {
|
||||||
|
name = "systemd-boot-switch-test";
|
||||||
|
meta.maintainers = with pkgs.lib.maintainers; [ julienmalka ];
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
inherit common;
|
||||||
|
machine = { pkgs, nodes, ... }: {
|
||||||
|
imports = [ common ];
|
||||||
|
|
||||||
|
# These are configs for different nodes, but we'll use them here in `machine`
|
||||||
|
system.extraDependencies = [
|
||||||
|
nodes.common.system.build.toplevel
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = { nodes, ... }:
|
||||||
|
let
|
||||||
|
baseSystem = nodes.common.system.build.toplevel;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
machine.succeed("nix-env -p /nix/var/nix/profiles/system --set ${baseSystem}")
|
||||||
|
machine.succeed("nix-env -p /nix/var/nix/profiles/system --delete-generations 1")
|
||||||
|
machine.succeed("${baseSystem}/bin/switch-to-configuration boot")
|
||||||
|
machine.fail("test -e /boot/loader/entries/nixos-generation-1.conf")
|
||||||
|
machine.succeed("test -e /boot/loader/entries/nixos-generation-2.conf")
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Some UEFI firmwares fail on large reads. Now that systemd-boot loads initrd
|
# Some UEFI firmwares fail on large reads. Now that systemd-boot loads initrd
|
||||||
# itself, systems with such firmware won't boot without this fix
|
# itself, systems with such firmware won't boot without this fix
|
||||||
uefiLargeFileWorkaround = makeTest {
|
uefiLargeFileWorkaround = makeTest {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue