forked from cloudfoundry/gorouter
/
helpers.go
48 lines (37 loc) · 893 Bytes
/
helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package test_util
import (
"github.com/cloudfoundry/gorouter/config"
"time"
)
func SpecConfig(natsPort, statusPort, proxyPort uint16) *config.Config {
c := config.DefaultConfig()
c.Port = proxyPort
c.Index = 2
c.TraceKey = "my_trace_key"
// Hardcode the IP to localhost to avoid leaving the machine while running tests
c.Ip = "127.0.0.1"
c.StartResponseDelayInterval = 10 * time.Millisecond
c.PublishStartMessageIntervalInSeconds = 10
c.PruneStaleDropletsInterval = 0
c.DropletStaleThreshold = 0
c.PublishActiveAppsInterval = 0
c.EndpointTimeout = 500 * time.Millisecond
c.Status = config.StatusConfig{
Port: statusPort,
User: "user",
Pass: "pass",
}
c.Nats = []config.NatsConfig{
{
Host: "localhost",
Port: natsPort,
User: "nats",
Pass: "nats",
},
}
c.Logging = config.LoggingConfig{
File: "/dev/stdout",
Level: "info",
}
return c
}