testutil: fix boostrap mode after flag change

This commit is contained in:
Ryan Uber
2015-09-24 21:16:52 -07:00
parent 13613e4100
commit 7a6e633028

View File

@@ -50,8 +50,8 @@ type PortsConfig struct {
// ServerConfig is used to configure the nomad server.
type ServerConfig struct {
Enabled bool `json:"enabled"`
Bootstrap bool `json:"bootstrap"`
Enabled bool `json:"enabled"`
BootstrapExpect int `json:"bootstrap_expect"`
}
// ClientConfig is used to configure the client
@@ -78,8 +78,8 @@ func defaultServerConfig() *TestServerConfig {
Serf: 22000 + idx,
},
Server: &ServerConfig{
Enabled: true,
Bootstrap: true,
Enabled: true,
BootstrapExpect: 1,
},
Client: &ClientConfig{
Enabled: false,
@@ -170,7 +170,7 @@ func NewTestServer(t *testing.T, cb ServerConfigCallback) *TestServer {
}
// Wait for the server to be ready
if nomadConfig.Server.Enabled && nomadConfig.Server.Bootstrap {
if nomadConfig.Server.Enabled && nomadConfig.Server.BootstrapExpect != 0 {
server.waitForLeader()
} else {
server.waitForAPI()