[Tarantool-patches] [PATCH v8 12/12] test: logger -- consider more cases

Cyrill Gorcunov gorcunov at gmail.com
Wed Jun 3 01:18:17 MSK 2020


Part-of #689

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 test/app-tap/logger.test.lua | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/test/app-tap/logger.test.lua b/test/app-tap/logger.test.lua
index 48dc8af3e..6ad15724e 100755
--- a/test/app-tap/logger.test.lua
+++ b/test/app-tap/logger.test.lua
@@ -1,7 +1,7 @@
 #!/usr/bin/env tarantool
 
 local test = require('tap').test('log')
-test:plan(44)
+test:plan(49)
 
 -- gh-3946: Assertion failure when using log_format() before box.cfg()
 local log = require('log')
@@ -46,6 +46,19 @@ test:is(line:sub(-m:len()), m, m)
 _, err = pcall(log.cfg, {format = 'unknown'})
 test:ok(err:find("log: \'format\' must be json,plain") ~= nil)
 
+-- Test static arguments
+_, err = pcall(box.cfg, {log = "newname"})
+test:ok(err:find("log: \'log\' can\'t be set dynamically") ~= nil)
+
+_, err = pcall(box.cfg, {log_nonblock = true})
+test:ok(err:find("log: \'log_nonblock\' can\'t be set dynamically") ~= nil)
+
+_, err = pcall(log.cfg, {nonblock = true})
+test:ok(err:find("log: \'nonblock\' can\'t be set dynamically") ~= nil)
+
+_, err = pcall(log.cfg, {log = "newname"})
+test:ok(err:find("log: \'log\' can\'t be set dynamically") ~= nil)
+
 -- Test that changes in log module are propagated
 -- back to the box module correctly
 box.cfg{
@@ -59,6 +72,7 @@ test:is(box.cfg.log_level, 6, 'box level 6')
 log.cfg({format='plain', level=5})
 test:is(box.cfg.log_format, 'plain', 'box sees plain format')
 test:is(box.cfg.log_level, 5, 'box sees level change')
+test:ok(log.cfg.log == filename and box.cfg.log == filename, 'filename match')
 
 -- Test symbolic names for loglevels
 log.cfg({level='fatal'})
-- 
2.26.2



More information about the Tarantool-patches mailing list