summaryrefslogtreecommitdiffstats
path: root/nixos/tests/rtorrent.nix
blob: b34f1cb5cec6600d2a95cfca595f8cb6bbe53e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ pkgs, ... }:
let
  port = 50001;
in
{
  name = "rtorrent";
  meta = {
    maintainers = with pkgs.lib.maintainers; [ thiagokokada ];
  };

  nodes.machine =
    { pkgs, ... }:
    {
      services.rtorrent = {
        inherit port;
        enable = true;
      };
    };

  testScript = # python
    ''
      machine.start()
      machine.wait_for_unit("rtorrent.service")
      machine.wait_for_open_port(${toString port})

      machine.succeed("nc -z localhost ${toString port}")
    '';
}