aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/tests/initdb.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/initdb.nix')
-rw-r--r--nixpkgs/nixos/tests/initdb.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/initdb.nix b/nixpkgs/nixos/tests/initdb.nix
new file mode 100644
index 00000000000..749d7857a13
--- /dev/null
+++ b/nixpkgs/nixos/tests/initdb.nix
@@ -0,0 +1,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;
+ '';
+
+ } \ No newline at end of file