services-flake/nix/postgres_test.nix

13 lines
345 B
Nix
Raw Normal View History

{ 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")
'';
}