From 5dad91559d17ba86dab3f9f7afe1a89827237ef3 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Mon, 24 Jun 2024 22:46:52 +0100 Subject: [PATCH 1/2] nixos/graylog: Added more test gates --- nixos/tests/graylog.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/tests/graylog.nix b/nixos/tests/graylog.nix index 3f7cc3a91439..cb9e5f8c7ffb 100644 --- a/nixos/tests/graylog.nix +++ b/nixos/tests/graylog.nix @@ -65,9 +65,18 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { in '' machine.start() machine.wait_for_unit("graylog.service") + + machine.wait_until_succeeds( + "journalctl -o cat -u graylog.service | grep 'Started REST API at <127.0.0.1:9000>'" + ) + machine.wait_for_open_port(9000) machine.succeed("curl -sSfL http://127.0.0.1:9000/") + machine.wait_until_succeeds( + "journalctl -o cat -u graylog.service | grep 'Graylog server up and running'" + ) + session = machine.succeed( "curl -X POST " + "-sSfL http://127.0.0.1:9000/api/system/sessions " @@ -87,6 +96,10 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { + "-H 'x-requested-by: cli' " ) + machine.wait_until_succeeds( + "journalctl -o cat -u graylog.service | grep -E 'Input \[GELF UDP/Demo/[[:alnum:]]{24}\] is now RUNNING'" + ) + machine.wait_until_succeeds( "test \"$(curl -sSfL 'http://127.0.0.1:9000/api/cluster/inputstates' " + f"-u {session}:session " From 2c06c1e73c907304d7f288c647b9caebb8deb158 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Mon, 24 Jun 2024 22:47:28 +0100 Subject: [PATCH 2/2] nixos/graylog: Increased disk size, fixes preflight check: Preflight check failed with error: Journal directory has not enough free space (3412 MB) available. You need to provide additional 1707 MB to contain 'message_journal_max_size = 5120 MB' --- nixos/tests/graylog.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/graylog.nix b/nixos/tests/graylog.nix index cb9e5f8c7ffb..9d19dcf028eb 100644 --- a/nixos/tests/graylog.nix +++ b/nixos/tests/graylog.nix @@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { nodes.machine = { pkgs, ... }: { virtualisation.memorySize = 4096; - virtualisation.diskSize = 4096; + virtualisation.diskSize = 1024 * 6; services.mongodb.enable = true; services.elasticsearch.enable = true;