From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 0094137B8 for ; Wed, 4 May 2016 15:34:58 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id a17so94756120wme.0 for ; Wed, 04 May 2016 06:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=ZUtBMnh45y8ldgSdivCwoPwny658bjJEDl2tE0sVJBM=; b=ZTDA7JmK0EFpxiqLBvPu5BaUYzeYLAHKxUL4W2qwp5wx9EtuwGFDPjevgrmaBhlRrn tbsLQWh/nBxecTybCcx2MitcEjiw/DLyN468tMeKXxIOXOqGpZW2ZLIY7q8mW52kugFd ssHHGP6NL/IfbAICMfK/ZxUaNSa/J0LapeqjhJXxfaO5nnBhjCPUlliqCoGPtSJ9Jzvm Wkfh6mFy6w8Z4EpWPlStEwlpKV+gnPovJqIKNkt6oAjEx909bjL5+Oo8K/pJOR5+wKe2 VdE3epje5GHSrQ4yiUWqogGN/AJlNlnEHQwRCumWZQfALsRuIirfQaaVuHPXAQSNCo8p yuIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=ZUtBMnh45y8ldgSdivCwoPwny658bjJEDl2tE0sVJBM=; b=ZGBb46mI6jowRQPqphU5b37+fM6PKIq0NOcVtO8o1DKutml2du8hlswCai68bZ4xza ajSQ/M6hBdM+7CrBvOezDnFU3s7LRuJkyNcBSxlApdPDCPoxL2tGVGXdCaIk5RWRiFDB Vdsn0B/N/nrUJcNUq90fuJoIYFenS3+rh6rzrVBr4zegWH3kmyc7A9AY1YWtR5YRoj7D gudMfU4MoPl4ZL4JUPCb4cf6QiVtUwfiStY9QPZ8erOcCdHLEgF1Q70egCTkX95lm3r5 Vq2kIqrnW9c0tDmeG3JnScP8vylmnTWQdGfFgPBWREgvWopxSlLjMy/FtzMjPZs/1LrQ FRig== X-Gm-Message-State: AOPr4FVM6YcvCClAEXS1asHWUwZqpY6fAJ2ue1XfkclHzIRozrPyWRJEDFVPErL65HPbu2t+ X-Received: by 10.194.78.235 with SMTP id e11mr8553475wjx.54.1462368897784; Wed, 04 May 2016 06:34:57 -0700 (PDT) Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id hk7sm4296102wjb.5.2016.05.04.06.34.56 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2016 06:34:56 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Wed, 4 May 2016 15:34:50 +0200 Message-Id: <1462368890-17917-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 Subject: [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: Wed, 04 May 2016 13:34:58 -0000 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", ] 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"); /* 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"); /* 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"); rte_log_dump_history(stdout); -- 2.7.0