aboutsummaryrefslogtreecommitdiffstats
path: root/tests/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tests/default.nix')
-rw-r--r--tests/default.nix48
1 files changed, 26 insertions, 22 deletions
diff --git a/tests/default.nix b/tests/default.nix
index 88ea7d9..870ecfb 100644
--- a/tests/default.nix
+++ b/tests/default.nix
@@ -1,7 +1,10 @@
{
- specialArgs,
- nixLib,
- pkgs,
+ packageSets,
+ extra_modules,
+ module_args,
+ special_args,
+ extra_lib,
+ sources,
}: let
splitAttr = attr: let
pairs = builtins.attrNames attr;
@@ -50,31 +53,28 @@
ports ? [],
# If `true`, will ignore this test.
ignore ? null,
+ # Should this test use the stable nixpkgs?
+ stable ? true,
testScript ? {_, ...}: "",
}: let
# Apparently the default's (e.g. `serivces ? []`), are not applied for the `@args`
# syntax.
args = {inherit dns ignore name nodes ports serverDomains services testScript;};
+ pkgs =
+ if stable
+ then packageSets.stable
+ else packageSets.unstable;
in
- specialArgs.nixos-lib.runTest {
- hostPkgs = pkgs;
+ pkgs.testers.runNixOSTest {
inherit (args) name;
meta.broken = pkgs.lib.mkIf (args.ignore != null) true;
node = {
- specialArgs = {
- inherit
- (specialArgs)
- pkgsUnstable
- vhackPackages
- nixpkgs-unstable
- ;
- inherit nixLib;
- };
+ specialArgs = special_args;
# Use the nixpkgs as constructed by the `nixpkgs.*` options
- pkgs = null;
+ pkgs = packageSets.unstable.lib.mkForce null;
};
nodes = pkgs.lib.mkMerge [
@@ -87,7 +87,7 @@
};
name_server = {nodes, ...}: {
imports =
- specialArgs.extraModules
+ extra_modules
++ [
./common/acme/client.nix
./common/dns/server.nix
@@ -130,7 +130,7 @@
args.nodes
(builtins.mapAttrs (_: _: {
imports =
- specialArgs.extraModules
+ extra_modules
++ [
./common/acme/client.nix
./common/dns/client.nix
@@ -325,14 +325,18 @@
);
};
- tests = nixLib.mkByName {
+ tests = extra_lib.mkByName {
baseDirectory = ./by-name;
fileName = "test.nix";
finalizeFunction = name: value:
- import value (nixLib.warnMerge specialArgs {
- inherit pkgs vhack;
- inherit (pkgs) lib;
- } "the test args set");
+ # import value (extra_lib.warnMerge special_args {
+ # inherit pkgs vhack;
+ # inherit (pkgs) lib;
+ # } "the test args set");
+ import value {
+ inherit packageSets vhack sources;
+ inherit (packageSets.unstable) lib;
+ };
};
in
tests