Commit 73198870 authored by Raito Bezarius's avatar Raito Bezarius
Browse files

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…
parent d57926c0
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -18,17 +18,17 @@ 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 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;
        };