Skip to content
Snippets Groups Projects
Commit c98d96a2 authored by Alexandr Lyapunov's avatar Alexandr Lyapunov
Browse files

added tests for hierarchical cfg: defaults and type checking

parent e01f7ca4
No related branches found
No related tags found
No related merge requests found
......@@ -89,4 +89,85 @@ box.cfg{coredump = 'true'}
- error: '[string "-- load_cfg.lua - internal file..."]:167: Error: cfg parameter
''coredump'' should be of type boolean'
...
--------------------------------------------------------------------------------
-- Test of hierarchical cfg type check
--------------------------------------------------------------------------------
box.cfg{slab_alloc_arena = "100500"}
---
- error: '[string "-- load_cfg.lua - internal file..."]:167: Error: cfg parameter
''slab_alloc_arena'' should be of type number'
...
box.cfg{sophia = "sophia"}
---
- error: '[string "-- load_cfg.lua - internal file..."]:161: Error: cfg parameter
''sophia'' should be a table'
...
box.cfg{sophia = {threads = "threads"}}
---
- error: '[string "-- load_cfg.lua - internal file..."]:167: Error: cfg parameter
''sophia.threads'' should be of type number'
...
--------------------------------------------------------------------------------
-- Test of default cfg options
--------------------------------------------------------------------------------
--# create server cfg_tester1 with script = "box/lua/cfg_test1.lua"
--# start server cfg_tester1
--# create connection cfg_tester_con to cfg_tester1
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
---
- 1
- 2
- 5
- 131072
...
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester1
--# cleanup server cfg_tester1
--# create server cfg_tester2 with script = "box/lua/cfg_test2.lua"
--# start server cfg_tester2
--# create connection cfg_tester_con to cfg_tester2
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
---
- 0.2
- 2
- 5
- 131072
...
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester2
--# cleanup server cfg_tester2
--# create server cfg_tester3 with script = "box/lua/cfg_test3.lua"
--# start server cfg_tester3
--# create connection cfg_tester_con to cfg_tester3
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
---
- 0.2
- 2
- 10
- 131072
...
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester3
--# cleanup server cfg_tester3
--# create server cfg_tester4 with script = "box/lua/cfg_test4.lua"
--# start server cfg_tester4
--# create connection cfg_tester_con to cfg_tester4
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
---
- 1
- 3.14
- 5
- 1234
...
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester4
--# cleanup server cfg_tester4
--# clear filter
......@@ -16,4 +16,58 @@ box.cfg{listen = {}}
box.cfg{wal_dir = 0}
box.cfg{coredump = 'true'}
--------------------------------------------------------------------------------
-- Test of hierarchical cfg type check
--------------------------------------------------------------------------------
box.cfg{slab_alloc_arena = "100500"}
box.cfg{sophia = "sophia"}
box.cfg{sophia = {threads = "threads"}}
--------------------------------------------------------------------------------
-- Test of default cfg options
--------------------------------------------------------------------------------
--# create server cfg_tester1 with script = "box/lua/cfg_test1.lua"
--# start server cfg_tester1
--# create connection cfg_tester_con to cfg_tester1
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester1
--# cleanup server cfg_tester1
--# create server cfg_tester2 with script = "box/lua/cfg_test2.lua"
--# start server cfg_tester2
--# create connection cfg_tester_con to cfg_tester2
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester2
--# cleanup server cfg_tester2
--# create server cfg_tester3 with script = "box/lua/cfg_test3.lua"
--# start server cfg_tester3
--# create connection cfg_tester_con to cfg_tester3
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester3
--# cleanup server cfg_tester3
--# create server cfg_tester4 with script = "box/lua/cfg_test4.lua"
--# start server cfg_tester4
--# create connection cfg_tester_con to cfg_tester4
--# set connection cfg_tester_con
box.cfg.slab_alloc_arena, box.cfg.slab_alloc_factor, box.cfg.sophia.threads, box.cfg.sophia.page_size
--# set connection default
--# drop connection cfg_tester_con
--# stop server cfg_tester4
--# cleanup server cfg_tester4
--# clear filter
#!/usr/bin/env tarantool
os = require('os')
box.cfg{
listen = os.getenv("LISTEN"),
}
require('console').listen(os.getenv('ADMIN'))
#!/usr/bin/env tarantool
os = require('os')
box.cfg{
listen = os.getenv("LISTEN"),
slab_alloc_arena = 0.2,
sophia = {},
}
require('console').listen(os.getenv('ADMIN'))
#!/usr/bin/env tarantool
os = require('os')
box.cfg{
listen = os.getenv("LISTEN"),
slab_alloc_arena = 0.2,
sophia = {threads = 10},
}
require('console').listen(os.getenv('ADMIN'))
#!/usr/bin/env tarantool
os = require('os')
box.cfg{
listen = os.getenv("LISTEN"),
slab_alloc_factor = 3.14,
sophia = {page_size = 1234},
}
require('console').listen(os.getenv('ADMIN'))
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