nixos/tests: add grafana test (#29531)

This commit is contained in:
WilliButz 2017-09-18 16:59:50 +02:00 committed by Franz Pletz
parent 4850bc7080
commit 0b2d9bbbd2
2 changed files with 26 additions and 0 deletions

View file

@ -254,6 +254,7 @@ in rec {
tests.gocd-server = callTest tests/gocd-server.nix {};
tests.gnome3 = callTest tests/gnome3.nix {};
tests.gnome3-gdm = callTest tests/gnome3-gdm.nix {};
tests.grafama = callTest tests/grafana.nix {};
tests.hardened = callTest tests/hardened.nix { };
tests.hibernate = callTest tests/hibernate.nix {};
tests.hound = callTest tests/hound.nix {};

25
nixos/tests/grafana.nix Normal file
View file

@ -0,0 +1,25 @@
import ./make-test.nix ({ lib, ... }:
{
name = "grafana";
meta = with lib.maintainers; {
maintainers = [ willibutz ];
};
machine = { config, pkgs, ... }: {
services.grafana = {
enable = true;
addr = "localhost";
analytics.reporting.enable = false;
domain = "localhost";
security.adminUser = "testusername";
};
};
testScript = ''
$machine->start;
$machine->waitForUnit("grafana.service");
$machine->waitForOpenPort(3000);
$machine->succeed("curl -sS http://127.0.0.1:3000/");
'';
})