nixos/tests/victorialogs: init

This commit is contained in:
Marie Ramlow 2025-06-21 19:07:56 +02:00
parent ebfbc036ef
commit 3f9e587d44
3 changed files with 32 additions and 0 deletions

View File

@ -1469,6 +1469,7 @@ in
vector = import ./vector { inherit runTest; };
velocity = runTest ./velocity.nix;
vengi-tools = runTest ./vengi-tools.nix;
victorialogs = runTest ./victorialogs.nix;
victoriametrics = handleTest ./victoriametrics { };
vikunja = runTest ./vikunja.nix;
virtualbox = handleTestOn [ "x86_64-linux" ] ./virtualbox.nix { };

View File

@ -0,0 +1,26 @@
{ lib, ... }:
{
name = "victorialogs";
meta.maintainers = with lib.maintainers; [ marie ];
nodes.machine =
{ pkgs, ... }:
{
services.victorialogs.enable = true;
services.journald.upload = {
enable = true;
settings = {
Upload.URL = "http://localhost:9428/insert/journald";
};
};
environment.systemPackages = [ pkgs.curl ];
};
testScript = ''
machine.wait_for_unit("victorialogs.service")
machine.succeed("echo 'meow' | systemd-cat -p info")
machine.wait_until_succeeds("curl --fail http://localhost:9428/select/logsql/query -d 'query=\"meow\"' | grep meow")
'';
}

View File

@ -56,6 +56,11 @@ buildGoModule (finalAttrs: {
__darwinAllowLocalNetworking = true;
passthru = {
tests = {
inherit (nixosTests)
victorialogs
;
};
updateScript = nix-update-script {
extraArgs = [ "--version-regex=(.*)-victorialogs" ];
};