[#139] Refactor blobovnicza exists test to not use chmod #253
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
|
|
@ -159,7 +159,7 @@ func (np *Processor) processRemoveSubnetNode(ev subnetEvent.RemoveNode) {
|
|||
|
||||
err = subnetToRemoveFrom.Unmarshal(rawSubnet)
|
||||
if err != nil {
|
||||
np.log.Warn(logs.NetmapCouldNotUnmarshalSubnetId,
|
||||
np.log.Warn(logs.NetmapCouldNotUnmarshalSubnetID,
|
||||
zap.Error(err),
|
||||
)
|
||||
return
|
||||
|
|
|
@ -53,10 +53,11 @@ func TestExistsInvalidStorageID(t *testing.T) {
|
|||
t.Run("invalid storage id", func(t *testing.T) {
|
||||
storageID := slice.Copy(putRes.StorageID)
|
||||
storageID[0] = '9'
|
||||
badDir := filepath.Join(dir, "9")
|
||||
require.NoError(t, os.MkdirAll(badDir, os.ModePerm))
|
||||
require.NoError(t, os.Chmod(badDir, 0))
|
||||
t.Cleanup(func() { _ = os.Chmod(filepath.Join(dir, "9"), os.ModePerm) })
|
||||
|
||||
// An invalid boltdb file is created so that it returns an error when opened
|
||||
badFileDir := filepath.Join(dir, "9", "0")
|
||||
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})
|
||||
require.Error(t, err)
|
||||
|
|
Loading…
Reference in a new issue
Can we do it in a separate commit?
no. The precommit won't let me. Not sure how it got through in the first place.