summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarek Mahut <marek.mahut@gmail.com>2019-08-19 21:27:16 +0200
committerGitHub <noreply@github.com>2019-08-19 21:27:16 +0200
commit3b6258946fce8767a2f452237c85ba4c93c420fc (patch)
treeba172d09deaf513b18b33af76f73470026d8dac3
parentc4592aa1616d9cc2d01b719e9b64301f3fb009c8 (diff)
parent9e2a8f50237d1c3def60aabea16d099bfdae576e (diff)
downloadnixpkgs-3b6258946fce8767a2f452237c85ba4c93c420fc.tar
nixpkgs-3b6258946fce8767a2f452237c85ba4c93c420fc.tar.gz
nixpkgs-3b6258946fce8767a2f452237c85ba4c93c420fc.tar.bz2
nixpkgs-3b6258946fce8767a2f452237c85ba4c93c420fc.tar.lz
nixpkgs-3b6258946fce8767a2f452237c85ba4c93c420fc.tar.xz
nixpkgs-3b6258946fce8767a2f452237c85ba4c93c420fc.tar.zst
nixpkgs-3b6258946fce8767a2f452237c85ba4c93c420fc.zip
Merge pull request #64407 from dasJ/icingaweb-test
nixos/icingaweb: Fix module path; Add test
-rw-r--r--nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix4
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/icingaweb2.nix71
3 files changed, 75 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix b/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix
index 910e1d937bf..6740131dccd 100644
--- a/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix
+++ b/nixos/modules/services/web-apps/icingaweb2/icingaweb2.nix
@@ -5,10 +5,12 @@
 
   defaultConfig = {
     global = {
-      module_path = "${pkgs.icingaweb2}/modules${optionalString (builtins.length config.modulePath > 0) ":${concatStringsSep ":" config.modulePath}"}";
+      module_path = "${pkgs.icingaweb2}/modules";
     };
   };
 in {
+  meta.maintainers = with maintainers; [ das_j ];
+
   options.services.icingaweb2 = with types; {
     enable = mkEnableOption "the icingaweb2 web interface";
 
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 305c070752b..ea95cdd5a02 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -115,6 +115,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");
+  '';
+})