Add test for HA availability to command/server

This commit is contained in:
Jeff Mitchell
2016-02-02 17:47:02 -05:00
parent c41a6d2104
commit 2cf9afe5d6
2 changed files with 57 additions and 14 deletions

View File

@@ -267,17 +267,6 @@ func (c *ServerCommand) Run(args []string) int {
lns = append(lns, ln)
}
if verifyOnly {
return 0
}
// Initialize the HTTP server
server := &http.Server{}
server.Handler = vaulthttp.Handler(core)
for _, ln := range lns {
go server.Serve(ln)
}
infoKeys = append(infoKeys, "version")
info["version"] = version.GetVersion().String()
@@ -293,6 +282,20 @@ func (c *ServerCommand) Run(args []string) int {
}
c.Ui.Output("")
if verifyOnly {
for _, listener := range lns {
listener.Close()
}
return 0
}
// Initialize the HTTP server
server := &http.Server{}
server.Handler = vaulthttp.Handler(core)
for _, ln := range lns {
go server.Serve(ln)
}
// Output the header that the server has started
c.Ui.Output("==> Vault server started! Log data will stream in below:\n")