2021-05-03 17:38:02 +02:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
|
|
name = "airsonic";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ sumnerevans ];
|
|
|
|
};
|
|
|
|
|
2022-03-21 00:15:30 +01:00
|
|
|
nodes.machine =
|
2021-05-03 17:38:02 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
services.airsonic = {
|
|
|
|
enable = true;
|
|
|
|
maxMemory = 800;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
def airsonic_is_up(_) -> bool:
|
2022-07-19 16:39:13 +02:00
|
|
|
status, _ = machine.execute("curl --fail http://localhost:4040/login")
|
|
|
|
return status == 0
|
2021-05-03 17:38:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
machine.start()
|
|
|
|
machine.wait_for_unit("airsonic.service")
|
|
|
|
machine.wait_for_open_port(4040)
|
|
|
|
|
|
|
|
with machine.nested("Waiting for UI to work"):
|
|
|
|
retry(airsonic_is_up)
|
|
|
|
'';
|
|
|
|
})
|