tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/victorialogs: add integration test with vlagent
Shawn8901
6 months ago
cea3b9b1
37deae36
+65
-2
4 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
victorialogs
default.nix
local-write.nix
remote-write-with-vlagent.nix
+1
-1
nixos/tests/all-tests.nix
···
1547
1547
vector = import ./vector { inherit runTest; };
1548
1548
velocity = runTest ./velocity.nix;
1549
1549
vengi-tools = runTest ./vengi-tools.nix;
1550
1550
-
victorialogs = runTest ./victorialogs.nix;
1550
1550
+
victorialogs = import ./victorialogs { inherit runTest; };
1551
1551
victoriametrics = import ./victoriametrics { inherit runTest; };
1552
1552
vikunja = runTest ./vikunja.nix;
1553
1553
virtualbox = handleTestOn [ "x86_64-linux" ] ./virtualbox.nix { };
+1
-1
nixos/tests/victorialogs.nix
nixos/tests/victorialogs/local-write.nix
···
1
1
{ lib, ... }:
2
2
{
3
3
-
name = "victorialogs";
3
3
+
name = "victorialogs-local-write";
4
4
meta.maintainers = with lib.maintainers; [ marie ];
5
5
6
6
nodes.machine =
+5
nixos/tests/victorialogs/default.nix
···
1
1
+
{ runTest }:
2
2
+
{
3
3
+
local-write = runTest ./local-write.nix;
4
4
+
remote-write-with-vlagent = runTest ./remote-write-with-vlagent.nix;
5
5
+
}
+58
nixos/tests/victorialogs/remote-write-with-vlagent.nix
···
1
1
+
{ lib, pkgs, ... }:
2
2
+
let
3
3
+
4
4
+
username = "vltest";
5
5
+
password = "rUceu1W41U"; # random string
6
6
+
passwordFile = pkgs.writeText "password-file" password;
7
7
+
in
8
8
+
{
9
9
+
name = "victorialogs-remote-write-with-vlagent";
10
10
+
meta.maintainers = [ lib.maintainers.shawn8901 ];
11
11
+
12
12
+
nodes.server =
13
13
+
{ pkgs, ... }:
14
14
+
{
15
15
+
networking.firewall.allowedTCPPorts = [ 9428 ];
16
16
+
services.victorialogs = {
17
17
+
enable = true;
18
18
+
basicAuthUsername = username;
19
19
+
basicAuthPasswordFile = toString passwordFile;
20
20
+
};
21
21
+
};
22
22
+
23
23
+
nodes.client =
24
24
+
{ pkgs, ... }:
25
25
+
{
26
26
+
services.vlagent = {
27
27
+
enable = true;
28
28
+
remoteWrite = {
29
29
+
url = "http://server:9428/internal/insert";
30
30
+
basicAuthUsername = username;
31
31
+
basicAuthPasswordFile = toString passwordFile;
32
32
+
};
33
33
+
};
34
34
+
35
35
+
services.journald.upload = {
36
36
+
enable = true;
37
37
+
settings = {
38
38
+
Upload.URL = "http://localhost:9429/insert/journald";
39
39
+
};
40
40
+
};
41
41
+
environment.systemPackages = [ pkgs.curl ];
42
42
+
43
43
+
};
44
44
+
45
45
+
testScript = ''
46
46
+
server.wait_for_unit("victorialogs.service")
47
47
+
server.wait_for_open_port(9428)
48
48
+
49
49
+
client.wait_for_unit("vlagent")
50
50
+
client.wait_for_open_port(9429)
51
51
+
52
52
+
client.wait_for_unit("systemd-journal-upload")
53
53
+
54
54
+
client.succeed("echo 'meow' | systemd-cat -p info")
55
55
+
56
56
+
server.wait_until_succeeds("curl -u ${username}:${password} --fail http://localhost:9428/select/logsql/query -d 'query=\"meow\"' | grep meow")
57
57
+
'';
58
58
+
}