nixpkgs/nixos/tests/graphite.nix

33 lines
945 B
Nix
Raw Normal View History

import ./make-test.nix ({ pkgs, ...} :
{
name = "graphite";
nodes = {
one =
{ config, pkgs, ... }: {
2017-10-31 17:49:59 +03:00
time.timeZone = "UTC";
services.graphite = {
2017-10-31 17:49:59 +03:00
web.enable = true;
api = {
enable = true;
2017-10-31 17:49:59 +03:00
port = 8082;
};
2017-10-31 17:49:59 +03:00
carbon.enableCache = true;
seyren.enable = true;
pager.enable = true;
};
};
2017-10-31 17:49:59 +03:00
};
testScript = ''
startAll;
$one->waitForUnit("default.target");
$one->requireActiveUnit("graphiteWeb.service");
2017-10-31 17:49:59 +03:00
$one->requireActiveUnit("graphiteApi.service");
$one->requireActiveUnit("graphitePager.service");
$one->requireActiveUnit("carbonCache.service");
2017-10-31 17:49:59 +03:00
$one->requireActiveUnit("seyren.service");
$one->succeed("echo \"foo 1 `date +%s`\" | nc -q0 localhost 2003");
$one->waitUntilSucceeds("curl 'http://localhost:8080/metrics/find/?query=foo&format=treejson' --silent | grep foo")
'';
})