From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E72B8469710 for ; Wed, 3 Jun 2020 01:20:40 +0300 (MSK) Received: by mail-lj1-f196.google.com with SMTP id c17so183205lji.11 for ; Tue, 02 Jun 2020 15:20:40 -0700 (PDT) From: Cyrill Gorcunov Date: Wed, 3 Jun 2020 01:18:17 +0300 Message-Id: <20200602221817.645015-13-gorcunov@gmail.com> In-Reply-To: <20200602221817.645015-1-gorcunov@gmail.com> References: <20200602221817.645015-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v8 12/12] test: logger -- consider more cases List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Part-of #689 Signed-off-by: Cyrill Gorcunov --- 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