diff options
author | Austin Seipp <aseipp@pobox.com> | 2020-12-02 03:30:11 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 03:30:11 -0600 |
commit | 652ac693730ff25ce2193cbd97ae46f1309ff767 (patch) | |
tree | b61d4633cee3993afbe7ccc891f10503cd624692 /nixos/tests | |
parent | c9ae57cdb495a3f5bc5171cea296c9e8b4d1ca56 (diff) | |
parent | 85767db6b8b30dd11191e287a6a2fe1e2275ede1 (diff) |
Merge pull request #103393 from happysalada/add_vector
nixos/vector: add module
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/vector.nix | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index fa14d829ff65..2e79a214569a 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -387,6 +387,7 @@ in uwsgi = handleTest ./uwsgi.nix {}; v2ray = handleTest ./v2ray.nix {}; vault = handleTest ./vault.nix {}; + vector = handleTest ./vector.nix {}; victoriametrics = handleTest ./victoriametrics.nix {}; virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {}; wasabibackend = handleTest ./wasabibackend.nix {}; diff --git a/nixos/tests/vector.nix b/nixos/tests/vector.nix new file mode 100644 index 000000000000..e96c3ad152f3 --- /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.happysalada ]; + + 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") + ''; + }; +} |