Browse Source

etcd-agent: fix etcd agent tests, remove unused listener

Gyu-Ho Lee 9 years ago
parent
commit
139f23fd13

+ 0 - 3
tools/functional-tester/etcd-agent/agent.go

@@ -16,7 +16,6 @@ package main
 
 
 import (
 import (
 	"fmt"
 	"fmt"
-	"net"
 	"os"
 	"os"
 	"os/exec"
 	"os/exec"
 	"path"
 	"path"
@@ -40,8 +39,6 @@ type Agent struct {
 	cmd         *exec.Cmd
 	cmd         *exec.Cmd
 	logfile     *os.File
 	logfile     *os.File
 	etcdLogPath string
 	etcdLogPath string
-
-	l net.Listener
 }
 }
 
 
 func newAgent(etcd, etcdLogPath string) (*Agent, error) {
 func newAgent(etcd, etcdLogPath string) (*Agent, error) {

+ 1 - 1
tools/functional-tester/etcd-agent/agent_test.go

@@ -21,7 +21,7 @@ import (
 	"testing"
 	"testing"
 )
 )
 
 
-const etcdPath = filepath.Join(os.Getenv("GOPATH"), "bin/etcd")
+var etcdPath = filepath.Join(os.Getenv("GOPATH"), "bin/etcd")
 
 
 func TestAgentStart(t *testing.T) {
 func TestAgentStart(t *testing.T) {
 	defer os.Remove("etcd.log")
 	defer os.Remove("etcd.log")

+ 2 - 2
tools/functional-tester/etcd-agent/rpc_test.go

@@ -25,11 +25,11 @@ import (
 )
 )
 
 
 func init() {
 func init() {
-	defaultAgent, err := newAgent(etcdPath)
+	defaultAgent, err := newAgent(etcdPath, "etcd.log")
 	if err != nil {
 	if err != nil {
 		log.Panic(err)
 		log.Panic(err)
 	}
 	}
-	defaultAgent.serveRPC()
+	defaultAgent.serveRPC(":9027")
 }
 }
 
 
 func TestRPCStart(t *testing.T) {
 func TestRPCStart(t *testing.T) {