3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #64407 from dasJ/icingaweb-test

nixos/icingaweb: Fix module path; Add test
This commit is contained in:
Marek Mahut 2019-08-19 21:27:16 +02:00 committed by GitHub
commit 3b6258946f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 1 deletions

View file

@ -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";

View file

@ -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 {};

View file

@ -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");
'';
})