Fix up command and api tests

pull/2774/head
Kyle Havlovitz 2017-02-28 14:12:55 -08:00
parent 9221aed856
commit f389b59fd5
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
2 changed files with 0 additions and 10 deletions

View File

@ -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

View File

@ -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(),