diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2017-11-26 01:15:10 +0100 |
---|---|---|
committer | Rok Garbas <rok@garbas.si> | 2017-12-04 16:56:16 +0100 |
commit | af75b48b518a0d897693dafefbb3c02eaf3215cc (patch) | |
tree | 0a24037ce96e0f7a377a8a87bf4a5b9c2aadf148 /nixos/tests/statsd.nix | |
parent | aaf1e1c4fb6e42d4b37928ba4d98cfbf1a67e8f1 (diff) | |
download | nixpkgs-af75b48b518a0d897693dafefbb3c02eaf3215cc.tar nixpkgs-af75b48b518a0d897693dafefbb3c02eaf3215cc.tar.gz nixpkgs-af75b48b518a0d897693dafefbb3c02eaf3215cc.tar.bz2 nixpkgs-af75b48b518a0d897693dafefbb3c02eaf3215cc.tar.lz nixpkgs-af75b48b518a0d897693dafefbb3c02eaf3215cc.tar.xz nixpkgs-af75b48b518a0d897693dafefbb3c02eaf3215cc.tar.zst nixpkgs-af75b48b518a0d897693dafefbb3c02eaf3215cc.zip |
services.statsd: add simple test
Diffstat (limited to 'nixos/tests/statsd.nix')
-rw-r--r-- | nixos/tests/statsd.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/nixos/tests/statsd.nix b/nixos/tests/statsd.nix new file mode 100644 index 00000000000..d6bbc390163 --- /dev/null +++ b/nixos/tests/statsd.nix @@ -0,0 +1,40 @@ +import ./make-test.nix ({ pkgs, lib }: + +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"); + $statsd1->succeed("nc -z 127.0.0.1 8126"); + ''; +}) |