summaryrefslogtreecommitdiffstats
path: root/nixos/tests/mollysocket.nix
blob: b4acbb1095cb1a7174a2561aebf0074c27c53901 (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, lib, ... }:

let
  port = 1234;
in
{
  name = "mollysocket";
  meta.maintainers = with lib.maintainers; [ dotlambda ];

  nodes.mollysocket =
    { ... }:
    {
      services.mollysocket = {
        enable = true;
        settings = {
          inherit port;
        };
      };
    };

  testScript = ''
    mollysocket.wait_for_unit("mollysocket.service")
    mollysocket.wait_for_open_port(${toString port})

    out = mollysocket.succeed("curl --fail http://127.0.0.1:${toString port}")
    assert "Version ${pkgs.mollysocket.version}" in out
  '';
}