From patchwork Thu Jan 15 09:30:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 5638001 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75167C058D for ; Thu, 15 Jan 2015 09:31:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DCC92013D for ; Thu, 15 Jan 2015 09:31:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8910120138 for ; Thu, 15 Jan 2015 09:31:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751537AbbAOJbE (ORCPT ); Thu, 15 Jan 2015 04:31:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbbAOJbD (ORCPT ); Thu, 15 Jan 2015 04:31:03 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0F9V2xG029822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Jan 2015 04:31:02 -0500 Received: from localhost (dhcp-12-109.nay.redhat.com [10.66.12.109]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0F9V0ex008498; Thu, 15 Jan 2015 04:31:01 -0500 From: Eryu Guan To: fstests@vger.kernel.org Cc: Eryu Guan Subject: [PATCH 2/3] check: check dmesg log after each test Date: Thu, 15 Jan 2015 17:30:30 +0800 Message-Id: <1421314231-11076-3-git-send-email-eguan@redhat.com> In-Reply-To: <1421314231-11076-1-git-send-email-eguan@redhat.com> References: <1421314231-11076-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check kernel BUG, WARNING etc. in dmesg log after each test and fail the test if something is found. dmesg log can be found at result dir. This check now depends on the logging of running tests in dmesg, so this check can be done without clearing dmesg buffer nor dumping all dmesg to a file, which can potentially eat all free space on testing host. Signed-off-by: Eryu Guan --- check | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/check b/check index 3d42a8b..0830e0c 100755 --- a/check +++ b/check @@ -397,6 +397,32 @@ _check_filesystems() fi } +_check_dmesg() +{ + if [ ! -f ${RESULT_DIR}/check_dmesg ]; then + return + fi + rm -f ${RESULT_DIR}/check_dmesg + + # 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 >$seqres.dmesg + grep -q -e "kernel BUG at" \ + -e "WARNING:" \ + -e "BUG:" \ + -e "Oops:" \ + -e "possible recursive locking detected" \ + $seqres.dmesg + if [ $? -eq 0 ]; then + echo "_check_dmesg: something found in dmesg (see $seqres.dmesg)" + err=true + else + rm -f $seqres.dmesg + fi +} + + _prepare_test_list if $OPTIONS_HAVE_SECTIONS; then @@ -564,6 +590,8 @@ for section in $HOST_OPTIONS_SECTIONS; do if [ -w /dev/kmsg ]; then date_time=`date +"%F %T"` echo "run fstests $seqnum at $date_time" > /dev/kmsg + # _check_dmesg depends on this log in dmesg + touch ${RESULT_DIR}/check_dmesg fi ./$seq >$tmp.rawout 2>&1 sts=$? @@ -630,6 +658,7 @@ for section in $HOST_OPTIONS_SECTIONS; do try="$try $seqnum" n_try=`expr $n_try + 1` _check_filesystems + _check_dmesg fi fi