Skip to content

Commit

Permalink
nixosTests.alloy: init VM test
Browse files Browse the repository at this point in the history
This adds a VM test, starting up Grafana Alloy and ensuring it comes
up healthy.
  • Loading branch information
flokli committed Jun 10, 2024
1 parent 486f515 commit c12da48
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ in {
akkoma = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./akkoma.nix {};
akkoma-confined = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./akkoma.nix { confined = true; };
alice-lg = handleTest ./alice-lg.nix {};
alloy = handleTest ./alloy.nix {};
allTerminfo = handleTest ./all-terminfo.nix {};
alps = handleTest ./alps.nix {};
amazon-init-shell = handleTest ./amazon-init-shell.nix {};
Expand Down
32 changes: 32 additions & 0 deletions nixos/tests/alloy.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import ./make-test-python.nix ({ lib, pkgs, ... }:

let
nodes = {
machine = {
services.alloy = {
enable = true;
};
environment.etc."alloy/config.alloy".text = "";
};
};
in
{
name = "alloy";

meta = with lib.maintainers; {
maintainers = [ flokli ];
};

inherit nodes;

testScript = ''
start_all()
machine.wait_for_unit("alloy.service")
machine.wait_for_open_port(12345)
machine.succeed(
"curl -sSfN http:https://127.0.0.1:12345/-/healthy"
)
machine.shutdown()
'';
})

0 comments on commit c12da48

Please sign in to comment.