fix: WireGuard-Medienpfad auf kanonisches sysctl-Profil bringen #2
1 changed files with 34 additions and 0 deletions
34
tests/test_sysctl_role.py
Normal file
34
tests/test_sysctl_role.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).parents[1]
|
||||
|
||||
|
||||
class SysctlRoleContract(unittest.TestCase):
|
||||
def test_canonical_streaming_profile_keeps_64mib_and_bbr_fq(self):
|
||||
text = (ROOT / "roles/sysctl/defaults/main.yml").read_text()
|
||||
self.assertIn("net.core.rmem_max", text)
|
||||
self.assertIn('value: "67108864"', text)
|
||||
self.assertIn("net.core.default_qdisc", text)
|
||||
self.assertIn("net.ipv4.tcp_congestion_control", text)
|
||||
self.assertIn("net.ipv4.tcp_no_metrics_save", text)
|
||||
|
||||
def test_role_removes_managed_keys_from_legacy_sources(self):
|
||||
text = (ROOT / "roles/sysctl/tasks/main.yml").read_text()
|
||||
self.assertIn("/etc/sysctl.conf", text)
|
||||
self.assertIn("/etc/sysctl.d/99-streaming.conf", text)
|
||||
self.assertIn("state: absent", text)
|
||||
self.assertIn("regex_escape", text)
|
||||
|
||||
def test_proxmox_tuning_runs_canonical_network_role_first(self):
|
||||
play = (ROOT / "sysctl-proxmox.yaml").read_text()
|
||||
self.assertLess(play.index("- sysctl\n"), play.index("- sysctl_proxmox"))
|
||||
|
||||
def test_proxmox_role_does_not_duplicate_canonical_network_keys(self):
|
||||
text = (ROOT / "roles/sysctl_proxmox/tasks/main.yml").read_text()
|
||||
for key in ("net.core.rmem_max", "net.core.wmem_max", "net.ipv4.tcp_rmem", "net.ipv4.tcp_wmem", "net.ipv4.tcp_mtu_probing"):
|
||||
self.assertNotIn(key, text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue