Enable dev mode to allow using localhost in tests

This commit is contained in:
Michael Schurter 2016-11-08 16:35:11 -08:00
parent f1120e4de0
commit 23de99b1df
1 changed files with 9 additions and 0 deletions

View File

@ -318,11 +318,16 @@ func TestAgent_ServerConfig(t *testing.T) {
func TestAgent_ClientConfig(t *testing.T) {
conf := DefaultConfig()
// enabled just to allow using localhost for all addresses
conf.DevMode = true
a := &Agent{config: conf}
conf.Client.Enabled = true
conf.Addresses.HTTP = "127.0.0.1"
conf.Ports.HTTP = 5678
if ok := conf.normalize(getTestLogger(t), conf.DevMode); !ok {
t.Fatalf("error normalizing config")
}
c, err := a.clientConfig()
if err != nil {
t.Fatalf("got err: %v", err)
@ -334,10 +339,14 @@ func TestAgent_ClientConfig(t *testing.T) {
}
conf = DefaultConfig()
conf.DevMode = true
a = &Agent{config: conf}
conf.Client.Enabled = true
conf.Addresses.HTTP = "127.0.0.1"
if ok := conf.normalize(getTestLogger(t), conf.DevMode); !ok {
t.Fatalf("error normalizing config")
}
c, err = a.clientConfig()
if err != nil {
t.Fatalf("got err: %v", err)