[#711] node/config/test: Adapt test to new config examples

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-07-22 16:10:51 +03:00 committed by Alex Vanin
parent da516c6754
commit 6638136d11

View file

@ -40,54 +40,54 @@ func TestEngineSection(t *testing.T) {
require.Equal(t, false, sc.UseWriteCache())
require.Equal(t, "tmp/0/cache", wc.Path())
require.EqualValues(t, 111, wc.MemSize())
require.EqualValues(t, 222, wc.MaxDBSize())
require.EqualValues(t, 333, wc.SmallObjectSize())
require.EqualValues(t, 444, wc.MaxObjectSize())
require.EqualValues(t, 555, wc.WorkersNumber())
require.EqualValues(t, 2147483648, wc.MemSize())
require.EqualValues(t, 2147483648, wc.MaxDBSize())
require.EqualValues(t, 16384, wc.SmallObjectSize())
require.EqualValues(t, 134217728, wc.MaxObjectSize())
require.EqualValues(t, 30, wc.WorkersNumber())
require.Equal(t, "tmp/0/meta", meta.Path())
require.Equal(t, fs.FileMode(0700), meta.Perm())
require.Equal(t, fs.FileMode(0644), meta.Perm())
require.Equal(t, "tmp/0/blob", blob.Path())
require.EqualValues(t, 0666, blob.Perm())
require.EqualValues(t, 5, blob.ShallowDepth())
require.EqualValues(t, 0644, blob.Perm())
require.Equal(t, true, blob.Compress())
require.EqualValues(t, 77, blob.SmallSizeLimit())
require.EqualValues(t, 5, blob.ShallowDepth())
require.EqualValues(t, 102400, blob.SmallSizeLimit())
require.EqualValues(t, 1024, blz.Size())
require.EqualValues(t, 10, blz.ShallowDepth())
require.EqualValues(t, 20, blz.ShallowWidth())
require.EqualValues(t, 88, blz.OpenedCacheSize())
require.EqualValues(t, 4194304, blz.Size())
require.EqualValues(t, 1, blz.ShallowDepth())
require.EqualValues(t, 4, blz.ShallowWidth())
require.EqualValues(t, 50, blz.OpenedCacheSize())
require.EqualValues(t, 123, gc.RemoverBatchSize())
require.Equal(t, 3*time.Hour, gc.RemoverSleepInterval())
require.EqualValues(t, 150, gc.RemoverBatchSize())
require.Equal(t, 2*time.Minute, gc.RemoverSleepInterval())
case 1:
require.Equal(t, true, sc.UseWriteCache())
require.Equal(t, "tmp/1/cache", wc.Path())
require.EqualValues(t, 112, wc.MemSize())
require.EqualValues(t, 223, wc.MaxDBSize())
require.EqualValues(t, 334, wc.SmallObjectSize())
require.EqualValues(t, 445, wc.MaxObjectSize())
require.EqualValues(t, 556, wc.WorkersNumber())
require.EqualValues(t, 2147483648, wc.MemSize())
require.EqualValues(t, 2147483648, wc.MaxDBSize())
require.EqualValues(t, 16384, wc.SmallObjectSize())
require.EqualValues(t, 134217728, wc.MaxObjectSize())
require.EqualValues(t, 30, wc.WorkersNumber())
require.Equal(t, "tmp/1/meta", meta.Path())
require.Equal(t, fs.FileMode(0701), meta.Perm())
require.Equal(t, fs.FileMode(0644), meta.Perm())
require.Equal(t, "tmp/1/blob", blob.Path())
require.EqualValues(t, 0667, blob.Perm())
require.EqualValues(t, 6, blob.ShallowDepth())
require.EqualValues(t, 0644, blob.Perm())
require.Equal(t, false, blob.Compress())
require.EqualValues(t, 78, blob.SmallSizeLimit())
require.EqualValues(t, 5, blob.ShallowDepth())
require.EqualValues(t, 102400, blob.SmallSizeLimit())
require.EqualValues(t, 1025, blz.Size())
require.EqualValues(t, 11, blz.ShallowDepth())
require.EqualValues(t, 21, blz.ShallowWidth())
require.EqualValues(t, 89, blz.OpenedCacheSize())
require.EqualValues(t, 4194304, blz.Size())
require.EqualValues(t, 1, blz.ShallowDepth())
require.EqualValues(t, 4, blz.ShallowWidth())
require.EqualValues(t, 50, blz.OpenedCacheSize())
require.EqualValues(t, 124, gc.RemoverBatchSize())
require.Equal(t, 3*time.Hour+time.Second, gc.RemoverSleepInterval())
require.EqualValues(t, 200, gc.RemoverBatchSize())
require.Equal(t, 5*time.Minute, gc.RemoverSleepInterval())
}
})