nixos: add test for postgresql, fixes #11146
This commit is contained in:
parent
dd9bad4aa4
commit
109ba4c861
@ -287,6 +287,7 @@ in rec {
|
||||
tests.openssh = callTest tests/openssh.nix {};
|
||||
tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
|
||||
tests.peerflix = callTest tests/peerflix.nix {};
|
||||
tests.postgresql = callTest tests/postgresql.nix {};
|
||||
tests.printing = callTest tests/printing.nix {};
|
||||
tests.proxy = callTest tests/proxy.nix {};
|
||||
tests.pumpio = callTest tests/pump.io.nix {};
|
||||
|
26
nixos/tests/postgresql.nix
Normal file
26
nixos/tests/postgresql.nix
Normal file
@ -0,0 +1,26 @@
|
||||
import ./make-test.nix ({ pkgs, ...} : {
|
||||
name = "postgresql";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ zagy ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
master =
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
{
|
||||
services.postgresql.enable = true;
|
||||
services.postgresql.initialScript = pkgs.writeText "postgresql-init.sql"
|
||||
''
|
||||
CREATE ROLE postgres WITH superuser login createdb;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
startAll;
|
||||
$master->waitForUnit("postgresql");
|
||||
$master->sleep(10); # Hopefully this is long enough!!
|
||||
$master->succeed("echo 'select 1' | sudo -u postgres psql");
|
||||
'';
|
||||
})
|
Loading…
Reference in New Issue
Block a user