fix(deploy): make bundled Agent endpoint valid for isolated Mock
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"agent_id": "agent-cell-a",
|
||||
"cell_id": "cell-a",
|
||||
"address": "agent-cell-a.internal:19090",
|
||||
"address": "127.0.0.1:19090",
|
||||
"server_name": "agent-cell-a.internal"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -132,6 +132,8 @@
|
||||
|
||||
- 旧全局环境配置:旧 `Config`/`FromEnv` 同时配置 Mock、mixed/real、旧 Dispatcher SQLite 和 OSS 环境凭据,已无现行业务调用;删除实现和专属测试,保留当前分角色环境及批准文件/受控引用读取。把「旧 OSS 环境变量不可覆盖配置文件与受控凭据」迁至现行 `LoadCurrentOSSConfig` 隔离测试;原旧结构的 mTLS 专属测试删除,现行 Dispatcher/Agent mTLS 校验测试仍在。全仓 Go 测试通过;不更改实际部署配置或现存数据。
|
||||
|
||||
- Agent 端点样例:包内 `deploys/config/agent-endpoints.example.json` 原指向非本机地址,无法通过唯一现行 Mock Dispatcher 的本地端点校验;新增读取实际打包样例的测试先复现失败,再将地址改为显式 loopback 端口。Agent/Cell 标识与证书 SNI 仍为部署占位值,须由受控环境提供匹配证书;样例通过只证明隔离 Mock 可读取,不授权真实 Agent/线路。
|
||||
|
||||
## 验收台账
|
||||
|
||||
P01–P06 的项目内隔离证据见上;P07 全仓命名与唯一入口尚在清理,A01–A12 和 K01–K16 的最终对照仍待 P08。不得用本地 Mock 冒充外部签收。
|
||||
|
||||
@@ -18,6 +18,14 @@ func writeMockAgentEndpoints(t *testing.T, body string) string {
|
||||
return filename
|
||||
}
|
||||
|
||||
func TestBundledAgentEndpointExampleIsValidForCurrentMock(t *testing.T) {
|
||||
filename := filepath.Join("..", "..", "deploys", "config", "agent-endpoints.example.json")
|
||||
endpoint, err := LoadCurrentMockAgentEndpoint(filename)
|
||||
if err != nil || endpoint.AgentID != "agent-cell-a" || endpoint.CellID != "cell-a" || endpoint.Address != "127.0.0.1:19090" {
|
||||
t.Fatalf("bundled Agent endpoint example cannot start the current Mock: endpoint=%+v err=%v", endpoint, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadCurrentMockAgentEndpointRequiresOneLocalDeploymentTarget(t *testing.T) {
|
||||
endpoint, err := LoadCurrentMockAgentEndpoint(writeMockAgentEndpoints(t, mockAgentEndpoint))
|
||||
if err != nil || endpoint.AgentID != "agent-mock" || endpoint.CellID != "cell-mock" ||
|
||||
|
||||
Reference in New Issue
Block a user