about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/pgbouncer.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/nixos/tests/pgbouncer.nix b/nixos/tests/pgbouncer.nix
index 814ca0d58865..bb5afd35ee28 100644
--- a/nixos/tests/pgbouncer.nix
+++ b/nixos/tests/pgbouncer.nix
@@ -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;
         };