nixpkgs/nixos/tests/pyload.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
740 B
Nix
Raw Normal View History

{ lib, ... }:
{
name = "pyload";
meta.maintainers = with lib.maintainers; [ ambroisie ];
nodes = {
machine =
{ ... }:
{
services.pyload = {
enable = true;
listenAddress = "0.0.0.0";
port = 9876;
};
networking.firewall.allowedTCPPorts = [ 9876 ];
};
2023-12-24 22:23:15 +01:00
client = { };
};
2023-12-24 22:23:15 +01:00
testScript = ''
start_all()
2023-12-24 22:23:15 +01:00
machine.wait_for_unit("pyload.service")
2023-12-24 22:23:15 +01:00
with subtest("Web interface accessible locally"):
machine.wait_until_succeeds("curl -fs localhost:9876")
2023-12-24 22:23:15 +01:00
client.wait_for_unit("network.target")
with subtest("Web interface accessible from a different machine"):
client.wait_until_succeeds("curl -fs machine:9876")
'';
}