From patchwork Mon Aug 6 21:36:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 954248 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41krZR1cwFz9ryt for ; Tue, 7 Aug 2018 07:36:47 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A5934DB1; Mon, 6 Aug 2018 21:36:45 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 740E6904 for ; Mon, 6 Aug 2018 21:36:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7521D63D for ; Mon, 6 Aug 2018 21:36:43 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 100B51BF207; Mon, 6 Aug 2018 21:36:39 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Mon, 6 Aug 2018 14:36:34 -0700 Message-Id: <20180806213634.19565-1-blp@ovn.org> X-Mailer: git-send-email 2.16.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH] ovsdb-client: Make "wait" command logging more sensible. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org The "wait" command in ovsdb-client (which was introduced as part of the clustering support) fairly often logs things that are normal for it but in other circumstances might be cause for concern, for example messages about being unable to connect to a remote. Until now, it has tried to suppress some of those itself by raising log levels. Unfortunately, in some cases this had the opposite effect because it overrode any settings on the command line, such as an attempt in ovsdb-cluster.at to suppress all logging related to the timeval module. This commit drops the special log levels from the "wait" command and puts equivalents into the tests themselves. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- ovsdb/ovsdb-client.c | 4 ---- tests/ovsdb-cluster.at | 6 +++--- tests/ovsdb-server.at | 2 +- tests/ovsdb-tool.at | 2 +- tests/ovsdb.at | 6 ++++++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index cdb021f391ac..288732bd85f1 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -2328,10 +2328,6 @@ do_wait(struct jsonrpc *rpc_unused OVS_UNUSED, const char *database_unused OVS_UNUSED, int argc, char *argv[]) { - vlog_set_levels(NULL, VLF_CONSOLE, VLL_WARN); - vlog_set_levels_from_string_assert("reconnect:err"); - vlog_set_levels_from_string_assert("jsonrpc:err"); - const char *database = argv[argc - 2]; const char *state = argv[argc - 1]; diff --git a/tests/ovsdb-cluster.at b/tests/ovsdb-cluster.at index 01650df4c531..acc5cdde8b09 100644 --- a/tests/ovsdb-cluster.at +++ b/tests/ovsdb-cluster.at @@ -18,7 +18,7 @@ ovsdb_check_cluster () { AT_CHECK([ovsdb-server -vraft -vconsole:off -vsyslog:off --detach --no-chdir --log-file=s$i.log --pidfile=s$i.pid --unixctl=s$i --remote=punix:s$i.ovsdb s$i.db]) done for i in `seq $n`; do - AT_CHECK([ovsdb-client --timeout=30 wait unix:s$i.ovsdb $schema connected]) + AT_CHECK([ovsdb_client_wait unix:s$i.ovsdb $schema connected]) done for txn @@ -100,14 +100,14 @@ ovsdb|WARN|schema: changed 2 columns in 'OVN_Southbound' database from ephemeral connect_server() { local i=$1 printf "\ns$i: waiting to connect to storage\n" - AT_CHECK([ovsdb-client --timeout=30 -vtimeval:off -vfile -vsyslog:off -vvlog:off --log-file=connect$i.log wait unix:s$i.ovsdb $schema connected]) + AT_CHECK([ovsdb_client_wait --log-file=connect$i.log unix:s$i.ovsdb $schema connected]) } remove_server() { local i=$1 printf "\ns$i: removing from cluster\n" AT_CHECK([ovs-appctl --timeout=30 -t "`pwd`"/s$i cluster/leave OVN_Southbound]) printf "\ns$i: waiting for removal to complete\n" - AT_CHECK([ovsdb-client --timeout=30 -vtimeval:off -vfile -vsyslog:off -vvlog:off --log-file=remove$i.log wait unix:s$i.ovsdb $schema removed]) + AT_CHECK([ovsdb_client_wait --log-file=remove$i.log unix:s$i.ovsdb $schema removed]) stop_server $i } add_server() { diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index edffae1bc075..add815c71f1f 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -668,7 +668,7 @@ ovsdb_check_online_compaction() { fi]) dnl Start ovsdb-server. AT_CHECK([ovsdb-server -vvlog:off -vconsole:off --detach --no-chdir --pidfile --remote=punix:socket --log-file db], [0]) - AT_CHECK([ovsdb-client wait unix:socket ordinals connected]) + AT_CHECK([ovsdb_client_wait unix:socket ordinals connected]) AT_CAPTURE_FILE([ovsdb-server.log]) dnl Do a bunch of random transactions that put crap in the database log. AT_CHECK( diff --git a/tests/ovsdb-tool.at b/tests/ovsdb-tool.at index 359d1f063ee1..69c5d6afa801 100644 --- a/tests/ovsdb-tool.at +++ b/tests/ovsdb-tool.at @@ -452,7 +452,7 @@ ovsdb-tool create-cluster db2 db1 unix:s1.raft # Dump the data. AT_CHECK([ovsdb-server -vconsole:off -vfile -vvlog:off --detach --no-chdir --pidfile --log-file --remote=punix:db.sock db2]) -AT_CHECK([ovsdb-client wait ordinals connected]) +AT_CHECK([ovsdb_client_wait ordinals connected]) AT_CHECK([ovsdb-client dump > dump2]) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) diff --git a/tests/ovsdb.at b/tests/ovsdb.at index afe0a54a4380..0c9856d016cc 100644 --- a/tests/ovsdb.at +++ b/tests/ovsdb.at @@ -129,6 +129,12 @@ m4_define([OVSDB_CHECK_NEGATIVE_CPY], OVSDB_CHECK_NEGATIVE_PY([$1 - Python2], [$2], [$3], [$4], [$5]) OVSDB_CHECK_NEGATIVE_PY3([$1 - Python3], [$2], [$3], [$4], [$5])]) +OVS_START_SHELL_HELPERS +ovsdb_client_wait() { + ovsdb-client -vconsole:warn -vreconnect:err -vjsonrpc:err -vtimeval:off -vfile -vsyslog:off -vvlog:off --timeout=30 wait "$@" +} +OVS_END_SHELL_HELPERS + m4_include([tests/ovsdb-log.at]) m4_include([tests/ovsdb-types.at]) m4_include([tests/ovsdb-data.at])