nixos/tests: add matrix-synapse test

+31
+1
nixos/release.nix
··· 292 292 tests.login = callTest tests/login.nix {}; 293 293 #tests.logstash = callTest tests/logstash.nix {}; 294 294 tests.mathics = callTest tests/mathics.nix {}; 295 + tests.matrix-synapse = callTest tests/matrix-synapse.nix {}; 295 296 tests.mesos = callTest tests/mesos.nix {}; 296 297 tests.misc = callTest tests/misc.nix {}; 297 298 tests.mongodb = callTest tests/mongodb.nix {};
+30
nixos/tests/matrix-synapse.nix
··· 1 + import ./make-test.nix ({ pkgs, ... } : { 2 + 3 + name = "matrix-synapse"; 4 + meta = with pkgs.stdenv.lib.maintainers; { 5 + maintainers = [ corngood ]; 6 + }; 7 + 8 + nodes = { 9 + server_postgres = args: { 10 + services.matrix-synapse.enable = true; 11 + services.matrix-synapse.database_type = "psycopg2"; 12 + }; 13 + 14 + server_sqlite = args: { 15 + services.matrix-synapse.enable = true; 16 + services.matrix-synapse.database_type = "sqlite3"; 17 + }; 18 + }; 19 + 20 + testScript = '' 21 + startAll; 22 + $server_postgres->waitForUnit("matrix-synapse.service"); 23 + $server_postgres->waitUntilSucceeds("curl -Lk https://localhost:8448/"); 24 + $server_postgres->requireActiveUnit("postgresql.service"); 25 + $server_sqlite->waitForUnit("matrix-synapse.service"); 26 + $server_sqlite->waitUntilSucceeds("curl -Lk https://localhost:8448/"); 27 + $server_sqlite->mustSucceed("[ -e /var/lib/matrix-synapse/homeserver.db ]"); 28 + ''; 29 + 30 + })