* [PATCH] common/rc: insert a line to dmesg on intentional WARNINGs
@ 2017-10-31 8:29 Eryu Guan
0 siblings, 0 replies; only message in thread
From: Eryu Guan @ 2017-10-31 8:29 UTC (permalink / raw)
To: fstests; +Cc: Fengguang Wu, Eryu Guan
We already filtered out intentional WARNINGs from dmesg in
_check_dmesg(), but 3rd party dmesg parsers, e.g. LKP 0day test
robot, don't know that it's not a test failure in such cases.
So per Fengguang's request, insert a message to dmesg to indicate
that the WARNINGs in this test are intentional, external dmesg
parsers could take proper actions based on this message.
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
common/rc | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/common/rc b/common/rc
index e2a8229f08bc..80fb47c74028 100644
--- a/common/rc
+++ b/common/rc
@@ -3295,12 +3295,21 @@ _check_dmesg()
# default filter is a simple cat command, caller could provide a
# customized filter and pass the name through the first argument, to
# filter out intentional WARNINGs or Oopses
- filter=${1:-cat}
+ local filter=${1:-cat}
+ local changed=false
# search the dmesg log of last run of $seqnum for possible failures
# use sed \cregexpc address type, since $seqnum contains "/"
dmesg | tac | sed -ne "0,\#run fstests $seqnum at $date_time#p" | \
- tac | $filter >$seqres.dmesg
+ tac >$seqres.dmesg.orig
+
+ # check if $filter filtered out intentional warnings
+ cat $seqres.dmesg.orig | $filter > $seqres.dmesg
+ if ! diff $seqres.dmesg.orig $seqres.dmesg >/dev/null 2>&1; then
+ changed=true
+ fi
+ rm -f $seqres.dmesg.orig
+
egrep -q -e "kernel BUG at" \
-e "WARNING:" \
-e "BUG:" \
@@ -3311,13 +3320,20 @@ _check_dmesg()
-e "INFO: possible circular locking dependency detected" \
-e "general protection fault:" \
$seqres.dmesg
+
if [ $? -eq 0 ]; then
_dump_err "_check_dmesg: something found in dmesg (see $seqres.dmesg)"
return 1
- else
- rm -f $seqres.dmesg
- return 0
fi
+
+ # test passed dmesg check, then insert a PLEASE IGNORE message to dmesg
+ # if $changed is true, to let 3rd party dmesg parser, e.g. 0day test
+ # robot, know that it's not a test failure
+ if $changed; then
+ echo "fstests $seqnum: INTENTIONAL WARNINGS, PLEASE IGNORE" > /dev/kmsg
+ fi
+ rm -f $seqres.dmesg
+ return 0
}
# don't check dmesg log after test
--
2.13.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-31 8:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-31 8:29 [PATCH] common/rc: insert a line to dmesg on intentional WARNINGs Eryu Guan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox