summaryrefslogtreecommitdiffstats
path: root/nixos/tests/rqbit.nix
blob: 15dcea4fb97eb55ff521dc18cd1b8145e58585c5 (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 = 3030;
in
{
  name = "rqbit";
  meta = {
    maintainers = with pkgs.lib.maintainers; [ CodedNil ];
  };

  nodes.machine =
    { pkgs, ... }:
    {
      services.rqbit = {
        httpPort = port;
        enable = true;
        openFirewall = true;
      };
    };

  testScript = /* python */ ''
    machine.start()
    machine.wait_for_unit("rqbit.service")
    machine.wait_for_open_port(${toString port})

    machine.succeed("curl --fail http://localhost:${toString port}")
  '';
}