forked from TrueCloudLab/frostfs-node
[#1972] node: Fix object format unit tests
Includes: 1. Unused func removal; 2. Err check of the `Sign` method. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
aab398f4f5
commit
b9fb0d6050
2 changed files with 4 additions and 12 deletions
|
@ -17,6 +17,8 @@ Changelog for NeoFS Node
|
||||||
- Correctly select the shard for applying tree service operations (#1996)
|
- Correctly select the shard for applying tree service operations (#1996)
|
||||||
- Do not panic with bad inputs for `GET_RANGE` (#2007)
|
- Do not panic with bad inputs for `GET_RANGE` (#2007)
|
||||||
- Physical child object removal by GC (#1699)
|
- Physical child object removal by GC (#1699)
|
||||||
|
- Broadcasting helper objects (#1972)
|
||||||
|
- `neofs-cli lock object`'s `lifetime` flag handling (#1972)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
### Updated
|
### Updated
|
||||||
|
|
|
@ -2,8 +2,6 @@ package object
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"crypto/rand"
|
|
||||||
"crypto/sha256"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -19,15 +17,6 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testSHA(t *testing.T) [sha256.Size]byte {
|
|
||||||
cs := [sha256.Size]byte{}
|
|
||||||
|
|
||||||
_, err := rand.Read(cs[:])
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
return cs
|
|
||||||
}
|
|
||||||
|
|
||||||
func blankValidObject(key *ecdsa.PrivateKey) *object.Object {
|
func blankValidObject(key *ecdsa.PrivateKey) *object.Object {
|
||||||
var idOwner user.ID
|
var idOwner user.ID
|
||||||
user.IDFromKey(&idOwner, key.PublicKey)
|
user.IDFromKey(&idOwner, key.PublicKey)
|
||||||
|
@ -89,7 +78,8 @@ func TestFormatValidator_Validate(t *testing.T) {
|
||||||
user.IDFromKey(&idOwner, ownerKey.PrivateKey.PublicKey)
|
user.IDFromKey(&idOwner, ownerKey.PrivateKey.PublicKey)
|
||||||
|
|
||||||
tok := sessiontest.Object()
|
tok := sessiontest.Object()
|
||||||
tok.Sign(ownerKey.PrivateKey)
|
err := tok.Sign(ownerKey.PrivateKey)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
obj := object.New()
|
obj := object.New()
|
||||||
obj.SetContainerID(cidtest.ID())
|
obj.SetContainerID(cidtest.ID())
|
||||||
|
|
Loading…
Reference in a new issue