storj/satellite/vouchers/vouchers_test.go
Egon Elbre d55288cf68 pkg/rpc: replace methods with direct calls to pb
Change-Id: I8bd015d8d316a2c12c1daceca1d9fd257f6f57bc
2019-12-22 17:12:43 +02:00

33 lines
905 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package vouchers_test
import (
"testing"
"github.com/stretchr/testify/require"
"storj.io/storj/pkg/pb"
"storj.io/storj/private/testcontext"
"storj.io/storj/private/testplanet"
)
func TestVouchers(t *testing.T) {
testplanet.Run(t, testplanet.Config{
SatelliteCount: 1, StorageNodeCount: 1, UplinkCount: 0,
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
satellite := planet.Satellites[0].Local().Node
conn, err := planet.StorageNodes[0].Dialer.DialNode(ctx, &satellite)
require.NoError(t, err)
defer ctx.Check(conn.Close)
client := pb.NewDRPCVouchersClient(conn.Raw())
resp, err := client.Request(ctx, &pb.VoucherRequest{})
require.Nil(t, resp)
require.Error(t, err, "Vouchers endpoint is deprecated. Please upgrade your storage node to the latest version.")
})
}