From patchwork Mon Nov 4 09:00:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 288133 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8EDF62C007E for ; Mon, 4 Nov 2013 20:00:54 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2539A9D0D3; Mon, 4 Nov 2013 04:00:51 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hO1fDTn7-tZj; Mon, 4 Nov 2013 04:00:50 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8BEA89D242; Mon, 4 Nov 2013 04:00:46 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 512139D0D3 for ; Mon, 4 Nov 2013 04:00:45 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HLvErvlvTvRe for ; Mon, 4 Nov 2013 04:00:40 -0500 (EST) Received: from sipsolutions.net (s3.sipsolutions.net [144.76.43.152]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id CACA99CDCC for ; Mon, 4 Nov 2013 04:00:40 -0500 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1VdG1X-00065t-3O; Mon, 04 Nov 2013 10:00:39 +0100 From: Johannes Berg To: hostap@lists.shmoo.com Subject: [PATCH v2] hwsim tests: check kernel messages for warnings/bugs Date: Mon, 4 Nov 2013 10:00:36 +0100 Message-Id: <1383555636-17201-1-git-send-email-johannes@sipsolutions.net> X-Mailer: git-send-email 1.8.4.rc3 Cc: Johannes Berg X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Johannes Berg When a test passes but the kernel printed warnings, consider the test to have failed. Signed-hostap: Johannes Berg --- tests/hwsim/check_kernel.py | 22 ++++++++++++++++++++++ tests/hwsim/run-tests.py | 16 +++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 tests/hwsim/check_kernel.py diff --git a/tests/hwsim/check_kernel.py b/tests/hwsim/check_kernel.py new file mode 100644 index 0000000..30f6718 --- /dev/null +++ b/tests/hwsim/check_kernel.py @@ -0,0 +1,22 @@ +# kernel message checker module +# +# Copyright (c) 2013, Intel Corporation +# +# Author: Johannes Berg +# +# This software may be distributed under the terms of the BSD license. +# See README for more details. +# +""" +Tests for kernel messages to find if there were any issues in them. +""" + +import re + +issue = re.compile('(\[[0-9 .]*\] )?(WARNING:|BUG:).*') + +def check_kernel(logfile): + for line in open(logfile, 'r'): + if issue.match(line): + return False + return True diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 08706f6..e921d74 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -21,6 +21,7 @@ sys.path.append('../../wpaspy') from wpasupplicant import WpaSupplicant from hostapd import HostapdGlobal +from check_kernel import check_kernel def reset_devs(dev, apdev): hapd = HostapdGlobal() @@ -286,15 +287,12 @@ def main(): else: res = t(dev) if res == "skip": - skipped.append(name) result = "SKIP" else: - passed.append(name) result = "PASS" except Exception, e: logger.info(e) result = "FAIL" - failed.append(name) for d in dev: try: d.request("NOTE TEST-STOP " + name) @@ -314,6 +312,18 @@ def main(): end = datetime.now() diff = end - start + + if result == 'PASS' and args.dmesg: + if not check_kernel(os.path.join(args.logdir, name + '.dmesg')): + result = 'FAIL' + + if result == 'PASS': + passed.append(name) + elif result == 'SKIP': + skipped.append(name) + else: + failed.append(name) + report(conn, args.prefill, args.build, args.commit, run, name, result, diff.total_seconds()) result = "{} {} {} {}".format(result, name, diff.total_seconds(), end) logger.info(result)