mirror of https://github.com/hashicorp/consul
Make new gateway tests compatible with enterprise (#7856)
parent
4344daf62b
commit
7a7760bfd5
|
@ -1279,6 +1279,7 @@ func TestInternal_GatewayServiceDump_Terminating(t *testing.T) {
|
|||
Passing: 1,
|
||||
Warning: 1,
|
||||
},
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
Checks: structs.HealthChecks{
|
||||
{
|
||||
|
@ -1288,11 +1289,12 @@ func TestInternal_GatewayServiceDump_Terminating(t *testing.T) {
|
|||
Status: "passing",
|
||||
ServiceID: "db2",
|
||||
ServiceName: "db",
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
},
|
||||
GatewayService: &structs.GatewayService{
|
||||
Gateway: structs.ServiceID{ID: "terminating-gateway"},
|
||||
Service: structs.ServiceID{ID: "db"},
|
||||
Gateway: structs.NewServiceID("terminating-gateway", nil),
|
||||
Service: structs.NewServiceID("db", nil),
|
||||
GatewayKind: "terminating-gateway",
|
||||
},
|
||||
},
|
||||
|
@ -1309,6 +1311,7 @@ func TestInternal_GatewayServiceDump_Terminating(t *testing.T) {
|
|||
Passing: 1,
|
||||
Warning: 1,
|
||||
},
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
Checks: structs.HealthChecks{
|
||||
{
|
||||
|
@ -1318,19 +1321,20 @@ func TestInternal_GatewayServiceDump_Terminating(t *testing.T) {
|
|||
Status: "warning",
|
||||
ServiceID: "db",
|
||||
ServiceName: "db",
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
},
|
||||
GatewayService: &structs.GatewayService{
|
||||
Gateway: structs.ServiceID{ID: "terminating-gateway"},
|
||||
Service: structs.ServiceID{ID: "db"},
|
||||
Gateway: structs.NewServiceID("terminating-gateway", nil),
|
||||
Service: structs.NewServiceID("db", nil),
|
||||
GatewayKind: "terminating-gateway",
|
||||
},
|
||||
},
|
||||
{
|
||||
// Only GatewayService should be returned when linked service isn't registered
|
||||
GatewayService: &structs.GatewayService{
|
||||
Gateway: structs.ServiceID{ID: "terminating-gateway"},
|
||||
Service: structs.ServiceID{ID: "redis"},
|
||||
Gateway: structs.NewServiceID("terminating-gateway", nil),
|
||||
Service: structs.NewServiceID("redis", nil),
|
||||
GatewayKind: "terminating-gateway",
|
||||
CAFile: "/etc/certs/ca.pem",
|
||||
CertFile: "/etc/certs/cert.pem",
|
||||
|
@ -1608,6 +1612,7 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) {
|
|||
Passing: 1,
|
||||
Warning: 1,
|
||||
},
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
Checks: structs.HealthChecks{
|
||||
{
|
||||
|
@ -1617,11 +1622,12 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) {
|
|||
Status: "warning",
|
||||
ServiceID: "db",
|
||||
ServiceName: "db",
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
},
|
||||
GatewayService: &structs.GatewayService{
|
||||
Gateway: structs.ServiceID{ID: "ingress-gateway"},
|
||||
Service: structs.ServiceID{ID: "db"},
|
||||
Gateway: structs.NewServiceID("ingress-gateway", nil),
|
||||
Service: structs.NewServiceID("db", nil),
|
||||
GatewayKind: "ingress-gateway",
|
||||
Port: 8888,
|
||||
Protocol: "tcp",
|
||||
|
@ -1640,6 +1646,7 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) {
|
|||
Passing: 1,
|
||||
Warning: 1,
|
||||
},
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
Checks: structs.HealthChecks{
|
||||
{
|
||||
|
@ -1649,11 +1656,12 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) {
|
|||
Status: "passing",
|
||||
ServiceID: "db2",
|
||||
ServiceName: "db",
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
},
|
||||
GatewayService: &structs.GatewayService{
|
||||
Gateway: structs.ServiceID{ID: "ingress-gateway"},
|
||||
Service: structs.ServiceID{ID: "db"},
|
||||
Gateway: structs.NewServiceID("ingress-gateway", nil),
|
||||
Service: structs.NewServiceID("db", nil),
|
||||
GatewayKind: "ingress-gateway",
|
||||
Port: 8888,
|
||||
Protocol: "tcp",
|
||||
|
@ -1662,8 +1670,8 @@ func TestInternal_GatewayServiceDump_Ingress(t *testing.T) {
|
|||
{
|
||||
// Only GatewayService should be returned when upstream isn't registered
|
||||
GatewayService: &structs.GatewayService{
|
||||
Gateway: structs.ServiceID{ID: "ingress-gateway"},
|
||||
Service: structs.ServiceID{ID: "web"},
|
||||
Gateway: structs.NewServiceID("ingress-gateway", nil),
|
||||
Service: structs.NewServiceID("web", nil),
|
||||
GatewayKind: "ingress-gateway",
|
||||
Port: 8080,
|
||||
Protocol: "tcp",
|
||||
|
|
|
@ -516,6 +516,7 @@ func TestUIGatewayServiceNodes_Terminating(t *testing.T) {
|
|||
expect := []*ServiceSummary{
|
||||
{
|
||||
Name: "redis",
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
{
|
||||
Name: "db",
|
||||
|
@ -525,6 +526,7 @@ func TestUIGatewayServiceNodes_Terminating(t *testing.T) {
|
|||
ChecksPassing: 1,
|
||||
ChecksWarning: 1,
|
||||
ChecksCritical: 0,
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
}
|
||||
assert.ElementsMatch(t, expect, dump)
|
||||
|
@ -639,6 +641,7 @@ func TestUIGatewayServiceNodes_Ingress(t *testing.T) {
|
|||
{
|
||||
Name: "web",
|
||||
GatewayConfig: GatewayConfig{ListenerPort: 8080},
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
{
|
||||
Name: "db",
|
||||
|
@ -649,6 +652,7 @@ func TestUIGatewayServiceNodes_Ingress(t *testing.T) {
|
|||
ChecksWarning: 1,
|
||||
ChecksCritical: 0,
|
||||
GatewayConfig: GatewayConfig{ListenerPort: 8888},
|
||||
EnterpriseMeta: *structs.DefaultEnterpriseMeta(),
|
||||
},
|
||||
}
|
||||
assert.ElementsMatch(t, expect, dump)
|
||||
|
|
Loading…
Reference in New Issue