Merge pull request #265365 from JulienMalka/systemd-boot-garbage-test

nixos/tests/systemd-boot: add garbage-collect-entry test

authored by

Julien Malka and committed by
GitHub
4d968c70 de20681f

+29
+29
nixos/tests/systemd-boot.nix
··· 252 ''; 253 }; 254 255 # Some UEFI firmwares fail on large reads. Now that systemd-boot loads initrd 256 # itself, systems with such firmware won't boot without this fix 257 uefiLargeFileWorkaround = makeTest {
··· 252 ''; 253 }; 254 255 + garbage-collect-entry = makeTest { 256 + name = "systemd-boot-switch-test"; 257 + meta.maintainers = with pkgs.lib.maintainers; [ julienmalka ]; 258 + 259 + nodes = { 260 + inherit common; 261 + machine = { pkgs, nodes, ... }: { 262 + imports = [ common ]; 263 + 264 + # These are configs for different nodes, but we'll use them here in `machine` 265 + system.extraDependencies = [ 266 + nodes.common.system.build.toplevel 267 + ]; 268 + }; 269 + }; 270 + 271 + testScript = { nodes, ... }: 272 + let 273 + baseSystem = nodes.common.system.build.toplevel; 274 + in 275 + '' 276 + machine.succeed("nix-env -p /nix/var/nix/profiles/system --set ${baseSystem}") 277 + machine.succeed("nix-env -p /nix/var/nix/profiles/system --delete-generations 1") 278 + machine.succeed("${baseSystem}/bin/switch-to-configuration boot") 279 + machine.fail("test -e /boot/loader/entries/nixos-generation-1.conf") 280 + machine.succeed("test -e /boot/loader/entries/nixos-generation-2.conf") 281 + ''; 282 + }; 283 + 284 # Some UEFI firmwares fail on large reads. Now that systemd-boot loads initrd 285 # itself, systems with such firmware won't boot without this fix 286 uefiLargeFileWorkaround = makeTest {