From 9adbd5c97f121952c8d512b7949250a305235daa Mon Sep 17 00:00:00 2001 From: Roman Tsisyk <roman@tsisyk.com> Date: Wed, 27 May 2015 12:36:30 +0300 Subject: [PATCH] Fix #539: Re-organize box.cfg{} tests Remove iditioc tests from the suite. --- test/app/boolean.result | 2 -- test/app/boolean.test.lua | 13 ------------- test/app/cfg.result | 6 +++++- test/app/cfg.test.lua | 13 ++++++++++++- test/app/float_value.result | 27 --------------------------- test/app/float_value.test.lua | 32 -------------------------------- 6 files changed, 17 insertions(+), 76 deletions(-) delete mode 100644 test/app/boolean.result delete mode 100755 test/app/boolean.test.lua delete mode 100644 test/app/float_value.result delete mode 100755 test/app/float_value.test.lua diff --git a/test/app/boolean.result b/test/app/boolean.result deleted file mode 100644 index bb101b641b..0000000000 --- a/test/app/boolean.result +++ /dev/null @@ -1,2 +0,0 @@ -true -true diff --git a/test/app/boolean.test.lua b/test/app/boolean.test.lua deleted file mode 100755 index 04a8f3811c..0000000000 --- a/test/app/boolean.test.lua +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env tarantool - --- --- Check that Tarantool creates configuration accepts boolean values --- -box.cfg{logger_nonblock=true, - panic_on_wal_error=true, - slab_alloc_arena=0.1, - logger="tarantool.log" -} -print(box.cfg.logger_nonblock) -print(box.cfg.panic_on_wal_error) -os.exit() diff --git a/test/app/cfg.result b/test/app/cfg.result index c7dec8e966..eefecfaaa4 100644 --- a/test/app/cfg.result +++ b/test/app/cfg.result @@ -1,5 +1,5 @@ TAP version 13 -1..29 +1..33 ok - box is not started ok - invalid replication_source ok - invalid wal_mode @@ -19,6 +19,8 @@ ok - panic_on_wal_mode default value ok - panic_on_wal_mode new value ok - wal_dir_rescan_delay default value ok - wal_dir_rescan_delay new value +ok - too_long_threshold default value +ok - too_long_threshold new value ok - wal_mode fsync ok - wal_mode fsync -> fsync ok - wal_mode fsync -> write is not supported @@ -27,5 +29,7 @@ ok - work_dir is invalid ok - sophia_dir is invalid ok - snap_dir is invalid ok - wal_dir is invalid +ok - logger_nonblock default value +ok - logger_nonblock new value ok - dynamic listen ok - dynamic listen diff --git a/test/app/cfg.test.lua b/test/app/cfg.test.lua index 7176f16520..c209271588 100755 --- a/test/app/cfg.test.lua +++ b/test/app/cfg.test.lua @@ -4,7 +4,7 @@ local tap = require('tap') local test = tap.test('cfg') local socket = require('socket') local fio = require('fio') -test:plan(29) +test:plan(33) -------------------------------------------------------------------------------- -- Invalid values @@ -76,6 +76,10 @@ test:is(box.cfg.wal_dir_rescan_delay, 0.1, "wal_dir_rescan_delay default value") box.cfg{wal_dir_rescan_delay=0.2} test:is(box.cfg.wal_dir_rescan_delay, 0.2, "wal_dir_rescan_delay new value") +test:is(box.cfg.too_long_threshold, 0.5, "too_long_threshold default value") +box.cfg{too_long_threshold=0.1} +test:is(box.cfg.too_long_threshold , 0.1, "too_long_threshold new value") + local tarantool_bin = arg[-1] local PANIC = 256 function run_script(code) @@ -119,6 +123,13 @@ test:is(run_script(code), PANIC, 'snap_dir is invalid') code = [[ box.cfg{ wal_dir='invalid' } ]] test:is(run_script(code), PANIC, 'wal_dir is invalid') +test:is(box.cfg.logger_nonblock, true, "logger_nonblock default value") +code = [[ +box.cfg{logger_nonblock = false } +os.exit(box.cfg.logger_nonblock == false and 0 or 1) +]] +test:is(run_script(code), 0, "logger_nonblock new value") + -- box.cfg { listen = xx } local path = './tarantool.sock' os.remove(path) diff --git a/test/app/float_value.result b/test/app/float_value.result deleted file mode 100644 index 4fd16c37bd..0000000000 --- a/test/app/float_value.result +++ /dev/null @@ -1,27 +0,0 @@ -box.cfg -1 snapshot_count:6 -2 pid_file:box.pid -3 slab_alloc_factor:1.1 -4 rows_per_wal:50 -5 background:false -6 logger:tarantool.log -7 slab_alloc_arena:0.1 -8 listen:3313 -9 logger_nonblock:true -10 snap_dir:. -11 coredump:false -12 slab_alloc_minimal:16 -13 sophia_dir:. -14 wal_mode:write -15 wal_dir:. -16 panic_on_snap_error:true -17 panic_on_wal_error:true -18 log_level:5 -19 readahead:16320 -20 slab_alloc_maximal:1048576 -21 too_long_threshold:0.01 -22 snapshot_period:0 -23 wal_dir_rescan_delay:0.1 ------------------------------------------------------- -Check that too_long_threshold = 0.01 -0.01 diff --git a/test/app/float_value.test.lua b/test/app/float_value.test.lua deleted file mode 100755 index 8ce550aa3b..0000000000 --- a/test/app/float_value.test.lua +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env tarantool --- --- Test floating points values (too_long_treshold) with fractional part --- -box.cfg{ - listen = 3313, - slab_alloc_arena = 0.1, - pid_file = "box.pid", - rows_per_wal = 50, - too_long_threshold = 0.01, - logger="tarantool.log" -} - -if box.space.space1 ~= nil then - box.space.space1:drop() -end -s = box.schema.space.create('space1') -s:create_index('primary', {type = 'hash', parts = {1, 'NUM'}}) - -t = {} -for k,v in pairs(box.cfg) do if type(v) ~= 'table' and type(v) ~= 'function' then table.insert(t,k..':'..tostring(v)) end end - -print('box.cfg') -for k,v in pairs(t) do print(k, v) end -print('------------------------------------------------------') -x = box.cfg.too_long_threshold -print('Check that too_long_threshold = 0.01') -print(x) -t = nil -s:drop() -os.exit() - -- GitLab