diff mbox series

[ovs-dev,04/16] tests: Improve logging in test framework.

Message ID 20201030002447.936548-4-blp@ovn.org
State Accepted
Headers show
Series [ovs-dev,01/16] tests: Drop support for glibc before version 2.11. | expand

Commit Message

Ben Pfaff Oct. 30, 2020, 12:24 a.m. UTC
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 tests/ofproto-macros.at |  5 ++++-
 tests/ovn-macros.at     | 16 ++++++++++++++--
 tests/ovn.at            | 10 +++++-----
 3 files changed, 23 insertions(+), 8 deletions(-)

Comments

0-day Robot Oct. 30, 2020, 1:07 a.m. UTC | #1
Bleep bloop.  Greetings Ben Pfaff, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


git-am:
error: sha1 information is lacking or useless (tests/ovn.at).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 tests: Improve logging in test framework.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 6c4ff60e7db5..a6e89a951347 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -54,7 +54,9 @@  m4_define([PARSE_LISTENING_PORT],
     [OVS_WAIT_UNTIL([$2=`sed -n 's/.*0:.*: listening on port \([[0-9]]*\)$/\1/p' "$1"` && test X != X"[$]$2"])])
 
 start_daemon () {
-    "$@" -vconsole:off --detach --no-chdir --pidfile --log-file
+    set "$@" -vconsole:off --detach --no-chdir --pidfile --log-file
+    echo "$@"
+    "$@"
     pidfile="$OVS_RUNDIR"/$1.pid
     on_exit "test -e \"$pidfile\" && kill \`cat \"$pidfile\"\`"
 }
@@ -99,6 +101,7 @@  sim_add () {
 
    # Start ovs-vswitchd
    as $1 start_daemon ovs-vswitchd --enable-dummy=system -vvconn -vofproto_dpif -vunixctl
+   as $1 ovs-appctl vlog/disable-rate-limit vconn
 }
 
 # "as $1" sets the OVS_*DIR environment variables to point to $ovs_base/$1.
diff --git a/tests/ovn-macros.at b/tests/ovn-macros.at
index be596caf33d0..5b9c2dee6812 100644
--- a/tests/ovn-macros.at
+++ b/tests/ovn-macros.at
@@ -3,6 +3,8 @@ 
 # Gracefully terminate vswitch daemons in the
 # specified sandbox.
 m4_define([OVN_CLEANUP_VSWITCH],[
+    echo
+    echo "$1: clean up vswitch"
     as $1
     OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
     OVS_APP_EXIT_AND_WAIT([ovsdb-server])
@@ -15,6 +17,8 @@  m4_define([OVN_CLEANUP_VSWITCH],[
 # as a special case, and is assumed to have ovn-controller-vtep
 # and ovs-vtep daemons running instead of ovn-controller.
 m4_define([OVN_CLEANUP_SBOX],[
+    echo
+    echo "$1: clean up sandbox"
     as $1
     if test "$1" = "vtep"; then
         OVS_APP_EXIT_AND_WAIT([ovn-controller-vtep])
@@ -33,6 +37,9 @@  m4_define([OVN_CLEANUP],[
     m4_foreach([sbox], [$@], [
         OVN_CLEANUP_SBOX([sbox])
     ])
+
+    echo
+    echo "clean up OVN"
     as ovn-sb
     OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
@@ -53,6 +60,8 @@  m4_define([OVN_CLEANUP],[
 # Gracefully terminate all OVN daemons, including those in the
 # specified sandbox instances.
 m4_define([OVN_CLEANUP_AZ],[
+    echo
+    echo "$1: clean up availability zone"
     as $1/ovn-sb
     OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
@@ -77,6 +86,9 @@  m4_define([OVN_CLEANUP_IC],[
     m4_foreach([az], [$@], [
         OVN_CLEANUP_AZ([az])
     ])
+
+    echo
+    echo "clean up interconnection"
     as ovn-ic-sb
     OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 
@@ -99,7 +111,7 @@  m4_divert_push([PREPARE_TESTS])
 #
 # Usually invoked from ovn_start.
 ovn_init_db () {
-    echo "creating $1 database"
+    echo "${AZ:+$AZ: }creating $1 database"
     local as_d=$1
     if test -n "$2"; then
         as_d=$2/$as_d
@@ -108,7 +120,7 @@  ovn_init_db () {
     mkdir "$d" || return 1
     : > "$d"/.$1.db.~lock~
     as $as_d ovsdb-tool create "$d"/$1.db "$abs_top_srcdir"/$1.ovsschema
-    as $as_d start_daemon ovsdb-server --remote=punix:"$d"/$1.sock "$d"/$1.db
+    as $as_d start_daemon ovsdb-server -vjsonrpc --remote=punix:"$d"/$1.sock "$d"/$1.db
     local var=`echo $1_db | tr a-z- A-Z_`
     AS_VAR_SET([$var], [unix:"$d"/$1.sock]); export $var
 }
diff --git a/tests/ovn.at b/tests/ovn.at
index 912f84c25dbb..93436de4f027 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -12,7 +12,7 @@ 
 m4_divert_text([PREPARE_TESTS],
   [ovn_check_packets__ () {
      echo
-     echo "checking packets in $1 against $2:"
+     echo "$3: checking packets in $1 against $2:"
      rcv_pcap=$1
      rcv_text=`echo "$rcv_pcap.packets" | sed 's/\.pcap//'`
      exp_text=$2
@@ -25,7 +25,7 @@  m4_divert_text([PREPARE_TESTS],
      sort $exp_text > expout
    }
    ovn_check_packets_remove_broadcast__ () {
-     echo "checking packets in $1 against $2:"
+     echo "$3: checking packets in $1 against $2:"
      rcv_pcap=$1
      rcv_text=`echo "$rcv_pcap.packets" | sed 's/\.pcap//'`
      exp_text=$2
@@ -41,15 +41,15 @@  m4_divert_text([PREPARE_TESTS],
 ])
 
 m4_define([OVN_CHECK_PACKETS],
-  [ovn_check_packets__ "$1" "$2"
+  [ovn_check_packets__ "$1" "$2" "__file__:__line__"
    AT_CHECK([sort $rcv_text], [0], [expout])])
 
 m4_define([OVN_CHECK_PACKETS_REMOVE_BROADCAST],
-  [ovn_check_packets_remove_broadcast__ "$1" "$2"
+  [ovn_check_packets_remove_broadcast__ "$1" "$2" "__file__:__line__"
    AT_CHECK([sort $rcv_text], [0], [expout])])
 
 m4_define([OVN_CHECK_PACKETS_CONTAIN],
-  [ovn_check_packets__ "$1" "$2"
+  [ovn_check_packets__ "$1" "$2" "__file__:__line__"
    AT_CHECK([sort $rcv_text | comm --nocheck-order -2 -3 expout -], [0], [])])
 
 AT_BANNER([OVN components])