add postgresql backup hooks

This commit is contained in:
Jörg Thalheim
2024-05-31 16:36:37 +02:00
parent f71295e640
commit 6dec2a9222
11 changed files with 145 additions and 19 deletions

View File

@@ -0,0 +1,22 @@
(import ../lib/container-test.nix) (
{
name = "postgresql";
nodes.machine = { self, ... }:
{
imports = [
self.nixosModules.clanCore
self.clanModules.postgresql
self.clanModules.localbackup
];
clan.postgresl.databases = [ "test" ];
clan.localbackup.targets.hdd.directory = "/mnt/external-disk";
};
testScript = ''
start_all()
machine.succeed("systemctl status postgresql")
machine.wait_for_unit("postgresql")
machine.succeed("localbackup-create")
machine.succeed("ls -la /var/backups/postgresql")
'';
})