lol

nixos/tests/matrix-synapse: Test redis on postgres instance

This requires the module to pick up on the redis configuration, and add
the required extra packages for redis into the wrapper.

+14 -1
+14 -1
nixos/tests/matrix/synapse.nix
··· 65 65 66 66 nodes = { 67 67 # Since 0.33.0, matrix-synapse doesn't allow underscores in server names 68 - serverpostgres = { pkgs, nodes, ... }: let 68 + serverpostgres = { pkgs, nodes, config, ... }: let 69 69 mailserverIP = nodes.mailserver.config.networking.primaryIPAddress; 70 70 in 71 71 { ··· 76 76 database = { 77 77 name = "psycopg2"; 78 78 args.password = "synapse"; 79 + }; 80 + redis = { 81 + enabled = true; 82 + host = "localhost"; 83 + port = config.services.redis.servers.matrix-synapse.port; 79 84 }; 80 85 tls_certificate_path = "${cert}"; 81 86 tls_private_key_path = "${key}"; ··· 105 110 LC_COLLATE = "C" 106 111 LC_CTYPE = "C"; 107 112 ''; 113 + }; 114 + 115 + services.redis.servers.matrix-synapse = { 116 + enable = true; 117 + port = 6380; 108 118 }; 109 119 110 120 networking.extraHosts = '' ··· 207 217 serverpostgres.wait_for_unit("matrix-synapse.service") 208 218 serverpostgres.wait_until_succeeds( 209 219 "curl --fail -L --cacert ${ca_pem} https://localhost:8448/" 220 + ) 221 + serverpostgres.wait_until_succeeds( 222 + "journalctl -u matrix-synapse.service | grep -q 'Connected to redis'" 210 223 ) 211 224 serverpostgres.require_unit_state("postgresql.service") 212 225 serverpostgres.succeed("register_new_matrix_user -u ${testUser} -p ${testPassword} -a -k ${registrationSharedSecret} https://localhost:8448/")