tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos: add test for postgresql, fixes #11146
Rok Garbas
10 years ago
109ba4c8
dd9bad4a
+27
2 changed files
expand all
collapse all
unified
split
nixos
release.nix
tests
postgresql.nix
+1
nixos/release.nix
···
287
287
tests.openssh = callTest tests/openssh.nix {};
288
288
tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
289
289
tests.peerflix = callTest tests/peerflix.nix {};
290
290
+
tests.postgresql = callTest tests/postgresql.nix {};
290
291
tests.printing = callTest tests/printing.nix {};
291
292
tests.proxy = callTest tests/proxy.nix {};
292
293
tests.pumpio = callTest tests/pump.io.nix {};
+26
nixos/tests/postgresql.nix
···
1
1
+
import ./make-test.nix ({ pkgs, ...} : {
2
2
+
name = "postgresql";
3
3
+
meta = with pkgs.stdenv.lib.maintainers; {
4
4
+
maintainers = [ zagy ];
5
5
+
};
6
6
+
7
7
+
nodes = {
8
8
+
master =
9
9
+
{ pkgs, config, ... }:
10
10
+
11
11
+
{
12
12
+
services.postgresql.enable = true;
13
13
+
services.postgresql.initialScript = pkgs.writeText "postgresql-init.sql"
14
14
+
''
15
15
+
CREATE ROLE postgres WITH superuser login createdb;
16
16
+
'';
17
17
+
};
18
18
+
};
19
19
+
20
20
+
testScript = ''
21
21
+
startAll;
22
22
+
$master->waitForUnit("postgresql");
23
23
+
$master->sleep(10); # Hopefully this is long enough!!
24
24
+
$master->succeed("echo 'select 1' | sudo -u postgres psql");
25
25
+
'';
26
26
+
})