Add tests lost during PR 1320.
The tests part of this change were originally in PR 1320 but got lost during one of the rebases. Let's bring them back in.
This commit is contained in:
parent
e86df016c3
commit
1dcf8d2ea6
1 changed files with 56 additions and 0 deletions
|
@ -337,6 +337,62 @@ func TestMarathonLoadConfig(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
applications: &marathon.Applications{
|
||||
Apps: []marathon.Application{
|
||||
{
|
||||
ID: "/testHealthCheck",
|
||||
Ports: []int{80},
|
||||
Labels: &map[string]string{
|
||||
labelBackendHealthCheckPath: "/path",
|
||||
labelBackendHealthCheckInterval: "5m",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tasks: &marathon.Tasks{
|
||||
Tasks: []marathon.Task{
|
||||
{
|
||||
ID: "testHealthCheck",
|
||||
AppID: "/testHealthCheck",
|
||||
Host: "127.0.0.1",
|
||||
Ports: []int{80},
|
||||
IPAddresses: []*marathon.IPAddress{
|
||||
{
|
||||
IPAddress: "127.0.0.1",
|
||||
Protocol: "tcp",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFrontends: map[string]*types.Frontend{
|
||||
"frontend-testHealthCheck": {
|
||||
Backend: "backend-testHealthCheck",
|
||||
PassHostHeader: true,
|
||||
EntryPoints: []string{},
|
||||
Routes: map[string]types.Route{
|
||||
"route-host-testHealthCheck": {
|
||||
Rule: "Host:testHealthCheck.docker.localhost",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedBackends: map[string]*types.Backend{
|
||||
"backend-testHealthCheck": {
|
||||
Servers: map[string]types.Server{
|
||||
"server-testHealthCheck": {
|
||||
URL: "http://127.0.0.1:80",
|
||||
Weight: 0,
|
||||
},
|
||||
},
|
||||
HealthCheck: &types.HealthCheck{
|
||||
Path: "/path",
|
||||
Interval: "5m",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
|
|
Loading…
Reference in a new issue