mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 17:49:07 +01:00
tests: Refactor
This commit is contained in:
parent
33b2bed5a9
commit
8cf724fb97
3 changed files with 29 additions and 65 deletions
|
|
@ -5,22 +5,28 @@
|
|||
let
|
||||
mkTest = dir: rec {
|
||||
name = "${dir}-test";
|
||||
value = pkgs.testers.runNixOSTest (
|
||||
{
|
||||
inherit name;
|
||||
}
|
||||
// import "${self}/tests/${dir}" {
|
||||
inherit
|
||||
inputs
|
||||
self
|
||||
pkgs
|
||||
lib
|
||||
;
|
||||
}
|
||||
);
|
||||
value = pkgs.testers.runNixOSTest {
|
||||
inherit name;
|
||||
imports = [ "${self}/tests/${dir}" ];
|
||||
node.specialArgs = { inherit inputs self; };
|
||||
defaults =
|
||||
{ nodes, ... }:
|
||||
{
|
||||
imports = [ self.nixosModules.default ];
|
||||
_module.args.allHosts = nodes |> lib.mapAttrs (_: node: { config = node; });
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
users.seb = {
|
||||
isNormalUser = true;
|
||||
password = "seb";
|
||||
};
|
||||
};
|
||||
custom.networking.underlay.interface = "eth1";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
checks = "${self}/tests" |> builtins.readDir |> lib.attrNames |> lib.map mkTest |> lib.listToAttrs;
|
||||
checks = "${self}/tests" |> self.lib.listDirectoryNames |> lib.map mkTest |> lib.listToAttrs;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue