diff --git a/integration/cluster.go b/integration/cluster.go index 7af9d77a1..3278bc232 100644 --- a/integration/cluster.go +++ b/integration/cluster.go @@ -935,4 +935,8 @@ type grpcAPI struct { Maintenance pb.MaintenanceClient // Auth is the authentication API for the client's connection. Auth pb.AuthClient + // Lock is the lock API for the client's connection. + Lock lockpb.LockClient + // Election is the election API for the client's connection. + Election epb.ElectionClient } diff --git a/integration/cluster_direct.go b/integration/cluster_direct.go index 84b2a796c..ff97e6146 100644 --- a/integration/cluster_direct.go +++ b/integration/cluster_direct.go @@ -18,6 +18,8 @@ package integration import ( "github.com/coreos/etcd/clientv3" + "github.com/coreos/etcd/etcdserver/api/v3election/v3electionpb" + "github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" ) @@ -29,6 +31,8 @@ func toGRPC(c *clientv3.Client) grpcAPI { pb.NewWatchClient(c.ActiveConnection()), pb.NewMaintenanceClient(c.ActiveConnection()), pb.NewAuthClient(c.ActiveConnection()), + v3lockpb.NewLockClient(c.ActiveConnection()), + v3electionpb.NewElectionClient(c.ActiveConnection()), } } diff --git a/integration/cluster_proxy.go b/integration/cluster_proxy.go index 8593b5064..3916553be 100644 --- a/integration/cluster_proxy.go +++ b/integration/cluster_proxy.go @@ -58,6 +58,8 @@ func toGRPC(c *clientv3.Client) grpcAPI { lp, lpch := grpcproxy.NewLeaseProxy(c) mp := grpcproxy.NewMaintenanceProxy(c) clp, _ := grpcproxy.NewClusterProxy(c, "", "") // without registering proxy URLs + lockp := grpcproxy.NewLockProxy(c) + electp := grpcproxy.NewElectionProxy(c) grpc := grpcAPI{ adapter.ClusterServerToClusterClient(clp), @@ -66,6 +68,8 @@ func toGRPC(c *clientv3.Client) grpcAPI { adapter.WatchServerToWatchClient(wp), adapter.MaintenanceServerToMaintenanceClient(mp), pb.NewAuthClient(c.ActiveConnection()), + adapter.LockServerToLockClient(lockp), + adapter.ElectionServerToElectionClient(electp), } proxies[c] = grpcClientProxy{grpc: grpc, wdonec: wpch, kvdonec: kvpch, lpdonec: lpch} return grpc diff --git a/integration/v3election_grpc_test.go b/integration/v3election_grpc_test.go index b573b6e12..be320286e 100644 --- a/integration/v3election_grpc_test.go +++ b/integration/v3election_grpc_test.go @@ -41,7 +41,7 @@ func TestV3ElectionCampaign(t *testing.T) { t.Fatal(err2) } - lc := epb.NewElectionClient(clus.Client(0).ActiveConnection()) + lc := toGRPC(clus.Client(0)).Election req1 := &epb.CampaignRequest{Name: []byte("foo"), Lease: lease1.ID, Value: []byte("abc")} l1, lerr1 := lc.Campaign(context.TODO(), req1) if lerr1 != nil { @@ -94,7 +94,7 @@ func TestV3ElectionObserve(t *testing.T) { clus := NewClusterV3(t, &ClusterConfig{Size: 1}) defer clus.Terminate(t) - lc := epb.NewElectionClient(clus.Client(0).ActiveConnection()) + lc := toGRPC(clus.Client(0)).Election // observe leadership events observec := make(chan struct{}) diff --git a/integration/v3lock_grpc_test.go b/integration/v3lock_grpc_test.go index 04b7281d6..a66a8cf46 100644 --- a/integration/v3lock_grpc_test.go +++ b/integration/v3lock_grpc_test.go @@ -40,7 +40,7 @@ func TestV3LockLockWaiter(t *testing.T) { t.Fatal(err2) } - lc := lockpb.NewLockClient(clus.Client(0).ActiveConnection()) + lc := toGRPC(clus.Client(0)).Lock l1, lerr1 := lc.Lock(context.TODO(), &lockpb.LockRequest{Name: []byte("foo"), Lease: lease1.ID}) if lerr1 != nil { t.Fatal(lerr1)