depot/nixos/tests/homebox.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

26 lines
631 B
Nix

import ./make-test-python.nix (
{ pkgs, ... }:
let
port = "7745";
in
{
name = "homebox";
meta = with pkgs.lib.maintainers; {
maintainers = [ patrickdag ];
};
nodes.machine = {
services.homebox = {
enable = true;
settings.HBOX_WEB_PORT = port;
};
};
testScript = ''
machine.wait_for_unit("homebox.service")
machine.wait_for_open_port(${port})
machine.succeed("curl --fail -X GET 'http://localhost:${port}/'")
out = machine.succeed("curl --fail 'http://localhost:${port}/api/v1/status'")
assert '"health":true' in out
'';
}
)