summaryrefslogtreecommitdiffstats
path: root/nixos/tests/snid.nix
blob: 7d87e62821302a3021c77d13a3db137f33bf1c01 (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
29
30
31
{ lib, ... }:
{
  _class = "nixosTest";
  name = "snid";

  nodes = {
    machine =
      { pkgs, ... }:
      {
        system.services.snid = {
          imports = [ pkgs.snid.services.default ];
          snid = {
            listen = [ "tcp:8443" ];
            mode = "tcp";
            backendCidrs = [ "127.0.0.0/8" ];
          };
        };

        networking.firewall.allowedTCPPorts = [ 8443 ];
      };
  };

  testScript = ''
    start_all()
    machine.wait_for_unit("multi-user.target")
    machine.wait_for_unit("snid.service")
    machine.wait_for_open_port(8443)
  '';

  meta.maintainers = with lib.maintainers; [ tomfitzhenry ];
}