storj/satellite/vouchers/vouchers_test.go
Egon Elbre ed627144ed all: use DialNodeURL throughout the codebase
Change-Id: Iaf9ae3aeef7305c937f2660c929744db2d88776c
2020-05-20 10:36:30 +00:00

31 lines
862 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/common/pb"
"storj.io/common/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) {
conn, err := planet.StorageNodes[0].Dialer.DialNodeURL(ctx, planet.Satellites[0].NodeURL())
require.NoError(t, err)
defer ctx.Check(conn.Close)
client := pb.NewDRPCVouchersClient(conn)
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.")
})
}