summary refs log tree commit diff
path: root/nixos/tests/rsyncd.nix
blob: 44464e42f28d46770c92e78cf42e13d482326c32 (plain) (blame)
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
32
33
34
35
36
import ./make-test-python.nix ({ pkgs, ... }: {
  name = "rsyncd";
  meta.maintainers = with pkgs.lib.maintainers; [ ehmry ];

  nodes = let
    mkNode = socketActivated:
      { config, ... }: {
        networking.firewall.allowedTCPPorts = [ config.services.rsyncd.port ];
        services.rsyncd = {
          enable = true;
          inherit socketActivated;
          settings = {
            global = {
              "reverse lookup" = false;
              "forward lookup" = false;
            };
            tmp = {
              path = "/nix/store";
              comment = "test module";
            };
          };
        };
      };
  in {
    a = mkNode false;
    b = mkNode true;
  };

  testScript = ''
    start_all()
    a.wait_for_unit("rsync")
    b.wait_for_unit("sockets.target")
    b.succeed("rsync a::")
    a.succeed("rsync b::")
  '';
})