(t *testing.T)
| 372 | } |
| 373 | |
| 374 | func TestRun_ConfigFileWithInvalidPeer(t *testing.T) { |
| 375 | ctx, cancel := context.WithCancel(context.Background()) |
| 376 | defer cancel() |
| 377 | |
| 378 | proxy1Addr := testAddr |
| 379 | clusterPort, clusterAddr, proxy1BindAddr, _ := generateTestAddrs(proxy1Addr) |
| 380 | |
| 381 | cluster := proxycore.NewMockCluster(net.ParseIP(testStartAddr), clusterPort) |
| 382 | |
| 383 | err := cluster.Add(ctx, 1) |
| 384 | require.NoError(t, err) |
| 385 | |
| 386 | defer cluster.Shutdown() |
| 387 | |
| 388 | configFileName, err := writeTempYaml(struct { |
| 389 | Bind string |
| 390 | Port int |
| 391 | RPCAddr string `yaml:"rpc-address"` |
| 392 | DataCenter string `yaml:"data-center"` |
| 393 | ContactPoints []string `yaml:"contact-points"` |
| 394 | HealthCheck bool `yaml:"health-check"` |
| 395 | HttpBind string `yaml:"http-bind"` |
| 396 | Peers []PeerConfig |
| 397 | }{ |
| 398 | ContactPoints: []string{clusterAddr}, |
| 399 | Bind: proxy1BindAddr, |
| 400 | RPCAddr: proxy1Addr, |
| 401 | Port: clusterPort, |
| 402 | Peers: []PeerConfig{{ |
| 403 | RPCAddr: "", // Empty |
| 404 | DC: "dc-2", |
| 405 | }}, |
| 406 | }) |
| 407 | require.NoError(t, err) |
| 408 | |
| 409 | rc := Run(ctx, []string{ |
| 410 | "--config", configFileName, |
| 411 | }) |
| 412 | require.Equal(t, 1, rc) |
| 413 | } |
| 414 | |
| 415 | func TestRun_ProxyTLS(t *testing.T) { |
| 416 | ctx, cancel := context.WithCancel(context.Background()) |
nothing calls this directly
no test coverage detected