From aee0f49fe6725f1a9551b546a757f523bd560681 Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Sun, 17 Jun 2018 19:49:25 +0200 Subject: [PATCH] nixos/pgbackup: add postgres backup to the postgres test --- nixos/tests/postgresql.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/tests/postgresql.nix b/nixos/tests/postgresql.nix index 0ce37b55bb7b..2381939552e2 100644 --- a/nixos/tests/postgresql.nix +++ b/nixos/tests/postgresql.nix @@ -26,6 +26,9 @@ let { services.postgresql.package=postgresql-package; services.postgresql.enable = true; + + services.postgresqlBackup.enable = true; + services.postgresqlBackup.databases = [ "postgres" ]; }; testScript = '' @@ -46,6 +49,10 @@ let $machine->succeed(check_count("SELECT * FROM sth;", 5)); $machine->fail(check_count("SELECT * FROM sth;", 4)); $machine->succeed(check_count("SELECT xpath(\'/test/text()\', doc) FROM xmltest;", 1)); + + # Check backup service + $machine->succeed("systemctl start postgresqlBackup-postgres.service"); + $machine->succeed("zcat /var/backup/postgresql/postgres.sql.gz | grep 'ok'"); $machine->shutdown; '';