nixos/tests: add grafana test (#29531)

authored by

WilliButz and committed by
Franz Pletz
0b2d9bbb 4850bc70

+26
+1
nixos/release.nix
··· 254 254 tests.gocd-server = callTest tests/gocd-server.nix {}; 255 255 tests.gnome3 = callTest tests/gnome3.nix {}; 256 256 tests.gnome3-gdm = callTest tests/gnome3-gdm.nix {}; 257 + tests.grafama = callTest tests/grafana.nix {}; 257 258 tests.hardened = callTest tests/hardened.nix { }; 258 259 tests.hibernate = callTest tests/hibernate.nix {}; 259 260 tests.hound = callTest tests/hound.nix {};
+25
nixos/tests/grafana.nix
··· 1 + import ./make-test.nix ({ lib, ... }: 2 + { 3 + name = "grafana"; 4 + 5 + meta = with lib.maintainers; { 6 + maintainers = [ willibutz ]; 7 + }; 8 + 9 + machine = { config, pkgs, ... }: { 10 + services.grafana = { 11 + enable = true; 12 + addr = "localhost"; 13 + analytics.reporting.enable = false; 14 + domain = "localhost"; 15 + security.adminUser = "testusername"; 16 + }; 17 + }; 18 + 19 + testScript = '' 20 + $machine->start; 21 + $machine->waitForUnit("grafana.service"); 22 + $machine->waitForOpenPort(3000); 23 + $machine->succeed("curl -sS http://127.0.0.1:3000/"); 24 + ''; 25 + })