Skip to content
Snippets Groups Projects
Commit b2ee33bd authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

gh-1419: add checks in box.cfg{} for slab_alloc_minimal, add a test case

parent 40eab2ef
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,15 @@ box_check_writable(void)
tnt_raise(LoggedError, ER_READONLY);
}
static void
box_check_slab_alloc_minimal(ssize_t slab_alloc_minimal)
{
if (slab_alloc_minimal < 8 || slab_alloc_minimal > 1048280)
tnt_raise(ClientError, ER_CFG, "slab_alloc_minimal",
"specified value is out of bounds");
}
void
process_rw(struct request *request, struct tuple **result)
{
......@@ -297,6 +306,7 @@ box_check_config()
box_check_readahead(cfg_geti("readahead"));
box_check_rows_per_wal(cfg_geti64("rows_per_wal"));
box_check_wal_mode(cfg_gets("wal_mode"));
box_check_slab_alloc_minimal(cfg_geti64("slab_alloc_minimal"));
}
/*
......
TAP version 13
1..41
1..46
ok - box is not started
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid slab_alloc_minimal
ok - invalid replication_source
ok - invalid wal_mode
ok - invalid rows_per_wal
......
......@@ -4,7 +4,7 @@ local tap = require('tap')
local test = tap.test('cfg')
local socket = require('socket')
local fio = require('fio')
test:plan(41)
test:plan(46)
--------------------------------------------------------------------------------
-- Invalid values
......@@ -17,6 +17,11 @@ local function invalid(name, val)
test:ok(not status and result:match('Incorrect'), 'invalid '..name)
end
invalid('slab_alloc_minimal', 7)
invalid('slab_alloc_minimal', 0)
invalid('slab_alloc_minimal', -1)
invalid('slab_alloc_minimal', 1048281)
invalid('slab_alloc_minimal', 1000000000)
invalid('replication_source', '//guest@localhost:3301')
invalid('wal_mode', 'invalid')
invalid('rows_per_wal', -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment