nixos tests: fix postgresql tests

1. Needs to call makeTest or else nothing happens when you run
   `nix-build nixos/tests/postgresql.nix`.

2. Tests run as root, so there needs to be a corresponding user in
   PostgreSQL.
This commit is contained in:
Rodney Lorrimar 2017-07-15 14:54:42 +01:00
parent 1e1472ed93
commit 39ef4d2fe9

View file

@ -14,7 +14,7 @@ let
INSERT INTO sth (id) VALUES (1);
INSERT INTO sth (id) VALUES (1);
'';
make-postgresql-test = postgresql-name: postgresql-package: {
make-postgresql-test = postgresql-name: postgresql-package: makeTest {
name = postgresql-name;
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ zagy ];
@ -24,6 +24,9 @@ let
{
services.postgresql.package=postgresql-package;
services.postgresql.enable = true;
services.postgresql.initialScript = pkgs.writeText "init.sql" ''
CREATE USER root WITH SUPERUSER;
'';
};
testScript = ''