From 39ef4d2fe9ac549af31b24dab75ac08fab255f5c Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Sat, 15 Jul 2017 14:54:42 +0100 Subject: [PATCH] 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. --- nixos/tests/postgresql.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/tests/postgresql.nix b/nixos/tests/postgresql.nix index 1f4f43a2666..b5f4e1a4c14 100644 --- a/nixos/tests/postgresql.nix +++ b/nixos/tests/postgresql.nix @@ -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 = ''