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