mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
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:
parent
d57926c0b6
commit
73198870cd
|
@ -18,17 +18,17 @@ in
|
||||||
systemd.services.postgresql = {
|
systemd.services.postgresql = {
|
||||||
postStart = ''
|
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 = {
|
services = {
|
||||||
postgresql = {
|
postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ensureDatabases = [ "test" ];
|
ensureDatabases = [ "testdb" ];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
name = "test";
|
name = "testuser";
|
||||||
ensureDBOwnership = true;
|
|
||||||
}];
|
}];
|
||||||
authentication = ''
|
authentication = ''
|
||||||
local testdb testuser scram-sha-256
|
local testdb testuser scram-sha-256
|
||||||
|
@ -38,7 +38,7 @@ in
|
||||||
pgbouncer = {
|
pgbouncer = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "localhost";
|
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";
|
authType = "scram-sha-256";
|
||||||
authFile = testAuthFile;
|
authFile = testAuthFile;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue