nixpkgs-suyu/nixos/tests/logstash.nix
Jörg Thalheim 0334b75e12
logstash: fix test
embedded elasticsearch was removed: https://www.elastic.co/blog/logstash-1-4-3-released
2016-10-01 23:18:24 +02:00

41 lines
1.1 KiB
Nix

# This test runs logstash and checks if messages flows and
# elasticsearch is started.
import ./make-test.nix ({ pkgs, ...} : {
name = "logstash";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ eelco chaoflow offline ];
};
nodes = {
one =
{ config, pkgs, ... }:
{
services = {
logstash = {
enable = true;
inputConfig = ''
exec { command => "echo flowers" interval => 1 type => "test" }
exec { command => "echo dragons" interval => 1 type => "test" }
'';
filterConfig = ''
if [message] =~ /dragons/ {
drop {}
}
'';
outputConfig = ''
stdout { codec => rubydebug }
'';
};
};
};
};
testScript = ''
startAll;
$one->waitForUnit("logstash.service");
$one->waitUntilSucceeds("journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers");
$one->fail("journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep dragons");
'';
})