about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-02-16 02:34:31 +0100
committeraszlig <aszlig@redmoonstudios.org>2017-02-16 03:06:35 +0100
commitc28fa7d310f161ecfbf5510c6d4b641b37c223d8 (patch)
treed6bcc1fc5622797513d8562880da3713c3224c57
parent966d578230a3e27b1485934ee27388a25d26b45c (diff)
core/tests: Update upstream NixOS tests
New tests as of NixOS/nixpkgs@b207bf523b8c49b037a4a87456d61f63043cd2c6:

  * containers-extra_veth
  * containers-hosts
  * containers-macvlans
  * containers-physical_interfaces
  * containers-tmpfs
  * glance
  * hound
  * keystone
  * leaps
  * mongodb
  * nat.firewall-conntrack
  * pam-oath-login
  * samba
  * sddm

The following tests were removed:

  * kde4
  * panamax

I've also added a few checks on whether containers are actually enabled,
because some tests like containers-bridge would run if containers with a
bridge were defined but enableContainers was false.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
-rw-r--r--modules/core/tests.nix64
1 files changed, 53 insertions, 11 deletions
diff --git a/modules/core/tests.nix b/modules/core/tests.nix
index 329b8d87..ae26ab0b 100644
--- a/modules/core/tests.nix
+++ b/modules/core/tests.nix
@@ -31,12 +31,22 @@ let
     { check = config.services.cjdns.enable;
       path  = ["nixos" "cjdns"];
     }
-    { check = config.containers != {};
+    { check = config.boot.enableContainers
+           && config.containers != {};
       path  = ["nixos" "containers"];
     }
-    { check = anyAttrs (i: i.hostBridge != null) config.containers;
+    { check = config.boot.enableContainers
+           && anyAttrs (i: i.hostBridge != null) config.containers;
       path  = ["nixos" "containers-bridge"];
     }
+    { check = config.boot.enableContainers
+           && anyAttrs (i: i.extraVeths != {}) config.containers;
+      path  = ["nixos" "containers-extra_veth"];
+    }
+    { check = config.boot.enableContainers
+           && anyAttrs (i: i.localAddress != []) config.containers;
+      path  = ["nixos" "containers-hosts"];
+    }
     { check = config.boot.enableContainers;
       path  = ["nixos" "containers-imperative"];
     }
@@ -51,8 +61,16 @@ let
       path  = ["nixos" "containers-ipv6"];
     }
     { check = config.boot.enableContainers
-           && anyAttrs (i: i.extraVeths != {}) config.containers;
-      path  = ["nixos" "containers-extra_veth"];
+           && anyAttrs (i: i.macvlans != []) config.containers;
+      path  = ["nixos" "containers-macvlans"];
+    }
+    { check = config.boot.enableContainers
+           && anyAttrs (i: i.interfaces != []) config.containers;
+      path  = ["nixos" "containers-physical_interfaces"];
+    }
+    { check = config.boot.enableContainers
+           && anyAttrs (i: i.tmpfs != []) config.containers;
+      path  = ["nixos" "containers-tmpfs"];
     }
     { check = config.services.dnscrypt-proxy.enable;
       path  = ["nixos" "dnscrypt-proxy"];
@@ -75,6 +93,9 @@ let
     { check = config.services.fleet.enable;
       path  = ["nixos" "fleet"];
     }
+    { check = config.virtualisation.openstack.glance.enable;
+      path  = ["nixos" "glance"];
+    }
     { check = config.services.xserver.desktopManager.gnome3.enable;
       path  = ["nixos" "gnome3"];
     }
@@ -93,6 +114,9 @@ let
     { check = true;
       path  = ["nixos" "hibernate"];
     }
+    { check = config.services.hound.enable;
+      path  = ["nixos" "hound"];
+    }
     { check = config.services.xserver.windowManager.i3.enable;
       path  = ["nixos" "i3wm"];
     }
@@ -143,11 +167,7 @@ let
     { check = config.services.jenkins.enable;
       path  = ["nixos" "jenkins"];
     }
-    { check = config.services.xserver.desktopManager.kde4.enable;
-      path  = ["nixos" "kde4"];
-    }
-    { check = config.services.xserver.displayManager.sddm.enable
-           || config.services.xserver.desktopManager.kde5.enable;
+    { check = config.services.xserver.desktopManager.kde5.enable;
       path  = ["nixos" "kde5"];
     }
     { check = config.i18n.consoleKeyMap          == "azerty/fr"
@@ -174,6 +194,9 @@ let
            || config.services.xserver.layout     == "de";
       path  = ["nixos" "keymap" "qwertz"];
     }
+    { check = config.virtualisation.openstack.keystone.enable;
+      path  = ["nixos" "keystone"];
+    }
     { check = with config.services.kubernetes; apiserver.enable
            || scheduler.enable || controllerManager.enable || kubelet.enable
            || proxy.enable;
@@ -183,6 +206,9 @@ let
            == pkgs.linuxPackages_latest.kernel.version;
       path  = ["nixos" "latestKernel" "login"];
     }
+    { check = config.services.leaps.enable;
+      path  = ["nixos" "leaps"];
+    }
     { check = true;
       path  = ["nixos" "login"];
     }
@@ -192,6 +218,9 @@ let
     { check = true;
       path  = ["nixos" "misc"];
     }
+    { check = config.services.mongodb.enable;
+      path  = ["nixos" "mongodb"];
+    }
     { check = config.services.murmur.enable;
       path  = ["nixos" "mumble"];
     }
@@ -210,6 +239,13 @@ let
            && config.networking.firewall.enable;
       path  = ["nixos" "nat" "firewall"];
     }
+    { check = with config.networking; let
+        isIptables = nat.enable || firewall.enable;
+        hasConntrack = firewall.connectionTrackingModules != []
+                    || firewall.autoLoadConntrackHelpers;
+      in isIptables && hasConntrack;
+      path  = ["nixos" "nat" "firewall-conntrack"];
+    }
     { check = config.networking.nat.enable
            && !config.networking.firewall.enable;
       path  = ["nixos" "nat" "standalone"];
@@ -259,8 +295,8 @@ let
     { check = config.services.openssh.enable;
       path  = ["nixos" "openssh"];
     }
-    { check = config.services.panamax.enable;
-      path  = ["nixos" "panamax"];
+    { check = config.security.pam.oath.enable;
+      path  = ["nixos" "pam-oath-login"];
     }
     { check = config.services.peerflix.enable;
       path  = ["nixos" "peerflix"];
@@ -288,6 +324,12 @@ let
     { check = true;
       path  = ["nixos" "runInMachine"];
     }
+    { check = config.services.samba.enable;
+      path  = ["nixos" "samba"];
+    }
+    { check = config.services.xserver.displayManager.sddm.enable;
+      path  = ["nixos" "sddm"];
+    }
     { check = true;
       path  = ["nixos" "simple"];
     }