mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 07:06:36 +08:00
[新增] 实现 Agent WebSocket 连接升级功能,支持状态上报和配置广播
This commit is contained in:
@@ -46,3 +46,15 @@ func TestValidateOpenRestyOption(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateAgentOption(t *testing.T) {
|
||||
if err := validateAgentOption("AgentWebsocketUpgradeEnabled", "true"); err != nil {
|
||||
t.Fatalf("expected websocket upgrade option to accept true: %v", err)
|
||||
}
|
||||
if err := validateAgentOption("AgentWebsocketUpgradeEnabled", "false"); err != nil {
|
||||
t.Fatalf("expected websocket upgrade option to accept false: %v", err)
|
||||
}
|
||||
if err := validateAgentOption("AgentWebsocketUpgradeEnabled", "on"); err == nil {
|
||||
t.Fatal("expected websocket upgrade option to reject non-boolean value")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user