diff --git a/agent/consul/auto_config_endpoint_test.go b/agent/consul/auto_config_endpoint_test.go index 58335a65c9..3aa45bf5ce 100644 --- a/agent/consul/auto_config_endpoint_test.go +++ b/agent/consul/auto_config_endpoint_test.go @@ -153,6 +153,8 @@ func TestAutoConfigInitialConfiguration(t *testing.T) { } c.AutoConfigAuthzAllowReuse = true + c.ACLResolverSettings.ACLDisabledTTL = 12 * time.Second + cafile := path.Join(c.DataDir, "cacert.pem") err := ioutil.WriteFile(cafile, []byte(cacert), 0600) require.NoError(t, err) @@ -263,7 +265,7 @@ func TestAutoConfigInitialConfiguration(t *testing.T) { PolicyTTL: "30s", TokenTTL: "30s", RoleTTL: "30s", - DisabledTTL: "0s", + DisabledTTL: "12s", DownPolicy: "extend-cache", DefaultPolicy: "deny", Tokens: &pbconfig.ACLTokens{ diff --git a/agent/consul/server_test.go b/agent/consul/server_test.go index ce57c44dc3..25a0b407dc 100644 --- a/agent/consul/server_test.go +++ b/agent/consul/server_test.go @@ -245,6 +245,12 @@ func testServerWithConfig(t *testing.T, cb func(*Config)) (string, *Server) { cb(config) } + // Apply config to copied fields because many tests only set the old + //values. + config.ACLResolverSettings.ACLsEnabled = config.ACLsEnabled + config.ACLResolverSettings.NodeName = config.NodeName + config.ACLResolverSettings.Datacenter = config.Datacenter + var err error srv, err = newServer(t, config) if err != nil {