0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 22:20:30 +03:00
nixpkgs/nixos/tests/zammad.nix
Wolfgang Walther 41c5662cbe
nixos/postgresql: move postStart into separate unit
This avoids restarting the postgresql server, when only ensureDatabases
or ensureUsers have been changed. It will also allow to properly wait
for recovery to finish later.

To wait for "postgresql is ready" in other services, we now provide a
postgresql.target.

Resolves #400018

Co-authored-by: Marcel <me@m4rc3l.de>
2025-06-24 15:26:47 +02:00

38 lines
1 KiB
Nix

{ lib, pkgs, ... }:
{
name = "zammad";
meta.maintainers = with lib.maintainers; [
taeer
netali
];
nodes.machine = {
virtualisation = {
memorySize = 2048;
};
services.zammad.enable = true;
services.zammad.secretKeyBaseFile = pkgs.writeText "secret" ''
52882ef142066e09ab99ce816ba72522e789505caba224a52d750ec7dc872c2c371b2fd19f16b25dfbdd435a4dd46cb3df9f82eb63fafad715056bdfe25740d6
'';
};
testScript = ''
start_all()
machine.wait_for_unit("postgresql.target")
machine.wait_for_unit("redis-zammad.service")
machine.wait_for_unit("zammad-web.service")
machine.wait_for_unit("zammad-websocket.service")
machine.wait_for_unit("zammad-worker.service")
# wait for zammad to fully come up
machine.sleep(120)
# without the grep the command does not produce valid utf-8 for some reason
with subtest("welcome screen loads"):
machine.succeed(
"curl -sSfL http://localhost:3000/ | grep '<title>Zammad Helpdesk</title>'"
)
'';
}