diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2022-06-02 13:40:39 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2022-06-03 11:21:37 -0300 |
commit | deae887c5a497a978b55b205dff9c517eb0df55e (patch) | |
tree | 2ec4e013e932b3ec893e188eeb41423678bbd102 /nixos/tests | |
parent | 082a4184ec7f9ff6738c8289cbdc944fe649400b (diff) |
nixos/restic: add new repositoryFile option
Allow providing the repository as a file, useful when we don't want it being stored in the Git repository as plain text. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/restic.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/tests/restic.nix b/nixos/tests/restic.nix index 557193001f2b3..16d7edde0c1c4 100644 --- a/nixos/tests/restic.nix +++ b/nixos/tests/restic.nix @@ -4,6 +4,7 @@ import ./make-test-python.nix ( let password = "some_password"; repository = "/tmp/restic-backup"; + repositoryFile = "${pkgs.writeText "repositoryFile" "/tmp/restic-backup-from-file"}"; rcloneRepository = "rclone:local:/tmp/restic-rclone-backup"; passwordFile = "${pkgs.writeText "password" "correcthorsebatterystaple"}"; @@ -31,6 +32,9 @@ import ./make-test-python.nix ( remotebackup = { inherit repository passwordFile initialize paths pruneOpts; }; + remotebackup-from-file = { + inherit repositoryFile passwordFile initialize paths pruneOpts; + }; rclonebackup = { repository = rcloneRepository; rcloneConfig = { @@ -60,6 +64,7 @@ import ./make-test-python.nix ( server.wait_for_unit("dbus.socket") server.fail( "${pkgs.restic}/bin/restic -r ${repository} -p ${passwordFile} snapshots", + '${pkgs.restic}/bin/restic --repository-file ${repositoryFile} -p ${passwordFile} snapshots"', "${pkgs.restic}/bin/restic -r ${rcloneRepository} -p ${passwordFile} snapshots", ) server.succeed( @@ -68,8 +73,10 @@ import ./make-test-python.nix ( "mkdir -p /tmp/restic-rclone-backup", "timedatectl set-time '2016-12-13 13:45'", "systemctl start restic-backups-remotebackup.service", + "systemctl start restic-backups-remotebackup-from-file.service", "systemctl start restic-backups-rclonebackup.service", '${pkgs.restic}/bin/restic -r ${repository} -p ${passwordFile} snapshots -c | grep -e "^1 snapshot"', + '${pkgs.restic}/bin/restic --repository-file ${repositoryFile} -p ${passwordFile} snapshots -c | grep -e "^1 snapshot"', '${pkgs.restic}/bin/restic -r ${rcloneRepository} -p ${passwordFile} snapshots -c | grep -e "^1 snapshot"', "timedatectl set-time '2017-12-13 13:45'", "systemctl start restic-backups-remotebackup.service", |