agent: Fixing tests

pull/399/head
Armon Dadgar 2014-10-13 17:52:51 -07:00
parent e7326d089e
commit 3e32e906d1
1 changed files with 7 additions and 6 deletions

View File

@ -1,12 +1,13 @@
package agent package agent
import ( import (
"github.com/hashicorp/consul/consul/structs"
"github.com/hashicorp/consul/testutil"
"os" "os"
"reflect" "reflect"
"testing" "testing"
"time" "time"
"github.com/hashicorp/consul/consul/structs"
"github.com/hashicorp/consul/testutil"
) )
func TestAgentAntiEntropy_Services(t *testing.T) { func TestAgentAntiEntropy_Services(t *testing.T) {
@ -42,7 +43,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
srv2 := &structs.NodeService{ srv2 := &structs.NodeService{
ID: "redis", ID: "redis",
Service: "redis", Service: "redis",
Tags: nil, Tags: []string{},
Port: 8000, Port: 8000,
} }
agent.state.AddService(srv2) agent.state.AddService(srv2)
@ -59,7 +60,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
srv3 := &structs.NodeService{ srv3 := &structs.NodeService{
ID: "web", ID: "web",
Service: "web", Service: "web",
Tags: nil, Tags: []string{},
Port: 80, Port: 80,
} }
agent.state.AddService(srv3) agent.state.AddService(srv3)
@ -68,7 +69,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
srv4 := &structs.NodeService{ srv4 := &structs.NodeService{
ID: "lb", ID: "lb",
Service: "lb", Service: "lb",
Tags: nil, Tags: []string{},
Port: 443, Port: 443,
} }
args.Service = srv4 args.Service = srv4
@ -104,7 +105,7 @@ func TestAgentAntiEntropy_Services(t *testing.T) {
} }
case "redis": case "redis":
if !reflect.DeepEqual(serv, srv2) { if !reflect.DeepEqual(serv, srv2) {
t.Fatalf("bad: %v %v", serv, srv2) t.Fatalf("bad: %#v %#v", serv, srv2)
} }
case "web": case "web":
if !reflect.DeepEqual(serv, srv3) { if !reflect.DeepEqual(serv, srv3) {