2018-01-25 22:17:21 +01:00
|
|
|
import ./make-test.nix ({ pkgs, lib, ... }:
|
2017-11-26 01:15:10 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "statsd";
|
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ ma27 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes.statsd1 = {
|
|
|
|
services.statsd.enable = true;
|
|
|
|
services.statsd.backends = [ "statsd-influxdb-backend" "console" ];
|
|
|
|
services.statsd.extraConfig = ''
|
|
|
|
influxdb: {
|
|
|
|
username: "root",
|
|
|
|
password: "root",
|
|
|
|
database: "statsd"
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
services.influxdb.enable = true;
|
|
|
|
|
|
|
|
systemd.services.influx-init = {
|
|
|
|
description = "Setup Influx Test Base";
|
|
|
|
after = [ "influxdb.service" ];
|
|
|
|
before = [ "statsd.service" ];
|
|
|
|
|
|
|
|
script = ''
|
|
|
|
echo "CREATE DATABASE statsd" | ${pkgs.influxdb}/bin/influx
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
$statsd1->start();
|
|
|
|
$statsd1->waitForUnit("statsd.service");
|
2018-05-09 12:38:09 +02:00
|
|
|
$statsd1->waitUntilSucceeds("nc -z 127.0.0.1 8126");
|
2017-11-26 01:15:10 +01:00
|
|
|
'';
|
|
|
|
})
|