mirror of https://github.com/hashicorp/consul
Fix up command and api tests
parent
9221aed856
commit
f389b59fd5
|
@ -2,7 +2,6 @@ package command
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net"
|
||||
|
@ -30,14 +29,12 @@ type agentWrapper struct {
|
|||
dir string
|
||||
config *agent.Config
|
||||
agent *agent.Agent
|
||||
rpc *agent.AgentRPC
|
||||
http *agent.HTTPServer
|
||||
addr string
|
||||
httpAddr string
|
||||
}
|
||||
|
||||
func (a *agentWrapper) Shutdown() {
|
||||
a.rpc.Shutdown()
|
||||
a.agent.Shutdown()
|
||||
a.http.Shutdown()
|
||||
os.RemoveAll(a.dir)
|
||||
|
@ -67,7 +64,6 @@ func testAgentWithConfigReload(t *testing.T, cb func(c *agent.Config), reloadCh
|
|||
}
|
||||
|
||||
lw := logger.NewLogWriter(512)
|
||||
mult := io.MultiWriter(os.Stderr, lw)
|
||||
|
||||
conf := nextConfig()
|
||||
if cb != nil {
|
||||
|
@ -86,8 +82,6 @@ func testAgentWithConfigReload(t *testing.T, cb func(c *agent.Config), reloadCh
|
|||
t.Fatalf(fmt.Sprintf("err: %v", err))
|
||||
}
|
||||
|
||||
rpc := agent.NewAgentRPC(a, l, mult, lw)
|
||||
|
||||
conf.Addresses.HTTP = "127.0.0.1"
|
||||
httpAddr := fmt.Sprintf("127.0.0.1:%d", conf.Ports.HTTP)
|
||||
http, err := agent.NewHTTPServers(a, conf, os.Stderr)
|
||||
|
@ -105,7 +99,6 @@ func testAgentWithConfigReload(t *testing.T, cb func(c *agent.Config), reloadCh
|
|||
dir: dir,
|
||||
config: conf,
|
||||
agent: a,
|
||||
rpc: rpc,
|
||||
http: http[0],
|
||||
addr: l.Addr().String(),
|
||||
httpAddr: httpAddr,
|
||||
|
@ -124,7 +117,6 @@ func nextConfig() *agent.Config {
|
|||
|
||||
conf.Ports.HTTP = 10000 + 10*idx
|
||||
conf.Ports.HTTPS = 10401 + 10*idx
|
||||
conf.Ports.RPC = 10100 + 10*idx
|
||||
conf.Ports.SerfLan = 10201 + 10*idx
|
||||
conf.Ports.SerfWan = 10202 + 10*idx
|
||||
conf.Ports.Server = 10300 + 10*idx
|
||||
|
|
|
@ -40,7 +40,6 @@ type TestPerformanceConfig struct {
|
|||
type TestPortConfig struct {
|
||||
DNS int `json:"dns,omitempty"`
|
||||
HTTP int `json:"http,omitempty"`
|
||||
RPC int `json:"rpc,omitempty"`
|
||||
SerfLan int `json:"serf_lan,omitempty"`
|
||||
SerfWan int `json:"serf_wan,omitempty"`
|
||||
Server int `json:"server,omitempty"`
|
||||
|
@ -95,7 +94,6 @@ func defaultServerConfig() *TestServerConfig {
|
|||
Ports: &TestPortConfig{
|
||||
DNS: randomPort(),
|
||||
HTTP: randomPort(),
|
||||
RPC: randomPort(),
|
||||
SerfLan: randomPort(),
|
||||
SerfWan: randomPort(),
|
||||
Server: randomPort(),
|
||||
|
|
Loading…
Reference in New Issue