aboutsummaryrefslogtreecommitdiffstats
path: root/molecule/default/tests/test_client_setup.py
diff options
context:
space:
mode:
authorColin Wilk <colin@wilk.cx>2026-06-29 20:56:50 +0200
committerColin Wilk <colin@wilk.cx>2026-06-29 20:56:50 +0200
commit66e46df3d2a840bf62ef8084ad171041772db65e (patch)
treea06192c5689ebf70e739941c1608c406b4b7ee2f /molecule/default/tests/test_client_setup.py
parenta0432093db76d7bb462f113d4bbeca0a8f376e95 (diff)
downloadansible-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.py27
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)