nixos/pgbackup: add postgres backup to the postgres test

This commit is contained in:
Markus Kowalewski 2018-06-17 19:49:25 +02:00
parent baef643232
commit aee0f49fe6
No known key found for this signature in database
GPG Key ID: D865C8A91D7025EB

View File

@ -26,6 +26,9 @@ let
{ {
services.postgresql.package=postgresql-package; services.postgresql.package=postgresql-package;
services.postgresql.enable = true; services.postgresql.enable = true;
services.postgresqlBackup.enable = true;
services.postgresqlBackup.databases = [ "postgres" ];
}; };
testScript = '' testScript = ''
@ -46,6 +49,10 @@ let
$machine->succeed(check_count("SELECT * FROM sth;", 5)); $machine->succeed(check_count("SELECT * FROM sth;", 5));
$machine->fail(check_count("SELECT * FROM sth;", 4)); $machine->fail(check_count("SELECT * FROM sth;", 4));
$machine->succeed(check_count("SELECT xpath(\'/test/text()\', doc) FROM xmltest;", 1)); $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 '<test>ok</test>'");
$machine->shutdown; $machine->shutdown;
''; '';