about summary refs log tree commit diff
path: root/nixos/tests/grafana.nix
blob: 9dc765a879bcf99d71745b9f6a61d99c48e1c979 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import ./make-test.nix ({ lib, ... }:
{
  name = "grafana";

  meta = with lib.maintainers; {
    maintainers = [ willibutz ];
  };

  machine = { ... }: {
    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 -sSfL http://127.0.0.1:3000/");
  '';
})