From 0b2d9bbbd25856aab2faec08b79e07f1ef9ca002 Mon Sep 17 00:00:00 2001 From: WilliButz Date: Mon, 18 Sep 2017 16:59:50 +0200 Subject: nixos/tests: add grafana test (#29531) --- nixos/release.nix | 1 + nixos/tests/grafana.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 nixos/tests/grafana.nix diff --git a/nixos/release.nix b/nixos/release.nix index cbb566af786..d7b42c53b99 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -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 {}; diff --git a/nixos/tests/grafana.nix b/nixos/tests/grafana.nix new file mode 100644 index 00000000000..16b8181498a --- /dev/null +++ b/nixos/tests/grafana.nix @@ -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/"); + ''; +}) -- cgit 1.4.1