engine: make corruptSubDir
to ignore blobovnicza
dir
There is a dir for Blobovnicza tree in BlobStor, so we need to ignore it. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
bb25ecbd15
commit
86552cf3ae
1 changed files with 6 additions and 2 deletions
|
@ -197,12 +197,16 @@ func checkShardState(t *testing.T, e *StorageEngine, id *shard.ID, errCount uint
|
|||
require.Equal(t, errCount, sh.errorCount.Load())
|
||||
}
|
||||
|
||||
// corruptSubDir makes random directory in blobstor FSTree unreadable.
|
||||
// corruptSubDir makes random directory except "blobovnicza" in blobstor FSTree unreadable.
|
||||
func corruptSubDir(t *testing.T, dir string) {
|
||||
de, err := os.ReadDir(dir)
|
||||
require.NoError(t, err)
|
||||
|
||||
// FIXME(@cthulhu-rider): copy-paste of unexported const from blobstor package, see #1407
|
||||
const dirBlobovnicza = "blobovnicza"
|
||||
|
||||
for i := range de {
|
||||
if de[i].IsDir() {
|
||||
if de[i].IsDir() && de[i].Name() != dirBlobovnicza {
|
||||
require.NoError(t, os.Chmod(filepath.Join(dir, de[i].Name()), 0))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue