forked from TrueCloudLab/frostfs-node
[#139] Refactor blobovnicza exist test to not use chmod
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
parent
adcfce39cf
commit
41eb3129ae
3 changed files with 7 additions and 6 deletions
|
@ -490,7 +490,7 @@ const (
|
||||||
NetmapCantInvokeNetmapUpdatePeer = "can't invoke netmap.UpdatePeer" // Error in ../node/pkg/innerring/processors/netmap/process_peers.go
|
NetmapCantInvokeNetmapUpdatePeer = "can't invoke netmap.UpdatePeer" // Error in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||||
NetmapNonAlphabetModeIgnoreRemoveNodeFromSubnetNotification = "non alphabet mode, ignore remove node from subnet notification" // Info in ../node/pkg/innerring/processors/netmap/process_peers.go
|
NetmapNonAlphabetModeIgnoreRemoveNodeFromSubnetNotification = "non alphabet mode, ignore remove node from subnet notification" // Info in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||||
NetmapCouldNotGetNetworkMapCandidates = "could not get network map candidates" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
NetmapCouldNotGetNetworkMapCandidates = "could not get network map candidates" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||||
NetmapCouldNotUnmarshalSubnetId = "could not unmarshal subnet id" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
NetmapCouldNotUnmarshalSubnetID = "could not unmarshal subnet id" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||||
NetmapGotZeroSubnetInRemoveNodeNotification = "got zero subnet in remove node notification" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
NetmapGotZeroSubnetInRemoveNodeNotification = "got zero subnet in remove node notification" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||||
NetmapCouldNotIterateOverSubnetworksOfTheNode = "could not iterate over subnetworks of the node" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
NetmapCouldNotIterateOverSubnetworksOfTheNode = "could not iterate over subnetworks of the node" // Warn in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||||
NetmapCouldNotInvokeNetmapUpdateState = "could not invoke netmap.UpdateState" // Error in ../node/pkg/innerring/processors/netmap/process_peers.go
|
NetmapCouldNotInvokeNetmapUpdateState = "could not invoke netmap.UpdateState" // Error in ../node/pkg/innerring/processors/netmap/process_peers.go
|
||||||
|
|
|
@ -159,7 +159,7 @@ func (np *Processor) processRemoveSubnetNode(ev subnetEvent.RemoveNode) {
|
||||||
|
|
||||||
err = subnetToRemoveFrom.Unmarshal(rawSubnet)
|
err = subnetToRemoveFrom.Unmarshal(rawSubnet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
np.log.Warn(logs.NetmapCouldNotUnmarshalSubnetId,
|
np.log.Warn(logs.NetmapCouldNotUnmarshalSubnetID,
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
|
@ -53,10 +53,11 @@ func TestExistsInvalidStorageID(t *testing.T) {
|
||||||
t.Run("invalid storage id", func(t *testing.T) {
|
t.Run("invalid storage id", func(t *testing.T) {
|
||||||
storageID := slice.Copy(putRes.StorageID)
|
storageID := slice.Copy(putRes.StorageID)
|
||||||
storageID[0] = '9'
|
storageID[0] = '9'
|
||||||
badDir := filepath.Join(dir, "9")
|
|
||||||
require.NoError(t, os.MkdirAll(badDir, os.ModePerm))
|
// An invalid boltdb file is created so that it returns an error when opened
|
||||||
require.NoError(t, os.Chmod(badDir, 0))
|
badFileDir := filepath.Join(dir, "9", "0")
|
||||||
t.Cleanup(func() { _ = os.Chmod(filepath.Join(dir, "9"), os.ModePerm) })
|
require.NoError(t, os.MkdirAll(badFileDir, os.ModePerm))
|
||||||
|
require.NoError(t, os.WriteFile(filepath.Join(badFileDir, "0"), []byte("not a boltdb file content"), 0777))
|
||||||
|
|
||||||
res, err := b.Exists(context.Background(), common.ExistsPrm{Address: addr, StorageID: storageID})
|
res, err := b.Exists(context.Background(), common.ExistsPrm{Address: addr, StorageID: storageID})
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
|
|
Loading…
Reference in a new issue