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