1{ lib, ... }:
2{
3 name = "pyload";
4 meta.maintainers = with lib.maintainers; [ ambroisie ];
5
6 nodes = {
7 machine =
8 { ... }:
9 {
10 services.pyload = {
11 enable = true;
12
13 listenAddress = "0.0.0.0";
14 port = 9876;
15 };
16
17 networking.firewall.allowedTCPPorts = [ 9876 ];
18 };
19
20 client = { };
21 };
22
23 testScript = ''
24 start_all()
25
26 machine.wait_for_unit("pyload.service")
27
28 with subtest("Web interface accessible locally"):
29 machine.wait_until_succeeds("curl -fs localhost:9876")
30
31 client.wait_for_unit("network.target")
32
33 with subtest("Web interface accessible from a different machine"):
34 client.wait_until_succeeds("curl -fs machine:9876")
35 '';
36}