services-flake/nix/postgres_test.nix
2023-06-19 17:56:18 -04:00

13 lines
345 B
Nix

{ config, ... }: {
services.postgres = {
enable = true;
listen_addresses = "127.0.0.1";
};
testScript = ''
process_compose.wait_until(lambda procs:
procs["postgres"]["status"] == "Running"
)
machine.succeed("echo 'SELECT version();' | ${config.services.postgres.package}/bin/psql -h 127.0.0.1 -U tester")
'';
}