diff options
author | Ben Pfaff <blp@ovn.org> | 2018-08-06 14:36:34 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-08-17 17:43:52 -0700 |
commit | d97af4288d60329a4637b88fdf69de41c500bb45 (patch) | |
tree | 04e6124ec44fe3242fe78f5ebe9e43ba7b49bcf0 /tests | |
parent | 11f8e96601bc31353153a16fef53b447dc687599 (diff) | |
download | openvswitch-d97af4288d60329a4637b88fdf69de41c500bb45.tar.gz |
ovsdb-client: Make "wait" command logging more sensible.
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 <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ovsdb-cluster.at | 6 | ||||
-rw-r--r-- | tests/ovsdb-server.at | 2 | ||||
-rw-r--r-- | tests/ovsdb-tool.at | 2 | ||||
-rw-r--r-- | tests/ovsdb.at | 6 |
4 files changed, 11 insertions, 5 deletions
diff --git a/tests/ovsdb-cluster.at b/tests/ovsdb-cluster.at index 01650df4c..acc5cdde8 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 edffae1bc..add815c71 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 359d1f063..69c5d6afa 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 afe0a54a4..0c9856d01 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]) |