nixos/victorialogs: add integration test with vlagent
This commit is contained in:
@@ -1547,7 +1547,7 @@ in
|
|||||||
vector = import ./vector { inherit runTest; };
|
vector = import ./vector { inherit runTest; };
|
||||||
velocity = runTest ./velocity.nix;
|
velocity = runTest ./velocity.nix;
|
||||||
vengi-tools = runTest ./vengi-tools.nix;
|
vengi-tools = runTest ./vengi-tools.nix;
|
||||||
victorialogs = runTest ./victorialogs.nix;
|
victorialogs = import ./victorialogs { inherit runTest; };
|
||||||
victoriametrics = import ./victoriametrics { inherit runTest; };
|
victoriametrics = import ./victoriametrics { inherit runTest; };
|
||||||
vikunja = runTest ./vikunja.nix;
|
vikunja = runTest ./vikunja.nix;
|
||||||
virtualbox = handleTestOn [ "x86_64-linux" ] ./virtualbox.nix { };
|
virtualbox = handleTestOn [ "x86_64-linux" ] ./virtualbox.nix { };
|
||||||
|
|||||||
5
nixos/tests/victorialogs/default.nix
Normal file
5
nixos/tests/victorialogs/default.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{ runTest }:
|
||||||
|
{
|
||||||
|
local-write = runTest ./local-write.nix;
|
||||||
|
remote-write-with-vlagent = runTest ./remote-write-with-vlagent.nix;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
name = "victorialogs";
|
name = "victorialogs-local-write";
|
||||||
meta.maintainers = with lib.maintainers; [ marie ];
|
meta.maintainers = with lib.maintainers; [ marie ];
|
||||||
|
|
||||||
nodes.machine =
|
nodes.machine =
|
||||||
58
nixos/tests/victorialogs/remote-write-with-vlagent.nix
Normal file
58
nixos/tests/victorialogs/remote-write-with-vlagent.nix
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{ lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
|
||||||
|
username = "vltest";
|
||||||
|
password = "rUceu1W41U"; # random string
|
||||||
|
passwordFile = pkgs.writeText "password-file" password;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = "victorialogs-remote-write-with-vlagent";
|
||||||
|
meta.maintainers = [ lib.maintainers.shawn8901 ];
|
||||||
|
|
||||||
|
nodes.server =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
networking.firewall.allowedTCPPorts = [ 9428 ];
|
||||||
|
services.victorialogs = {
|
||||||
|
enable = true;
|
||||||
|
basicAuthUsername = username;
|
||||||
|
basicAuthPasswordFile = toString passwordFile;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.client =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.vlagent = {
|
||||||
|
enable = true;
|
||||||
|
remoteWrite = {
|
||||||
|
url = "http://server:9428/internal/insert";
|
||||||
|
basicAuthUsername = username;
|
||||||
|
basicAuthPasswordFile = toString passwordFile;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.journald.upload = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
Upload.URL = "http://localhost:9429/insert/journald";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.systemPackages = [ pkgs.curl ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
server.wait_for_unit("victorialogs.service")
|
||||||
|
server.wait_for_open_port(9428)
|
||||||
|
|
||||||
|
client.wait_for_unit("vlagent")
|
||||||
|
client.wait_for_open_port(9429)
|
||||||
|
|
||||||
|
client.wait_for_unit("systemd-journal-upload")
|
||||||
|
|
||||||
|
client.succeed("echo 'meow' | systemd-cat -p info")
|
||||||
|
|
||||||
|
server.wait_until_succeeds("curl -u ${username}:${password} --fail http://localhost:9428/select/logsql/query -d 'query=\"meow\"' | grep meow")
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user