NFS-/mergerfs-Recovery dauerhaft stabilisieren #5
1 changed files with 27 additions and 0 deletions
27
tests/test_nfs_stability_role.py
Normal file
27
tests/test_nfs_stability_role.py
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
ROLE = Path("roles/nfs_stability/tasks/main.yml").read_text()
|
||||||
|
SITE = Path("site.yml").read_text()
|
||||||
|
|
||||||
|
|
||||||
|
def test_recovery_is_non_destructive():
|
||||||
|
assert "systemctl restart" not in ROLE
|
||||||
|
assert "OnUnitActiveSec" not in ROLE
|
||||||
|
assert "systemctl start" in ROLE
|
||||||
|
|
||||||
|
|
||||||
|
def test_recovery_validates_real_nfs_and_mergerfs_mounts():
|
||||||
|
assert "-t nfs,nfs4" in ROLE
|
||||||
|
assert "-t fuse.mergerfs" in ROLE
|
||||||
|
assert all(path in ROLE for path in ("/mnt/nas", "/mnt/qnap1", "/mnt/qnap2", "/mnt/media"))
|
||||||
|
|
||||||
|
|
||||||
|
def test_legacy_loop_is_stopped_before_replacement():
|
||||||
|
stop_at = ROLE.index("Stop and disable the destructive legacy retry timer first")
|
||||||
|
install_at = ROLE.index("Install once-per-boot NFS recovery timer")
|
||||||
|
assert stop_at < install_at
|
||||||
|
|
||||||
|
|
||||||
|
def test_role_is_scoped_to_media_mount_hosts():
|
||||||
|
assert "hosts: emby-sascha:emby-chris:arrapps" in SITE
|
||||||
|
assert "- nfs_stability" in SITE
|
||||||
Loading…
Add table
Add a link
Reference in a new issue