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.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;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue