diff options
author | happysalada <raphael@megzari.com> | 2020-11-30 16:22:08 +0900 |
---|---|---|
committer | happysalada <raphael@megzari.com> | 2020-11-30 16:22:08 +0900 |
commit | 627dfecaddb7461956bce70059edc885efcd292b (patch) | |
tree | ded024a7fa668d416658d0f6dc0307b45e23788f /nixos/tests/vector.nix | |
parent | 23b939cfc336612fc7c5ba6213aea7966c872153 (diff) |
nixos/vector: add module
Diffstat (limited to '')
-rw-r--r-- | nixos/tests/vector.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/nixos/tests/vector.nix b/nixos/tests/vector.nix new file mode 100644 index 000000000000..3da7d0f30edd --- /dev/null +++ b/nixos/tests/vector.nix @@ -0,0 +1,37 @@ +{ system ? builtins.currentSystem, config ? { } +, pkgs ? import ../.. { inherit system config; } }: + +with import ../lib/testing-python.nix { inherit system pkgs; }; +with pkgs.lib; + +{ + test1 = makeTest { + name = "vector-test1"; + meta.maintainers = [ pkgs.stdenv.lib.maintainers.thoughtpolice ]; + + machine = { config, pkgs, ... }: { + services.vector = { + enable = true; + journaldAccess = true; + settings = { + sources.journald.type = "journald"; + + sinks = { + file = { + type = "file"; + inputs = [ "journald" ]; + path = "/var/lib/vector/logs.log"; + encoding = { codec = "ndjson"; }; + }; + }; + }; + }; + }; + + # ensure vector is forwarding the messages appropriately + testScript = '' + machine.wait_for_unit("vector.service") + machine.succeed("test -f /var/lib/vector/logs.log") + ''; + }; +} |