This commit is contained in:
root
2026-05-18 13:49:53 +00:00
parent 088a5a6429
commit fa422fb7b8
9 changed files with 160 additions and 2 deletions

View File

@@ -86,6 +86,23 @@ class NekoConfigTests(unittest.TestCase):
self.assertIn("NEKO_HTTP_PORT_2", common)
self.assertIn("NEKO_WEBRTC_UDP_RANGE_3", common)
def test_neko_ip_watcher_is_installed_and_restarts_on_drift(self) -> None:
common = (ROOT / "scripts" / "linux" / "lib" / "common.sh").read_text(encoding="utf-8")
watcher = (ROOT / "scripts" / "linux" / "neko_ip_watch.sh").read_text(encoding="utf-8")
upgrade = (ROOT / "scripts" / "linux" / "upgrade_live_console.sh").read_text(encoding="utf-8")
uninstall = (ROOT / "scripts" / "linux" / "uninstall_stack.sh").read_text(encoding="utf-8")
stack_env = (ROOT / "config" / "system-stack.env.example").read_text(encoding="utf-8")
self.assertIn("install_neko_ip_watch_service()", common)
self.assertIn("live-neko-ip-watch.service", common)
self.assertIn("ExecStart=/bin/bash", common)
self.assertIn("scripts/linux/neko_ip_watch.sh", common)
self.assertIn("detect_preferred_lan_ip", watcher)
self.assertIn('bash "$SERVICE_CTL" neko restart', watcher)
self.assertIn("NEKO_IP_WATCH_INTERVAL", watcher)
self.assertIn("install_neko_ip_watch_service", upgrade)
self.assertIn("live-neko-ip-watch.service", uninstall)
self.assertIn("NEKO_IP_WATCH_INTERVAL=15", stack_env)
def test_local_browser_prefers_chrome_on_x86_and_chromium_elsewhere(self) -> None:
script = (ROOT / "scripts" / "linux" / "launch_browser.sh").read_text(encoding="utf-8")
self.assertIn("x86_64|amd64", script)