[ovs-dev] [ovn-controller-vtep V2 1/6] ofproto-macros.at: Make check_logs() check all daemons' log files.
Alex Wang
alexw at nicira.com
Sun Jul 5 05:38:34 UTC 2015
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 <alexw at nicira.com>
---
PATCH->V2:
- make check_logs() check all daemons' log files.
---
tests/ofproto-macros.at | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 74b02b7..a2fc22a 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -115,8 +115,19 @@ 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 daemons=$(ls *.pid | sed 's/\.pid//g')
+ local daemon daemon_logs
+
+ for daemon in ${daemons}; do
+ if [[ -f "${daemon}.log" ]]; then
+ daemon_logs="${daemon_logs} ${daemon}.log"
+ fi
+ done
+
sed -n "$1
/timeval.*Unreasonably long [[0-9]]*ms poll interval/d
/timeval.*faults: [[0-9]]* minor, [[0-9]]* major/d
@@ -125,7 +136,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" ${daemon_logs}
}
m4_divert_pop([PREPARE_TESTS])
--
1.7.9.5
More information about the dev
mailing list