about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJacek Galowicz <jacek.galowicz@cyberus-technology.de>2020-01-09 23:21:51 +0100
committerJacek Galowicz <jacek.galowicz@cyberus-technology.de>2020-01-09 23:21:51 +0100
commitabebf8cdb3cd01a4b8eca9f5943c145ad77431ee (patch)
treeb94be0761fe11f0f5b2698cdcd37f96b235bdce4 /nixos
parentfff1c2867f848c7479873beefd29d7ce4b31a455 (diff)
downloadnixlib-abebf8cdb3cd01a4b8eca9f5943c145ad77431ee.tar
nixlib-abebf8cdb3cd01a4b8eca9f5943c145ad77431ee.tar.gz
nixlib-abebf8cdb3cd01a4b8eca9f5943c145ad77431ee.tar.bz2
nixlib-abebf8cdb3cd01a4b8eca9f5943c145ad77431ee.tar.lz
nixlib-abebf8cdb3cd01a4b8eca9f5943c145ad77431ee.tar.xz
nixlib-abebf8cdb3cd01a4b8eca9f5943c145ad77431ee.tar.zst
nixlib-abebf8cdb3cd01a4b8eca9f5943c145ad77431ee.zip
nixosTests.initdb: Move code to existing postgres test
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/initdb.nix19
-rw-r--r--nixos/tests/postgresql.nix3
2 files changed, 3 insertions, 19 deletions
diff --git a/nixos/tests/initdb.nix b/nixos/tests/initdb.nix
deleted file mode 100644
index e7c83dc4002c..000000000000
--- 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 5ba2d38773bb..3201e22555ea 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()
     '';