diff --git a/cmd/frostfs-node/config/cast_test.go b/cmd/frostfs-node/config/cast_test.go index ef48bdc5b5..f8c1ee28e7 100644 --- a/cmd/frostfs-node/config/cast_test.go +++ b/cmd/frostfs-node/config/cast_test.go @@ -125,10 +125,15 @@ func TestSizeInBytes(t *testing.T) { ) configtest.ForEachFileType("test/config", func(c *config.Config) { c = c.Sub("sizes") + require.EqualValues(t, 1, config.SizeInBytesSafe(c, "size_b")) + require.EqualValues(t, kb, config.SizeInBytesSafe(c, "size_k")) require.EqualValues(t, kb, config.SizeInBytesSafe(c, "size_kb")) require.EqualValues(t, 2*kb, config.SizeInBytesSafe(c, "size_kb_no_space")) + require.EqualValues(t, 12*mb, config.SizeInBytesSafe(c, "size_m")) require.EqualValues(t, 12*mb, config.SizeInBytesSafe(c, "size_mb")) + require.EqualValues(t, 4*gb, config.SizeInBytesSafe(c, "size_g")) require.EqualValues(t, 4*gb, config.SizeInBytesSafe(c, "size_gb")) + require.EqualValues(t, 5*tb, config.SizeInBytesSafe(c, "size_t")) require.EqualValues(t, 5*tb, config.SizeInBytesSafe(c, "size_tb")) require.EqualValues(t, 12, config.SizeInBytesSafe(c, "size_i_am_not_very_clever")) require.EqualValues(t, tb/2, config.SizeInBytesSafe(c, "size_float")) diff --git a/cmd/frostfs-node/config/test/config.json b/cmd/frostfs-node/config/test/config.json index 45635c7ab1..7eec1b73ee 100644 --- a/cmd/frostfs-node/config/test/config.json +++ b/cmd/frostfs-node/config/test/config.json @@ -49,10 +49,15 @@ }, "sizes": { + "size_b": "1b", + "size_k": "1 k", "size_kb": "1 kb", "size_kb_no_space": "2kb", - "size_mb": "12m", - "size_gb": "4g", + "size_m": "12m", + "size_mb": "12mb", + "size_g": "4g", + "size_gb": "4gb", + "size_t": "5 T", "size_tb": "5 TB", "size_float": ".5t", "size_float_big": "14.123 gb", diff --git a/cmd/frostfs-node/config/test/config.yaml b/cmd/frostfs-node/config/test/config.yaml index 102c045a1c..3ae459ea2d 100644 --- a/cmd/frostfs-node/config/test/config.yaml +++ b/cmd/frostfs-node/config/test/config.yaml @@ -42,10 +42,15 @@ bool: incorrect: not true sizes: + size_b: 1b + size_k: 1 k size_kb: 1 kb size_kb_no_space: 2kb - size_mb: 12m - size_gb: 4g + size_m: 12m + size_mb: 12mb + size_g: 4g + size_gb: 4gb + size_t: 5 T size_tb: 5 TB size_float: .5t size_float_big: 14.123 gb