diff --git a/consul/snapshot_endpoint_test.go b/consul/snapshot_endpoint_test.go index b72b715bd8..753c0c6e34 100644 --- a/consul/snapshot_endpoint_test.go +++ b/consul/snapshot_endpoint_test.go @@ -43,7 +43,7 @@ func verifySnapshot(t *testing.T, s *Server, dc, token string) { Op: structs.SnapshotSave, } var reply structs.SnapshotResponse - snap, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr, + snap, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(), &args, bytes.NewReader([]byte("")), &reply) if err != nil { t.Fatalf("err: %v", err) @@ -115,7 +115,7 @@ func verifySnapshot(t *testing.T, s *Server, dc, token string) { // Restore the snapshot. args.Op = structs.SnapshotRestore - restore, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr, + restore, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(), &args, snap, &reply) if err != nil { t.Fatalf("err: %v", err) @@ -186,7 +186,7 @@ func TestSnapshot_LeaderState(t *testing.T) { Op: structs.SnapshotSave, } var reply structs.SnapshotResponse - snap, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr, + snap, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(), &args, bytes.NewReader([]byte("")), &reply) if err != nil { t.Fatalf("err: %v", err) @@ -219,7 +219,7 @@ func TestSnapshot_LeaderState(t *testing.T) { // Restore the snapshot. args.Op = structs.SnapshotRestore - restore, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr, + restore, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(), &args, snap, &reply) if err != nil { t.Fatalf("err: %v", err) @@ -256,7 +256,7 @@ func TestSnapshot_ACLDeny(t *testing.T) { Op: structs.SnapshotSave, } var reply structs.SnapshotResponse - _, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr, + _, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(), &args, bytes.NewReader([]byte("")), &reply) if err == nil || !strings.Contains(err.Error(), permissionDenied) { t.Fatalf("err: %v", err) @@ -270,7 +270,7 @@ func TestSnapshot_ACLDeny(t *testing.T) { Op: structs.SnapshotRestore, } var reply structs.SnapshotResponse - _, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr, + _, err := SnapshotRPC(s1.connPool, s1.config.Datacenter, s1.config.RPCAddr.String(), &args, bytes.NewReader([]byte("")), &reply) if err == nil || !strings.Contains(err.Error(), permissionDenied) { t.Fatalf("err: %v", err) @@ -367,7 +367,7 @@ func TestSnapshot_AllowStale(t *testing.T) { Op: structs.SnapshotSave, } var reply structs.SnapshotResponse - _, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr, + _, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(), &args, bytes.NewReader([]byte("")), &reply) if err == nil || !strings.Contains(err.Error(), structs.ErrNoLeader.Error()) { t.Fatalf("err: %v", err) @@ -384,7 +384,7 @@ func TestSnapshot_AllowStale(t *testing.T) { Op: structs.SnapshotSave, } var reply structs.SnapshotResponse - _, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr, + _, err := SnapshotRPC(s.connPool, s.config.Datacenter, s.config.RPCAddr.String(), &args, bytes.NewReader([]byte("")), &reply) if err == nil || !strings.Contains(err.Error(), "Raft error when taking snapshot") { t.Fatalf("err: %v", err)