nixpkgs/nixos/tests/airsonic.nix

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

31 lines
607 B
Nix
Raw Normal View History

{ pkgs, ... }:
{
name = "airsonic";
meta = with pkgs.lib.maintainers; {
maintainers = [ sumnerevans ];
};
2021-05-03 09:38:02 -06:00
nodes.machine =
{ pkgs, ... }:
{
services.airsonic = {
enable = true;
maxMemory = 800;
2021-05-03 09:38:02 -06:00
};
};
2021-05-03 09:38:02 -06:00
testScript = ''
def airsonic_is_up(_) -> bool:
status, _ = machine.execute("curl --fail http://localhost:4040/login")
return status == 0
2021-05-03 09:38:02 -06:00
machine.start()
machine.wait_for_unit("airsonic.service")
machine.wait_for_open_port(4040)
2021-05-03 09:38:02 -06:00
with machine.nested("Waiting for UI to work"):
retry(airsonic_is_up)
'';
}