nixos/tests: add nixos-rebuild-install-bootloader-ng

This commit is contained in:
Thiago Kenji Okada 2024-12-05 22:52:38 +00:00
parent c27b1c401a
commit 81148841b9
3 changed files with 8 additions and 3 deletions

View File

@ -711,6 +711,7 @@ in {
nixops = handleTest ./nixops/default.nix {};
nixos-generate-config = handleTest ./nixos-generate-config.nix {};
nixos-rebuild-install-bootloader = handleTestOn ["x86_64-linux"] ./nixos-rebuild-install-bootloader.nix {};
nixos-rebuild-install-bootloader-ng = handleTestOn ["x86_64-linux"] ./nixos-rebuild-install-bootloader.nix { withNg = true; };
nixos-rebuild-specialisations = runTestOn ["x86_64-linux"] ./nixos-rebuild-specialisations.nix;
nixos-rebuild-target-host = runTest ./nixos-rebuild-target-host.nix;
nixpkgs = pkgs.callPackage ../modules/misc/nixpkgs/test.nix { inherit evalMinimalConfig; };

View File

@ -1,4 +1,4 @@
import ./make-test-python.nix ({ pkgs, ... }: {
import ./make-test-python.nix ({ pkgs, lib, withNg ? false, ... }: {
name = "nixos-rebuild-install-bootloader";
nodes = {
@ -15,6 +15,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
};
system.includeBuildDependencies = true;
system.rebuild.enableNg = withNg;
virtualisation = {
cores = 2;
@ -27,7 +28,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
testScript =
let
configFile = pkgs.writeText "configuration.nix" ''
configFile = pkgs.writeText "configuration.nix" /* nix */ ''
{ lib, pkgs, ... }: {
imports = [
./hardware-configuration.nix
@ -40,12 +41,13 @@ import ./make-test-python.nix ({ pkgs, ... }: {
forceInstall = true;
};
system.rebuild.enableNg = ${lib.boolToString withNg};
documentation.enable = false;
}
'';
in
''
/* python */ ''
machine.start()
machine.succeed("udevadm settle")
machine.wait_for_unit("multi-user.target")

View File

@ -4,6 +4,7 @@
installShellFiles,
mkShell,
nix,
nixosTests,
python3,
python3Packages,
runCommand,
@ -94,6 +95,7 @@ python3Packages.buildPythonApplication rec {
};
tests = {
inherit (nixosTests) nixos-rebuild-install-bootloader-ng;
repl = callPackage ./tests/repl.nix { };
# NOTE: this is a passthru test rather than a build-time test because we
# want to keep the build closures small