notes: 2.3.0 -> 2.3.1 (#352950)
[NixPkgs.git] / nixos / tests / jitsi-meet.nix
blobfc6654f2c076cb3bd109a7e4815c8c39c4a04183
1 import ./make-test-python.nix ({ pkgs, ... }: {
2   name = "jitsi-meet";
3   meta = with pkgs.lib; {
4     maintainers = teams.jitsi.members;
5   };
7   nodes = {
8     client = { nodes, pkgs, ... }: {
9     };
10     server = { config, pkgs, ... }: {
11       services.jitsi-meet = {
12         enable = true;
13         hostName = "server";
14       };
15       services.jitsi-videobridge.openFirewall = true;
17       networking.firewall.allowedTCPPorts = [ 80 443 ];
19       services.nginx.virtualHosts.server = {
20         enableACME = true;
21         forceSSL = true;
22       };
24       security.acme.acceptTerms = true;
25       security.acme.defaults.email = "me@example.org";
26       security.acme.defaults.server = "https://example.com"; # self-signed only
28       specialisation.caddy = {
29         inheritParentConfig = true;
30         configuration = {
31           services.jitsi-meet = {
32             caddy.enable = true;
33             nginx.enable = false;
34           };
35           services.caddy.virtualHosts.${config.services.jitsi-meet.hostName}.extraConfig = ''
36             tls internal
37           '';
38         };
39       };
40     };
41   };
43   testScript = { nodes, ... }: ''
44     server.wait_for_unit("jitsi-videobridge2.service")
45     server.wait_for_unit("jicofo.service")
46     server.wait_for_unit("nginx.service")
47     server.wait_for_unit("prosody.service")
49     server.wait_until_succeeds(
50         "journalctl -b -u prosody -o cat | grep -q 'Authenticated as focus@auth.server'"
51     )
52     server.wait_until_succeeds(
53         "journalctl -b -u prosody -o cat | grep -q 'Authenticated as jvb@auth.server'"
54     )
56     client.wait_for_unit("network.target")
58     def client_curl():
59         assert "<title>Jitsi Meet</title>" in client.succeed("curl -sSfkL http://server/")
61     client_curl()
63     with subtest("Testing backup service"):
64         server.succeed("${nodes.server.system.build.toplevel}/specialisation/caddy/bin/switch-to-configuration test")
65         server.wait_for_unit("caddy.service")
66         client_curl()
67   '';