storj/satellite/vouchers/vouchers_test.go

31 lines
862 B
Go
Raw Normal View History

// 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.")
})
}