aboutsummaryrefslogtreecommitdiffstats
path: root/molecule/delete/tests/test_delete.py
diff options
context:
space:
mode:
Diffstat (limited to 'molecule/delete/tests/test_delete.py')
-rw-r--r--molecule/delete/tests/test_delete.py34
1 files changed, 23 insertions, 11 deletions
diff --git a/molecule/delete/tests/test_delete.py b/molecule/delete/tests/test_delete.py
index 4c0d859..3fc3189 100644
--- a/molecule/delete/tests/test_delete.py
+++ b/molecule/delete/tests/test_delete.py
@@ -37,6 +37,16 @@ class TestSingleRepoDelete:
assert not timer.exists
assert not service.exists
+ def test_prune_systemd_units_removed(self, host):
+ hostname = host.backend.get_hostname()
+ if hostname != "borg-client-single-delete":
+ return
+
+ timer = host.file("/etc/systemd/system/borg_prune@single-backup.timer")
+ service = host.file("/etc/systemd/system/borg_prune@single-backup.service")
+ assert not timer.exists
+ assert not service.exists
+
def test_backup_scripts_removed(self, host):
hostname = host.backend.get_hostname()
if hostname != "borg-client-single-delete":
@@ -47,6 +57,16 @@ class TestSingleRepoDelete:
assert not repo_script.exists
assert not base_script.exists
+ def test_prune_scripts_removed(self, host):
+ hostname = host.backend.get_hostname()
+ if hostname != "borg-client-single-delete":
+ return
+
+ repo_script = host.file("/usr/local/bin/run_borg_prune@single-backup")
+ base_script = host.file("/usr/local/bin/run_borg_prune")
+ assert not repo_script.exists
+ assert not base_script.exists
+
def test_shared_ssh_key_kept(self, host):
hostname = host.backend.get_hostname()
if hostname != "borg-client-single-delete":
@@ -98,17 +118,12 @@ class TestMultiInstanceDelete:
assert service.exists
assert script.exists
- def test_base_script_keeps_only_remaining_block(self, host):
+ def test_aggregate_script_is_absent(self, host):
hostname = host.backend.get_hostname()
if hostname != "borg-client-multi-delete":
return
- base_script = host.file("/usr/local/bin/run_borg_backup")
- assert base_script.exists
- content = base_script.content_string
- assert "/opt/borg/multi-repo-b" in content
- assert "/opt/borg/multi-repo-a" not in content
- assert content.count("borg create") == 1
+ assert not host.file("/usr/local/bin/run_borg_backup").exists
def test_shared_ssh_key_kept(self, host):
hostname = host.backend.get_hostname()
@@ -168,13 +183,10 @@ class TestPerRepoKeyDelete:
timer = host.file("/etc/systemd/system/borg_backup@per-repo-b.timer")
service = host.file("/etc/systemd/system/borg_backup@per-repo-b.service")
script = host.file("/usr/local/bin/run_borg_backup@per-repo-b")
- base_script = host.file("/usr/local/bin/run_borg_backup")
assert timer.exists
assert service.exists
assert script.exists
- assert base_script.exists
- assert "/opt/borg/per-repo-b" in base_script.content_string
- assert "/opt/borg/per-repo-a" not in base_script.content_string
+ assert not host.file("/usr/local/bin/run_borg_backup").exists
def test_per_repo_ssh_key_removed(self, host):
hostname = host.backend.get_hostname()