From 1893772f4b629118d80ce4659f80d46bb4dcfbd3 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 8 Nov 2016 16:35:11 -0800 Subject: [PATCH] Enable dev mode to allow using localhost in tests --- command/agent/agent_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/command/agent/agent_test.go b/command/agent/agent_test.go index 5ef4ab3fb..6e385d1c2 100644 --- a/command/agent/agent_test.go +++ b/command/agent/agent_test.go @@ -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)