From c44331dd5d5d54db20b941bb8c04dcf8f143648b Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Tue, 7 Jan 2020 20:52:24 +0100 Subject: [PATCH] nixosTests.initdb: port to python --- nixos/tests/initdb.nix | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/nixos/tests/initdb.nix b/nixos/tests/initdb.nix index 749d7857a134..e7c83dc4002c 100644 --- a/nixos/tests/initdb.nix +++ b/nixos/tests/initdb.nix @@ -1,26 +1,19 @@ -let - pkgs = import { }; -in -with import { inherit pkgs; system = builtins.currentSystem; }; -with pkgs.lib; +import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }: { + name = "pg-initdb"; -makeTest { - name = "pg-initdb"; + machine = {...}: + { + documentation.enable = false; + services.postgresql.enable = true; + services.postgresql.package = pkgs.postgresql_9_6; + environment.pathsToLink = [ + "/share/postgresql" + ]; + }; - 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 + testScript = '' + machine.start() + machine.succeed("sudo -u postgres initdb -D /tmp/testpostgres2") + machine.shutdown() + ''; +})