0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-21 01:20:34 +03:00
nixpkgs/nixos/tests/homebox.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1 KiB
Nix
Raw Normal View History

2024-06-15 15:25:40 +02:00
import ./make-test-python.nix (
{ pkgs, ... }:
let
port = "7745";
in
{
name = "homebox";
meta = with pkgs.lib.maintainers; {
maintainers = [ patrickdag ];
};
nodes =
let
self = {
simple = {
services.homebox = {
enable = true;
settings.HBOX_WEB_PORT = port;
};
};
postgres = {
imports = [ self.simple ];
services.homebox.database.createLocally = true;
};
};
in
self;
2024-06-15 15:25:40 +02:00
testScript = ''
def test_homebox(node):
node.wait_for_unit("homebox.service")
node.wait_for_open_port(${port})
node.succeed("curl --fail -X GET 'http://localhost:${port}/'")
out = node.succeed("curl --fail 'http://localhost:${port}/api/v1/status'")
assert '"health":true' in out
2024-06-15 15:25:40 +02:00
test_homebox(simple)
simple.send_monitor_command("quit")
simple.wait_for_shutdown()
test_homebox(postgres)
2024-06-15 15:25:40 +02:00
'';
}
)