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.
This commit is contained in:
@@ -65,7 +65,7 @@ in {
|
||||
|
||||
nodes = {
|
||||
# Since 0.33.0, matrix-synapse doesn't allow underscores in server names
|
||||
serverpostgres = { pkgs, nodes, ... }: let
|
||||
serverpostgres = { pkgs, nodes, config, ... }: let
|
||||
mailserverIP = nodes.mailserver.config.networking.primaryIPAddress;
|
||||
in
|
||||
{
|
||||
@@ -77,6 +77,11 @@ in {
|
||||
name = "psycopg2";
|
||||
args.password = "synapse";
|
||||
};
|
||||
redis = {
|
||||
enabled = true;
|
||||
host = "localhost";
|
||||
port = config.services.redis.servers.matrix-synapse.port;
|
||||
};
|
||||
tls_certificate_path = "${cert}";
|
||||
tls_private_key_path = "${key}";
|
||||
registration_shared_secret = registrationSharedSecret;
|
||||
@@ -107,6 +112,11 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
services.redis.servers.matrix-synapse = {
|
||||
enable = true;
|
||||
port = 6380;
|
||||
};
|
||||
|
||||
networking.extraHosts = ''
|
||||
${mailserverIP} ${mailerDomain}
|
||||
'';
|
||||
@@ -208,6 +218,9 @@ in {
|
||||
serverpostgres.wait_until_succeeds(
|
||||
"curl --fail -L --cacert ${ca_pem} https://localhost:8448/"
|
||||
)
|
||||
serverpostgres.wait_until_succeeds(
|
||||
"journalctl -u matrix-synapse.service | grep -q 'Connected to redis'"
|
||||
)
|
||||
serverpostgres.require_unit_state("postgresql.service")
|
||||
serverpostgres.succeed("register_new_matrix_user -u ${testUser} -p ${testPassword} -a -k ${registrationSharedSecret} https://localhost:8448/")
|
||||
serverpostgres.succeed("obtain-token-and-register-email")
|
||||
|
||||
Reference in New Issue
Block a user