From c8485ac04c276d08dd53388d26a3ff2c0b2a2426 Mon Sep 17 00:00:00 2001 From: sascha Date: Fri, 14 Aug 2026 06:47:53 +0200 Subject: [PATCH] =?UTF-8?q?NFS-Stabilisierung:=20tests/test=5Fnfs=5Fstabil?= =?UTF-8?q?ity=5Frole.py=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_nfs_stability_role.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/test_nfs_stability_role.py diff --git a/tests/test_nfs_stability_role.py b/tests/test_nfs_stability_role.py new file mode 100644 index 0000000..820ddfd --- /dev/null +++ b/tests/test_nfs_stability_role.py @@ -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