Skip to content
Snippets Groups Projects
Commit 642ad8da authored by Mergen Imeev's avatar Mergen Imeev Committed by Alexander Turenko
Browse files

config: process section for instance config

This section describes the instance process configuration.

Part of #8778

NO_DOC=will be added later
NO_CHANGELOG=will be added later
parent dac1dbc9
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,50 @@ return schema.new('instance_config', schema.record({
default = 'auto',
}),
}),
process = schema.record({
strip_core = schema.scalar({
type = 'boolean',
box_cfg = 'strip_core',
box_cfg_nondynamic = true,
default = true,
}),
coredump = schema.scalar({
type = 'boolean',
box_cfg = 'coredump',
box_cfg_nondynamic = true,
default = false,
}),
background = schema.scalar({
type = 'boolean',
box_cfg = 'background',
box_cfg_nondynamic = true,
default = false,
}),
title = schema.scalar({
type = 'string',
box_cfg = 'custom_proc_title',
default = 'tarantool - {{ instance_name }}',
}),
username = schema.scalar({
type = 'string',
box_cfg = 'username',
box_cfg_nondynamic = true,
default = box.NULL,
}),
work_dir = schema.scalar({
type = 'string',
box_cfg = 'work_dir',
box_cfg_nondynamic = true,
default = box.NULL,
}),
pid_file = schema.scalar({
type = 'string',
box_cfg = 'pid_file',
box_cfg_nondynamic = true,
mk_parent_dir = true,
default = '{{ instance_name }}.pid',
}),
}),
}, {
-- Any configuration data should contain a version of the
-- config schema for which it is written.
......
......@@ -52,3 +52,31 @@ g.test_config = function()
local res = instance_config:apply_default({}).config
t.assert_equals(res, exp)
end
g.test_process = function()
local iconfig = {
process = {
strip_core = true,
coredump = true,
background = true,
title = 'one',
username = 'two',
work_dir = 'three',
pid_file = 'four',
},
}
instance_config:validate(iconfig)
validate_fields(iconfig.process, instance_config.schema.fields.process)
local exp = {
strip_core = true,
coredump = false,
background = false,
title = 'tarantool - {{ instance_name }}',
username = box.NULL,
work_dir = box.NULL,
pid_file = '{{ instance_name }}.pid',
}
local res = instance_config:apply_default({}).process
t.assert_equals(res, exp)
end
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