summary refs log tree commit diff
path: root/nixos/tests/coturn.nix
blob: dff832281c7caa8096fde6cf10d8bc7ba052e80b (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
import ./make-test-python.nix ({ ... }: {
  name = "coturn";
  nodes = {
    default = {
      services.coturn.enable = true;
    };
    secretsfile = {
      boot.postBootCommands = ''
        echo "some-very-secret-string" > /run/coturn-secret
      '';
      services.coturn = {
        enable = true;
        static-auth-secret-file = "/run/coturn-secret";
      };
    };
  };

  testScript =
    ''
      start_all()

      with subtest("by default works without configuration"):
          default.wait_for_unit("coturn.service")

      with subtest("works with static-auth-secret-file"):
          secretsfile.wait_for_unit("coturn.service")
          secretsfile.succeed("grep 'some-very-secret-string' /run/coturn/turnserver.cfg")
    '';
})