feat(backends): WebSocket-Toggle pro Backend
Migration 0017 fügt backends.websocket BOOL. Wenn aktiv emittiert der HAProxy-Renderer `timeout tunnel 1h` IM Backend-Block; defaults-Section hat den Global-Timeout dafür verloren. Backends ohne WS-Workload bleiben bei strikten HTTP-Timeouts (Connection-Hygiene). Migrations-Heuristik schaltet vm-pool/proxmox/console/vnc-Namen auto auf true damit Proxmox- Konsole nach Deploy weiterhin durchläuft. UI: Switch im Backend-Modal + WS-Tag in der Übersichtstabelle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,42 @@ func TestRender_HealthCheckPathAddsCheckInter(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRender_WebSocketEmitsTunnelTimeout(t *testing.T) {
|
||||
v := View{
|
||||
Backends: []BackendView{
|
||||
{
|
||||
Backend: models.Backend{ID: 7, Name: "vmm", Scheme: "https",
|
||||
LBAlgorithm: "source", WebSocket: true, Active: true},
|
||||
Servers: []models.BackendServer{
|
||||
{BackendID: 7, Name: "vmm-1", Address: "10.0.5.14", Port: 8006, Weight: 100, Active: true},
|
||||
},
|
||||
},
|
||||
{
|
||||
Backend: models.Backend{ID: 8, Name: "api", Scheme: "http",
|
||||
LBAlgorithm: "roundrobin", WebSocket: false, Active: true},
|
||||
Servers: []models.BackendServer{
|
||||
{BackendID: 8, Name: "api-1", Address: "10.0.5.20", Port: 8080, Weight: 100, Active: true},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
out := renderView(t, v)
|
||||
// vmm soll tunnel-Timeout haben, api nicht.
|
||||
idxVmm := strings.Index(out, "backend eg_backend_7")
|
||||
idxApi := strings.Index(out, "backend eg_backend_8")
|
||||
if idxVmm < 0 || idxApi < 0 {
|
||||
t.Fatalf("backend sections missing in output:\n%s", out)
|
||||
}
|
||||
vmmBlock := out[idxVmm:idxApi]
|
||||
apiBlock := out[idxApi:]
|
||||
if !strings.Contains(vmmBlock, "timeout tunnel 1h") {
|
||||
t.Errorf("vmm-Block sollte `timeout tunnel 1h` enthalten:\n%s", vmmBlock)
|
||||
}
|
||||
if strings.Contains(apiBlock, "timeout tunnel") {
|
||||
t.Errorf("api-Block soll KEIN `timeout tunnel` enthalten:\n%s", apiBlock)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRender_MultiServerPool(t *testing.T) {
|
||||
v := View{
|
||||
Backends: []BackendView{
|
||||
|
||||
Reference in New Issue
Block a user