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"
|
|
|
|
|
2019-12-27 11:48:47 +00:00
|
|
|
"storj.io/common/pb"
|
|
|
|
"storj.io/common/testcontext"
|
2019-11-14 19:46:15 +00:00
|
|
|
"storj.io/storj/private/testplanet"
|
2019-05-30 20:52:33 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
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) {
|
2020-05-19 16:49:13 +01:00
|
|
|
conn, err := planet.StorageNodes[0].Dialer.DialNodeURL(ctx, planet.Satellites[0].NodeURL())
|
2019-09-04 18:21:02 +01:00
|
|
|
require.NoError(t, err)
|
|
|
|
defer ctx.Check(conn.Close)
|
2019-05-30 20:52:33 +01:00
|
|
|
|
2020-03-25 12:15:27 +00:00
|
|
|
client := pb.NewDRPCVouchersClient(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)
|
2019-09-19 05:46:39 +01:00
|
|
|
require.Error(t, err, "Vouchers endpoint is deprecated. Please upgrade your storage node to the latest version.")
|
2019-05-30 20:52:33 +01:00
|
|
|
})
|
|
|
|
}
|