diff --git a/test/services/vaultwarden.nix b/test/services/vaultwarden.nix index 464606c..8979b7f 100644 --- a/test/services/vaultwarden.nix +++ b/test/services/vaultwarden.nix @@ -87,6 +87,25 @@ let authEndpoint = "https://${config.shb.authelia.subdomain}.${config.shb.authelia.domain}"; }; }; + + backup = { config, ... }: { + imports = [ + ../../modules/blocks/restic.nix + ]; + shb.restic.instances."testinstance" = config.shb.vaultwarden.backup // { + enable = true; + passphraseFile = pkgs.writeText "passphrase" "PassPhrase"; + repositories = [ + { + path = "/opt/repos/A"; + timerConfig = { + OnCalendar = "00:00:00"; + RandomizedDelaySec = "5h"; + }; + } + ]; + }; + }; in { basic = pkgs.testers.runNixOSTest { @@ -168,4 +187,25 @@ in ''; }; }; + + backup = pkgs.testers.runNixOSTest { + name = "vaultwarden_backup"; + + nodes.server = { config, ... }: { + imports = [ + base + basic + backup + ]; + }; + + nodes.client = {}; + + testScript = commonTestScript.override { + extraScript = { proto_fqdn, ... }: '' + with subtest("backup"): + server.succeed("systemctl start restic-backups-testinstance_opt_repos_A") + ''; + }; + }; }