summary refs log tree commit diff
path: root/nixos/tests/postgresql.nix
diff options
context:
space:
mode:
authorRodney Lorrimar <dev@rodney.id.au>2017-07-15 14:54:42 +0100
committerRodney Lorrimar <dev@rodney.id.au>2017-07-15 14:54:42 +0100
commit39ef4d2fe9ac549af31b24dab75ac08fab255f5c (patch)
tree393e3bfc3c681a081fdcc26322e46be683e4191f /nixos/tests/postgresql.nix
parent1e1472ed93e1256dfdac4908ae8edcb90ceff21c (diff)
downloadnixpkgs-39ef4d2fe9ac549af31b24dab75ac08fab255f5c.tar
nixpkgs-39ef4d2fe9ac549af31b24dab75ac08fab255f5c.tar.gz
nixpkgs-39ef4d2fe9ac549af31b24dab75ac08fab255f5c.tar.bz2
nixpkgs-39ef4d2fe9ac549af31b24dab75ac08fab255f5c.tar.lz
nixpkgs-39ef4d2fe9ac549af31b24dab75ac08fab255f5c.tar.xz
nixpkgs-39ef4d2fe9ac549af31b24dab75ac08fab255f5c.tar.zst
nixpkgs-39ef4d2fe9ac549af31b24dab75ac08fab255f5c.zip
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.
Diffstat (limited to 'nixos/tests/postgresql.nix')
-rw-r--r--nixos/tests/postgresql.nix5
1 files changed, 4 insertions, 1 deletions
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 = ''