about summary refs log tree commit diff
path: root/modules/profiles
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-05-03 19:32:26 +0200
committeraszlig <aszlig@redmoonstudios.org>2016-05-03 19:32:26 +0200
commit52185e17867333878f4b7d9db232c33269cb7b80 (patch)
tree7f52dd6aeb18e91226b61cc43a5818421ba8d701 /modules/profiles
parent17f255cd6be91dc8ed911c2b7e0d73f32f041913 (diff)
profiles/tests: Add new upstream tests
Adds the following missing tests which were missing for our
machine-based checks:

 * Taskserver
 * bridging, IPv4 and IPv6 for containers
 * dnscrypt-proxy
 * imperative containers
 * keymap (only runs if not on qwerty)
 * netbooting

These are the tests which were missing in Vuizvui as of current nixpkgs
revision NixOS/nixpkgs@bf8130684878747be7b1cc393f8aa147c500f14f.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules/profiles')
-rw-r--r--modules/profiles/tests.nix31
1 files changed, 30 insertions, 1 deletions
diff --git a/modules/profiles/tests.nix b/modules/profiles/tests.nix
index 106b5fba..efb0caaf 100644
--- a/modules/profiles/tests.nix
+++ b/modules/profiles/tests.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, lib, ... }:
+{ options, config, pkgs, lib, ... }:
 
 with lib;
 
@@ -9,6 +9,9 @@ let
 
   anyAttrs = pred: cfg: any id (mapAttrsToList (const pred) cfg);
 
+  isDefault = path: (getAttrFromPath path options).default
+                 == (getAttrFromPath path config);
+
   upstreamTests = concatMap mkTest [
     { check = config.services.avahi.enable;
       path  = ["nixos" "avahi"];
@@ -17,6 +20,7 @@ let
       paths = [
         ["nixos" "boot" "biosCdrom"]
         ["nixos" "boot" "biosUsb"]
+        ["nixos" "boot" "netboot"]
         ["nixos" "boot" "uefiCdrom"]
         ["nixos" "boot" "uefiUsb"]
       ];
@@ -30,6 +34,23 @@ let
     { check = config.containers != {};
       path  = ["nixos" "containers"];
     }
+    { check = anyAttrs (i: i.hostBridge != null) config.containers;
+      path  = ["nixos" "containers-bridge"];
+    }
+    { check = true;
+      path  = ["nixos" "containers-imperative"];
+    }
+    { check = anyAttrs (i: i.hostAddress  != null
+                        || i.localAddress != null) config.containers;
+      path  = ["nixos" "containers-ipv4"];
+    }
+    { check = anyAttrs (i: i.hostAddress6  != null
+                        || i.localAddress6 != null) config.containers;
+      path  = ["nixos" "containers-ipv6"];
+    }
+    { check = config.services.dnscrypt-proxy.enable;
+      path  = ["nixos" "dnscrypt-proxy"];
+    }
     { check = config.virtualisation.docker.enable;
       path  = ["nixos" "docker"];
     }
@@ -107,6 +128,11 @@ let
     { check = config.services.xserver.desktopManager.kde4.enable;
       path  = ["nixos" "kde4"];
     }
+    { check = !(isDefault ["services" "xserver" "layout"])
+           || !(isDefault ["services" "xserver" "xkbVariant"])
+           || !(isDefault ["i18n" "consoleKeyMap"]);
+      path  = ["nixos" "keymap"];
+    }
     { check = with config.services.kubernetes; apiserver.enable
            || scheduler.enable || controllerManager.enable || kubelet.enable
            || proxy.enable;
@@ -224,6 +250,9 @@ let
     { check = true;
       path  = ["nixos" "simple"];
     }
+    { check = config.services.taskserver.enable;
+      path  = ["nixos" "taskserver"];
+    }
     { check = config.services.tomcat.enable;
       path  = ["nixos" "tomcat"];
     }