Adds a leader wait when testing with ACLs.

pull/2594/head
James Phillips 8 years ago
parent 03f40116f4
commit 4ffd824547
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11

@ -33,7 +33,7 @@ func makeHTTPServerWithConfig(t *testing.T, cb func(c *Config)) (string, *HTTPSe
} }
func makeHTTPServerWithACLs(t *testing.T) (string, *HTTPServer) { func makeHTTPServerWithACLs(t *testing.T) (string, *HTTPServer) {
return makeHTTPServerWithConfig(t, func(c *Config) { dir, srv := makeHTTPServerWithConfig(t, func(c *Config) {
c.ACLDatacenter = c.Datacenter c.ACLDatacenter = c.Datacenter
c.ACLDefaultPolicy = "deny" c.ACLDefaultPolicy = "deny"
c.ACLMasterToken = "root" c.ACLMasterToken = "root"
@ -41,6 +41,11 @@ func makeHTTPServerWithACLs(t *testing.T) (string, *HTTPServer) {
c.ACLAgentMasterToken = "towel" c.ACLAgentMasterToken = "towel"
c.ACLEnforceVersion8 = Bool(true) c.ACLEnforceVersion8 = Bool(true)
}) })
// Need a leader to look up ACLs, so wait here so we don't need to
// repeat this in each test.
testutil.WaitForLeader(t, srv.agent.RPC, "dc1")
return dir, srv
} }
func makeHTTPServerWithConfigLog(t *testing.T, cb func(c *Config), l io.Writer, logWriter *logger.LogWriter) (string, *HTTPServer) { func makeHTTPServerWithConfigLog(t *testing.T, cb func(c *Config), l io.Writer, logWriter *logger.LogWriter) (string, *HTTPServer) {

Loading…
Cancel
Save