summary refs log tree commit diff
path: root/nixos/tests/initdb.nix
blob: 749d7857a13411d0913b4396430e2d2bf0b2888a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
let
  pkgs = import <nixpkgs> { };
in
with import <nixpkgs/nixos/lib/testing.nix> { inherit pkgs; system = builtins.currentSystem; };
with pkgs.lib;

makeTest {
    name = "pg-initdb";

    machine = {...}:
      {
        documentation.enable = false;
        services.postgresql.enable = true;
        services.postgresql.package = pkgs.postgresql_9_6;
        environment.pathsToLink = [
          "/share/postgresql"
        ];
      };

    testScript = ''
      $machine->start;
      $machine->succeed("sudo -u postgres initdb -D /tmp/testpostgres2");
      $machine->shutdown;
    '';

  }