2019-05-30 20:52:33 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package vouchers_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"storj.io/storj/internal/testcontext"
|
|
|
|
"storj.io/storj/internal/testplanet"
|
|
|
|
"storj.io/storj/pkg/pb"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestVouchers(t *testing.T) {
|
|
|
|
testplanet.Run(t, testplanet.Config{
|
2019-09-04 18:21:02 +01:00
|
|
|
SatelliteCount: 1, StorageNodeCount: 1, UplinkCount: 0,
|
2019-05-30 20:52:33 +01:00
|
|
|
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
|
|
|
|
satellite := planet.Satellites[0].Local().Node
|
|
|
|
|
2019-09-04 18:21:02 +01:00
|
|
|
conn, err := planet.StorageNodes[0].Transport.DialNode(ctx, &satellite)
|
|
|
|
require.NoError(t, err)
|
|
|
|
defer ctx.Check(conn.Close)
|
2019-05-30 20:52:33 +01:00
|
|
|
|
2019-09-04 18:21:02 +01:00
|
|
|
client := pb.NewVouchersClient(conn)
|
2019-05-30 20:52:33 +01:00
|
|
|
|
2019-09-04 18:21:02 +01:00
|
|
|
resp, err := client.Request(ctx, &pb.VoucherRequest{})
|
|
|
|
require.Nil(t, resp)
|
|
|
|
require.EqualError(t, err, "rpc error: code = Unknown desc = Vouchers endpoint is deprecated. Please upgrade your storage node to the latest version.")
|
2019-05-30 20:52:33 +01:00
|
|
|
})
|
|
|
|
}
|