As we have more daemons with OVN that can be tested using ovs autotest
framework, it is convenient to extend check_logs() to check the log files
of all daemons.

Signed-off-by: Alex Wang <al...@nicira.com>

---
V2->V3:
- adopt Ben's suggestion to check for all '*.log's except testsuite.log.
- rebase to master.

PATCH->V2:
- make check_logs() check all daemons' log files.
---
 tests/ofproto-macros.at |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 74b02b7..53ed38b 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -115,8 +115,18 @@ m4_define([OVS_VSWITCHD_START],
    AT_CHECK([ovs-vsctl -- add-br br0 -- set bridge br0 datapath-type=dummy 
other-config:datapath-id=fedcba9876543210 other-config:hwaddr=aa:55:aa:55:00:00 
protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15]] 
fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], 
[0], [$2])
 ])
 
+# check_logs scans through log file of each daemon and report all WARN,
+# ERR, EMER log entries.  User can add custom sed filters in $1.
 m4_divert_push([PREPARE_TESTS])
 check_logs () {
+    local logs
+    for log in *.log; do
+        case $log in # (
+            '*.log'|testsuite.log) ;; # (
+            *) logs="$logs $log" ;;
+        esac
+    done
+
     sed -n "$1
 /timeval.*Unreasonably long [[0-9]]*ms poll interval/d
 /timeval.*faults: [[0-9]]* minor, [[0-9]]* major/d
@@ -125,7 +135,7 @@ check_logs () {
 /ovs_rcu.*blocked [[0-9]]* ms waiting for .* to quiesce/d
 /|WARN|/p
 /|ERR|/p
-/|EMER|/p" ovs-vswitchd.log ovsdb-server.log
+/|EMER|/p" ${logs}
 }
 m4_divert_pop([PREPARE_TESTS])
 
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to