From abebf8cdb3cd01a4b8eca9f5943c145ad77431ee Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Thu, 9 Jan 2020 23:21:51 +0100 Subject: [PATCH] nixosTests.initdb: Move code to existing postgres test --- nixos/tests/initdb.nix | 19 ------------------- nixos/tests/postgresql.nix | 3 +++ 2 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 nixos/tests/initdb.nix diff --git a/nixos/tests/initdb.nix b/nixos/tests/initdb.nix deleted file mode 100644 index e7c83dc4002..00000000000 --- a/nixos/tests/initdb.nix +++ /dev/null @@ -1,19 +0,0 @@ -import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }: { - 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() - ''; -}) diff --git a/nixos/tests/postgresql.nix b/nixos/tests/postgresql.nix index 5ba2d38773b..3201e22555e 100644 --- a/nixos/tests/postgresql.nix +++ b/nixos/tests/postgresql.nix @@ -76,6 +76,9 @@ let "stat -c '%a' /var/backup/postgresql/${backupName}.sql.gz | grep 600", ) + with subtest("Initdb works"): + machine.succeed("sudo -u postgres initdb -D /tmp/testpostgres2") + machine.shutdown() '';