From ba6e909ed7946844c2efb17ebcdc70f0d94cf320 Mon Sep 17 00:00:00 2001 From: Paul Banks Date: Thu, 14 Jun 2018 14:07:33 +0100 Subject: [PATCH] Misc test fixes --- agent/agent_endpoint_test.go | 2 +- agent/config/runtime_test.go | 3 ++- api/agent_test.go | 6 +++--- testutil/server.go | 3 +++ watch/funcs_test.go | 9 ++++++++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/agent/agent_endpoint_test.go b/agent/agent_endpoint_test.go index c4086b8c0..f90c53fe0 100644 --- a/agent/agent_endpoint_test.go +++ b/agent/agent_endpoint_test.go @@ -2911,7 +2911,7 @@ func TestAgentConnectProxyConfig_Blocking(t *testing.T) { ur, err := copystructure.Copy(expectedResponse) require.NoError(t, err) updatedResponse := ur.(*api.ConnectProxyConfig) - updatedResponse.ContentHash = "29d7e419862bc848" + updatedResponse.ContentHash = "8f2f6b5f2496acd8" upstreams := updatedResponse.Config["upstreams"].([]interface{}) upstreams = append(upstreams, map[string]interface{}{ diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index af3b1296e..8ecf397b0 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -4424,7 +4424,8 @@ func TestSanitize(t *testing.T) { "FilterDefault": false, "MetricsPrefix": "", "PrometheusRetentionTime": "0s", - "StatsdAddr": "" + "StatsdAddr": "", + "StatsiteAddr": "" }, "TranslateWANAddrs": false, "UIDir": "", diff --git a/api/agent_test.go b/api/agent_test.go index 00caaf888..78f83cdaf 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -1045,7 +1045,7 @@ func TestAPI_AgentConnectCARoots_empty(t *testing.T) { require := require.New(t) c, s := makeClientWithConfig(t, nil, func(c *testutil.TestServerConfig) { - c.Connect = nil // disable connect to prevent CA beening bootstrapped + c.Connect = nil // disable connect to prevent CA being bootstrapped }) defer s.Stop() @@ -1162,8 +1162,8 @@ func TestAPI_AgentConnectProxyConfig(t *testing.T) { "foo": "bar", "local_service_address": "127.0.0.1:8000", "telemetry": map[string]interface{}{ - "FilterDefault": true, - "MetricsPrefix": "consul.proxy.foo", + "filter_default": true, + "metrics_prefix": "consul.proxy.foo", }, }, } diff --git a/testutil/server.go b/testutil/server.go index 193a856a3..8bbeca0e4 100644 --- a/testutil/server.go +++ b/testutil/server.go @@ -143,6 +143,9 @@ func defaultServerConfig() *TestServerConfig { // const TestClusterID causes import cycle so hard code it here. "cluster_id": "11111111-2222-3333-4444-555555555555", }, + "proxy": map[string]interface{}{ + "allow_managed_api_registration": true, + }, }, } } diff --git a/watch/funcs_test.go b/watch/funcs_test.go index 9632ef206..2f3ee12bf 100644 --- a/watch/funcs_test.go +++ b/watch/funcs_test.go @@ -653,7 +653,14 @@ func TestConnectLeafWatch(t *testing.T) { func TestConnectProxyConfigWatch(t *testing.T) { t.Parallel() - a := agent.NewTestAgent(t.Name(), ``) + a := agent.NewTestAgent(t.Name(), ` + connect { + enabled = true + proxy { + allow_managed_api_registration = true + } + } + `) defer a.Shutdown() // Register a local agent service with a managed proxy