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