diff options
| author | Colin Wilk <colin@wilk.cx> | 2026-06-29 20:56:50 +0200 |
|---|---|---|
| committer | Colin Wilk <colin@wilk.cx> | 2026-06-29 20:56:50 +0200 |
| commit | 66e46df3d2a840bf62ef8084ad171041772db65e (patch) | |
| tree | a06192c5689ebf70e739941c1608c406b4b7ee2f /molecule/default/tests/test_client_setup.py | |
| parent | a0432093db76d7bb462f113d4bbeca0a8f376e95 (diff) | |
| download | ansible-role-borgbackup-66e46df3d2a840bf62ef8084ad171041772db65e.tar.gz ansible-role-borgbackup-66e46df3d2a840bf62ef8084ad171041772db65e.zip | |
Support custom arguments for borg create
Diffstat (limited to 'molecule/default/tests/test_client_setup.py')
| -rw-r--r-- | molecule/default/tests/test_client_setup.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/molecule/default/tests/test_client_setup.py b/molecule/default/tests/test_client_setup.py index f59c6db..78e751a 100644 --- a/molecule/default/tests/test_client_setup.py +++ b/molecule/default/tests/test_client_setup.py @@ -301,6 +301,33 @@ class TestBackupScript: else: pytest.fail(f"Unexpected hostname: {hostname}") + def test_backup_script_contains_additional_arguments(self, host): + hostname = host.backend.get_hostname() + + if hostname == "borg-client-multi-keys": + script1 = host.file("/usr/local/bin/run_borg_backup@configs-keys") + script2 = host.file("/usr/local/bin/run_borg_backup@home-data-keys") + assert "--stats" in script1.content_string + assert "--list" in script1.content_string + assert "--filter=AME" in script1.content_string + assert "--one-file-system" in script2.content_string + assert "--exclude-caches" in script2.content_string + elif hostname == "borg-client-2": + script = host.file("/usr/local/bin/run_borg_backup") + content = script.content_string + assert "-C zlib,6" in content + + def test_backup_script_compression_override(self, host): + hostname = host.backend.get_hostname() + if hostname != "borg-client-2": + return + + script = host.file("/usr/local/bin/run_borg_backup") + content = script.content_string + + assert "-C lz4" in content + assert "-C zlib,6" in content + def test_backup_script_contains_borg_rsh_when_per_repo(self, host): hostname = host.backend.get_hostname() per_repo = get_client_ssh_key_per_repo(host) |