3
0
Fork 0
forked from mirrors/nixpkgs

nixos/tests/pgbouncer: do not use ensureDBOwnership

pgbouncer test is special in the sense where it actually tries
to connect via SCRAM SHA, let's avoid `ensureDBOwnership` here
otherwise for some reason pgbouncer will try to look in pg_shadow
for the authuser…
This commit is contained in:
Raito Bezarius 2023-11-13 17:14:26 +01:00
parent d57926c0b6
commit 73198870cd

View file

@ -17,18 +17,18 @@ in
systemd.services.postgresql = {
postStart = ''
${pkgs.postgresql}/bin/psql -U postgres -c "ALTER ROLE testuser WITH LOGIN PASSWORD 'testpass'";
${pkgs.postgresql}/bin/psql -U postgres -c "ALTER ROLE testuser WITH LOGIN PASSWORD 'testpass'";
${pkgs.postgresql}/bin/psql -U postgres -c "ALTER DATABASE testdb OWNER TO testuser;";
'';
};
services = {
postgresql = {
enable = true;
ensureDatabases = [ "test" ];
ensureDatabases = [ "testdb" ];
ensureUsers = [
{
name = "test";
ensureDBOwnership = true;
name = "testuser";
}];
authentication = ''
local testdb testuser scram-sha-256
@ -38,7 +38,7 @@ in
pgbouncer = {
enable = true;
listenAddress = "localhost";
databases = { test = "host=/run/postgresql/ port=5432 auth_user=testuser dbname=test"; };
databases = { test = "host=/run/postgresql/ port=5432 auth_user=testuser dbname=testdb"; };
authType = "scram-sha-256";
authFile = testAuthFile;
};