feat: Media-Pfade node6 gegen Direkt-WireGuard messen #55

Merged
sascha merged 2 commits from feat/sascha-media-path-benchmark-20260905 into main 2026-09-05 13:06:10 +02:00
Showing only changes of commit fa01dd77fb - Show all commits

View file

@ -43,7 +43,7 @@ def test_health_exposes_current_version():
with TestClient(app.app) as client:
response = client.get("/health")
assert response.status_code == 200
assert response.json()["version"] == app.VERSION == "2.3.9"
assert response.json()["version"] == app.VERSION == "2.4.0"
def test_media_handoff_proxies_strict_category_contract(monkeypatch):
@ -1355,3 +1355,18 @@ def test_sascha_media_tunnel_candidate_uses_valid_wireguard_interface_name():
script = base64.b64decode(encoded).decode()
assert 'root / "wgmtest.conf"' in script
assert len("wgmtest") <= 15
def test_sascha_media_path_benchmark_returns_both_fixed_routes(monkeypatch):
monkeypatch.setattr(app, "_benchmark_sascha_media_paths", lambda: {
"legacy_node6": {"bytes": 268435456, "seconds": 4.0, "mbit_s": 536.9},
"direct_wg_media": {"bytes": 268435456, "seconds": 3.0, "mbit_s": 715.8},
})
with TestClient(app.app) as client:
response = client.post(
"/network/media-tunnel/sascha/benchmark",
headers={"Authorization": "Bearer test-token"},
)
assert response.status_code == 200
assert response.json()["direction"] == "emby-sascha_to_hetzner"
assert set(response.json()["results"]) == {"legacy_node6", "direct_wg_media"}