private/testplanet: use drpc referral manager server

Change-Id: I9e9e9a724c78c98859dd3e29416d766d8ffdca63
This commit is contained in:
Egon Elbre 2020-05-06 17:30:22 +03:00
parent 2955c50bc1
commit c5452a87ec
4 changed files with 5 additions and 23 deletions

View File

@ -9,7 +9,7 @@ import (
"go.uber.org/zap"
"storj.io/common/identity/testidentity"
"storj.io/common/pb/pbgrpc"
"storj.io/common/pb"
"storj.io/common/storj"
"storj.io/storj/satellite"
"storj.io/storj/satellite/metainfo"
@ -22,7 +22,7 @@ type Reconfigure struct {
SatellitePointerDB func(log *zap.Logger, index int, db metainfo.PointerDB) (metainfo.PointerDB, error)
Satellite func(log *zap.Logger, index int, config *satellite.Config)
ReferralManagerServer func(log *zap.Logger) pbgrpc.ReferralManagerServer
ReferralManagerServer func(log *zap.Logger) pb.DRPCReferralManagerServer
StorageNodeDB func(index int, db storagenode.DB, log *zap.Logger) (storagenode.DB, error)
StorageNode func(index int, config *storagenode.Config)

View File

@ -9,7 +9,6 @@ import (
"path/filepath"
"storj.io/common/pb"
"storj.io/common/pb/pbgrpc"
"storj.io/common/peertls/extensions"
"storj.io/common/peertls/tlsopts"
"storj.io/common/testrand"
@ -51,7 +50,7 @@ func (planet *Planet) newReferralManager() (*server.Server, error) {
},
}
var endpoints pbgrpc.ReferralManagerServer
var endpoints pb.DRPCReferralManagerServer
// only create a referral manager server if testplanet was reconfigured with a custom referral manager endpoint
if planet.config.Reconfigure.ReferralManagerServer != nil {
endpoints = planet.config.Reconfigure.ReferralManagerServer(log)

View File

@ -24,22 +24,6 @@ import (
"storj.io/storj/storagenode"
)
// TestRPCBuild prints a statement so that in test output you can know whether
// the code was compiled with dprc or grpc
func TestRPCBuild(t *testing.T) {
require.False(t, rpc.IsDRPC == rpc.IsGRPC)
var rpcType string
if rpc.IsDRPC {
rpcType = "Compiled with DRPC"
} else if rpc.IsGRPC {
rpcType = "Compiled with GRPC"
}
require.NotEqual(t, rpcType, "")
t.Log(rpcType)
}
func TestDialNode(t *testing.T) {
testplanet.Run(t, testplanet.Config{
SatelliteCount: 0, StorageNodeCount: 2, UplinkCount: 0,

View File

@ -11,7 +11,6 @@ import (
"go.uber.org/zap"
"storj.io/common/pb"
"storj.io/common/pb/pbgrpc"
"storj.io/common/rpc/rpcstatus"
"storj.io/common/testcontext"
"storj.io/common/testrand"
@ -24,7 +23,7 @@ func TestServiceSuccess(t *testing.T) {
testplanet.Run(t, testplanet.Config{
SatelliteCount: 1,
Reconfigure: testplanet.Reconfigure{
ReferralManagerServer: func(logger *zap.Logger) pbgrpc.ReferralManagerServer {
ReferralManagerServer: func(logger *zap.Logger) pb.DRPCReferralManagerServer {
endpoint := &endpointHappyPath{}
endpoint.SetTokenCount(tokenCount)
return endpoint
@ -59,7 +58,7 @@ func TestServiceRedeemFailure(t *testing.T) {
testplanet.Run(t, testplanet.Config{
SatelliteCount: 1,
Reconfigure: testplanet.Reconfigure{
ReferralManagerServer: func(logger *zap.Logger) pbgrpc.ReferralManagerServer {
ReferralManagerServer: func(logger *zap.Logger) pb.DRPCReferralManagerServer {
endpoint := &endpointFailedPath{}
endpoint.SetTokenCount(2)
return endpoint