summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2019-07-07 03:03:59 +0200
committerJanne Heß <janne@hess.ooo>2019-07-07 03:03:59 +0200
commit9e2a8f50237d1c3def60aabea16d099bfdae576e (patch)
tree2bdf507ecb9e599016abf00bb3c282ae57917a89 /nixos/tests
parente295fd81370929a4268e94ba95d86f3f296d610c (diff)
downloadnixpkgs-9e2a8f50237d1c3def60aabea16d099bfdae576e.tar
nixpkgs-9e2a8f50237d1c3def60aabea16d099bfdae576e.tar.gz
nixpkgs-9e2a8f50237d1c3def60aabea16d099bfdae576e.tar.bz2
nixpkgs-9e2a8f50237d1c3def60aabea16d099bfdae576e.tar.lz
nixpkgs-9e2a8f50237d1c3def60aabea16d099bfdae576e.tar.xz
nixpkgs-9e2a8f50237d1c3def60aabea16d099bfdae576e.tar.zst
nixpkgs-9e2a8f50237d1c3def60aabea16d099bfdae576e.zip
nixos/icingaweb: Fix module path; Add test
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/icingaweb2.nix71
2 files changed, 72 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 359f62751b9..f4e87b17375 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -111,6 +111,7 @@ in
   hound = handleTest ./hound.nix {};
   hydra = handleTest ./hydra {};
   i3wm = handleTest ./i3wm.nix {};
+  icingaweb2 = handleTest ./icingaweb2.nix {};
   iftop = handleTest ./iftop.nix {};
   incron = handleTest ./incron.nix {};
   influxdb = handleTest ./influxdb.nix {};
diff --git a/nixos/tests/icingaweb2.nix b/nixos/tests/icingaweb2.nix
new file mode 100644
index 00000000000..ea1b94c526b
--- /dev/null
+++ b/nixos/tests/icingaweb2.nix
@@ -0,0 +1,71 @@
+import ./make-test.nix ({ pkgs, ... }: {
+  name = "icingaweb2";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ das_j ];
+  };
+
+  nodes = {
+    icingaweb2 = { config, pkgs, ... }: {
+      services.icingaweb2 = {
+        enable = true;
+
+        modulePackages = with pkgs.icingaweb2Modules; {
+          particles = theme-particles;
+          spring = theme-spring;
+        };
+
+        modules = {
+          doc.enable = true;
+          migrate.enable =  true;
+          setup.enable = true;
+          test.enable = true;
+          translation.enable = true;
+        };
+
+        generalConfig = {
+          global = {
+            module_path = "${pkgs.icingaweb2}/modules";
+          };
+        };
+
+        authentications = {
+          icingaweb = {
+            backend = "external";
+          };
+        };
+
+        groupBackends = {
+          icingaweb = {
+            backend = "db";
+            resource = "icingaweb_db";
+          };
+        };
+
+        resources = {
+          # Not used, so no DB server needed
+          icingaweb_db = {
+            type = "db";
+            db = "mysql";
+            host = "localhost";
+            username = "icingaweb2";
+            password = "icingaweb2";
+            dbname = "icingaweb2";
+          };
+        };
+
+        roles = {
+          Administrators = {
+            users = "*";
+            permissions = "*";
+          };
+        };
+      };
+    };
+  };
+
+  testScript = ''
+    startAll();
+    $icingaweb2->waitForUnit("multi-user.target");
+    $icingaweb2->succeed("curl -sSf http://icingaweb2/authentication/login");
+  '';
+})