mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 22:32:58 +03:00
nixos/pgbackup: add postgres backup to the postgres test
This commit is contained in:
parent
baef643232
commit
aee0f49fe6
@ -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 '<test>ok</test>'");
|
||||
$machine->shutdown;
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user