From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 4BA705AB6 for ; Tue, 17 May 2016 08:54:55 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id g17so19017193wme.0 for ; Mon, 16 May 2016 23:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oKLIFzHcQN2kLuvzqBgJ7jHjoHjf20VS92fo1CrNiDA=; b=aO61j+otkxv2CpwNtxYj/G0DMF92Hg7BZ8ahEcZUqiRcrNU0U3HoD1eGIVZMiAVSyi Xnjsf3Py4TNWsilPjMerXE+aJdLp2frmeFfz4F+fw2CB+OQNrz0RKlcTL3yGSapf/Xcr 7lNgWihyAZNSJMtO4ZpKQyefaci2L+bw2gtpetrrmqtwM0VN10Pw401bz1qy3cqq7L+X qq6wYT1wZJnx2JkKKceUMNV1OgWwKG4Gb6vSmihF4/rqnP34pj/ke1qIG04Q/KzF64xx hyHoYSj0gjkyB2uz41cGcHRYVnDdL6fQ5yUXjSJz9qMAia5euBE+BNDcSlHf3T0Jtv47 OEFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oKLIFzHcQN2kLuvzqBgJ7jHjoHjf20VS92fo1CrNiDA=; b=ezO81utxHAqCbP6JyZUKbjTKX3CmpUsxD9lFzSA+Qi0Do2AwtfSctpX9flIXrd3ejg ul19QomAhZMSXc9cMCqA+W66+T8x4hIuCa/3y1P6oQBkxpoQJ7JZYLFMPmBgbb3uxCQa lV2D6Wo4zto+vOG1HFy/oaOkjA5PxR7DAPiF70XD9oG4sZfmP9pmCeKIkuvyzVxDZK1X Qr8YG+ZtFy6B1wssOP2fp38L90Ohjflea86A8FGtJX0dRTY55nzVcd+c31yZW1ZpyYQD BaybddeU6k9VIDKNHITfJEejucbon2FGzgU8Mu9TXfuPZn3qKpMQMTc6xibfJbRmgp2a Ieug== X-Gm-Message-State: AOPr4FWYPpRt4CrwP2Q8y1xKW8nPVz3LS5hY2W/c/HOHAxqt7Jlfb+27IikZt7PBUvLuZHD9R0qgrC88g9OndbRh X-Received: by 10.194.123.67 with SMTP id ly3mr33490174wjb.135.1463468095030; Mon, 16 May 2016 23:54:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.16.2 with HTTP; Mon, 16 May 2016 23:54:35 -0700 (PDT) In-Reply-To: <1462368890-17917-1-git-send-email-thomas.monjalon@6wind.com> References: <1462368890-17917-1-git-send-email-thomas.monjalon@6wind.com> From: David Marchand Date: Tue, 17 May 2016 08:54:35 +0200 Message-ID: To: Thomas Monjalon Cc: "dev@dpdk.org" Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH] app/test: fix log check when default level is high X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 06:54:55 -0000 Hello Thomas, On Wed, May 4, 2016 at 3:34 PM, Thomas Monjalon wrote: > The log unit test was checking display of low priority messages. > It was not working if RTE_LOG_LEVEL is not RTE_LOG_DEBUG. > It is even easier to see since the default level is INFO (9b9d7ca). > > Now the test use ERR and CRIT levels which should be always enabled > while not trigerring syslog output on the console. > > Signed-off-by: Thomas Monjalon > --- > app/test/autotest_test_funcs.py | 20 ++++++++------------ > app/test/test_logs.c | 20 +++++++++----------- > 2 files changed, 17 insertions(+), 23 deletions(-) > > diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py > index 0f012f6..f04909d 100644 > --- a/app/test/autotest_test_funcs.py > +++ b/app/test/autotest_test_funcs.py > @@ -145,18 +145,14 @@ def logs_autotest(child, test_name): > child.sendline(test_name) > > log_list = [ > - "TESTAPP1: this is a debug level message", > - "TESTAPP1: this is a info level message", > - "TESTAPP1: this is a warning level message", > - "TESTAPP2: this is a info level message", > - "TESTAPP2: this is a warning level message", > - "TESTAPP1: this is a debug level message", > - "TESTAPP1: this is a debug level message", > - "TESTAPP1: this is a info level message", > - "TESTAPP1: this is a warning level message", > - "TESTAPP2: this is a info level message", > - "TESTAPP2: this is a warning level message", > - "TESTAPP1: this is a debug level message", > + "TESTAPP1: error message", > + "TESTAPP1: critical message", > + "TESTAPP2: critical message", > + "TESTAPP1: error message", > + "TESTAPP1: error message", > + "TESTAPP1: critical message", > + "TESTAPP2: critical message", > + "TESTAPP1: error message", Since this list is tighly coupled to test_logs.c, a little comment on why the messages are declared twice in this list would help. > ] > > for log_msg in log_list: > diff --git a/app/test/test_logs.c b/app/test/test_logs.c > index 18a3b6a..861cdff 100644 > --- a/app/test/test_logs.c > +++ b/app/test/test_logs.c > @@ -66,24 +66,22 @@ test_logs(void) > rte_set_log_type(RTE_LOGTYPE_TESTAPP2, 1); > > /* log in debug level */ > - rte_set_log_level(RTE_LOG_DEBUG); > - RTE_LOG(DEBUG, TESTAPP1, "this is a debug level message\n"); > - RTE_LOG(INFO, TESTAPP1, "this is a info level message\n"); > - RTE_LOG(WARNING, TESTAPP1, "this is a warning level message\n"); > + rte_set_log_level(RTE_LOG_ERR); > + RTE_LOG(ERR, TESTAPP1, "error message\n"); > + RTE_LOG(CRIT, TESTAPP1, "critical message\n"); Comment is wrong, should be about error level. > > /* log in info level */ > - rte_set_log_level(RTE_LOG_INFO); > - RTE_LOG(DEBUG, TESTAPP2, "debug level message (not displayed)\n"); > - RTE_LOG(INFO, TESTAPP2, "this is a info level message\n"); > - RTE_LOG(WARNING, TESTAPP2, "this is a warning level message\n"); > + rte_set_log_level(RTE_LOG_CRIT); > + RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n"); > + RTE_LOG(CRIT, TESTAPP2, "critical message\n"); Idem. > > /* disable one log type */ > rte_set_log_type(RTE_LOGTYPE_TESTAPP2, 0); > > /* log in debug level */ > - rte_set_log_level(RTE_LOG_DEBUG); > - RTE_LOG(DEBUG, TESTAPP1, "this is a debug level message\n"); > - RTE_LOG(DEBUG, TESTAPP2, "debug level message (not displayed)\n"); > + rte_set_log_level(RTE_LOG_ERR); > + RTE_LOG(ERR, TESTAPP1, "error message\n"); > + RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n"); Idem. -- David Marchand