1import ./make-test-python.nix ({ pkgs, ... }: {
2 name = "airsonic";
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ sumnerevans ];
5 };
6
7 machine =
8 { pkgs, ... }:
9 {
10 services.airsonic = {
11 enable = true;
12 maxMemory = 800;
13 };
14
15 # Airsonic is a Java application, and unfortunately requires a significant
16 # amount of memory.
17 virtualisation.memorySize = 1024;
18 };
19
20 testScript = ''
21 def airsonic_is_up(_) -> bool:
22 return machine.succeed("curl --fail http://localhost:4040/login")
23
24
25 machine.start()
26 machine.wait_for_unit("airsonic.service")
27 machine.wait_for_open_port(4040)
28
29 with machine.nested("Waiting for UI to work"):
30 retry(airsonic_is_up)
31 '';
32})