From 52185e17867333878f4b7d9db232c33269cb7b80 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 3 May 2016 19:32:26 +0200 Subject: 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 --- modules/profiles/tests.nix | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'modules/profiles') 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"]; } -- cgit 1.4.1