forked from TrueCloudLab/frostfs-node
[#118] node: add ctx for unit tests for blobstor
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
This commit is contained in:
parent
3d23b08773
commit
6c90bb87f1
1 changed files with 6 additions and 6 deletions
|
@ -192,7 +192,7 @@ func TestConcurrentPut(t *testing.T) {
|
||||||
require.NoError(t, blobStor.Init())
|
require.NoError(t, blobStor.Init())
|
||||||
|
|
||||||
testGet := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
testGet := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
||||||
res, err := b.Get(common.GetPrm{Address: object.AddressOf(obj)})
|
res, err := b.Get(context.Background(), common.GetPrm{Address: object.AddressOf(obj)})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, obj, res.Object)
|
require.Equal(t, obj, res.Object)
|
||||||
}
|
}
|
||||||
|
@ -200,14 +200,14 @@ func TestConcurrentPut(t *testing.T) {
|
||||||
testPut := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
testPut := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
||||||
var prm common.PutPrm
|
var prm common.PutPrm
|
||||||
prm.Object = obj
|
prm.Object = obj
|
||||||
_, err := b.Put(prm)
|
_, err := b.Put(context.Background(), prm)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
testPutFileExistsError := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
testPutFileExistsError := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
||||||
var prm common.PutPrm
|
var prm common.PutPrm
|
||||||
prm.Object = obj
|
prm.Object = obj
|
||||||
if _, err := b.Put(prm); err != nil {
|
if _, err := b.Put(context.Background(), prm); err != nil {
|
||||||
require.ErrorContains(t, err, "file exists")
|
require.ErrorContains(t, err, "file exists")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,14 +274,14 @@ func TestConcurrentDelete(t *testing.T) {
|
||||||
testPut := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
testPut := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
||||||
var prm common.PutPrm
|
var prm common.PutPrm
|
||||||
prm.Object = obj
|
prm.Object = obj
|
||||||
_, err := b.Put(prm)
|
_, err := b.Put(context.Background(), prm)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
testDelete := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
testDelete := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
||||||
var prm common.DeletePrm
|
var prm common.DeletePrm
|
||||||
prm.Address = object.AddressOf(obj)
|
prm.Address = object.AddressOf(obj)
|
||||||
if _, err := b.Delete(prm); err != nil {
|
if _, err := b.Delete(context.Background(), prm); err != nil {
|
||||||
require.ErrorContains(t, err, "object not found")
|
require.ErrorContains(t, err, "object not found")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ func TestConcurrentDelete(t *testing.T) {
|
||||||
testDeletedExists := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
testDeletedExists := func(t *testing.T, b *BlobStor, obj *objectSDK.Object) {
|
||||||
var prm common.ExistsPrm
|
var prm common.ExistsPrm
|
||||||
prm.Address = object.AddressOf(obj)
|
prm.Address = object.AddressOf(obj)
|
||||||
res, err := b.Exists(prm)
|
res, err := b.Exists(context.Background(), prm)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.False(t, res.Exists)
|
require.False(t, res.Exists)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue