1import ./make-test-python.nix (
2 { pkgs, ... }:
3 {
4 name = "graphite";
5 nodes = {
6 one =
7 { ... }:
8 {
9 time.timeZone = "UTC";
10 services.graphite = {
11 web = {
12 enable = true;
13 extraConfig = ''
14 SECRET_KEY = "abcd";
15 '';
16 };
17 carbon.enableCache = true;
18 seyren.enable = false; # Implicitly requires openssl-1.0.2u which is marked insecure
19 };
20 };
21 };
22
23 testScript = ''
24 start_all()
25 one.wait_for_unit("default.target")
26 one.wait_for_unit("graphiteWeb.service")
27 one.wait_for_unit("carbonCache.service")
28 # The services above are of type "simple". systemd considers them active immediately
29 # even if they're still in preStart (which takes quite long for graphiteWeb).
30 # Wait for ports to open so we're sure the services are up and listening.
31 one.wait_for_open_port(8080)
32 one.wait_for_open_port(2003)
33 one.succeed('echo "foo 1 `date +%s`" | nc -N localhost 2003')
34 one.wait_until_succeeds(
35 "curl 'http://localhost:8080/metrics/find/?query=foo&format=treejson' --silent | grep foo >&2"
36 )
37 '';
38 }
39)